@kadoa/mcp 0.4.1-rc.3 → 0.4.2-rc.1

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 (2) hide show
  1. package/dist/index.js +80 -62
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,25 +6,43 @@ var __getProtoOf = Object.getPrototypeOf;
6
6
  var __defProp = Object.defineProperty;
7
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ function __accessProp(key) {
10
+ return this[key];
11
+ }
12
+ var __toESMCache_node;
13
+ var __toESMCache_esm;
9
14
  var __toESM = (mod, isNodeMode, target) => {
15
+ var canCache = mod != null && typeof mod === "object";
16
+ if (canCache) {
17
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
18
+ var cached = cache.get(mod);
19
+ if (cached)
20
+ return cached;
21
+ }
10
22
  target = mod != null ? __create(__getProtoOf(mod)) : {};
11
23
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
12
24
  for (let key of __getOwnPropNames(mod))
13
25
  if (!__hasOwnProp.call(to, key))
14
26
  __defProp(to, key, {
15
- get: () => mod[key],
27
+ get: __accessProp.bind(mod, key),
16
28
  enumerable: true
17
29
  });
30
+ if (canCache)
31
+ cache.set(mod, to);
18
32
  return to;
19
33
  };
20
34
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
35
+ var __returnValue = (v) => v;
36
+ function __exportSetter(name, newValue) {
37
+ this[name] = __returnValue.bind(null, newValue);
38
+ }
21
39
  var __export = (target, all) => {
22
40
  for (var name in all)
23
41
  __defProp(target, name, {
24
42
  get: all[name],
25
43
  enumerable: true,
26
44
  configurable: true,
27
- set: (newValue) => all[name] = () => newValue
45
+ set: __exportSetter.bind(all, name)
28
46
  });
29
47
  };
30
48
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -43738,6 +43756,12 @@ var init_axios2 = __esm(() => {
43738
43756
  } = axios_default);
43739
43757
  });
43740
43758
 
43759
+ // node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
43760
+ function isUnsafeProperty(key) {
43761
+ return key === "__proto__";
43762
+ }
43763
+ var init_isUnsafeProperty = () => {};
43764
+
43741
43765
  // node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
43742
43766
  function isPlainObject4(value) {
43743
43767
  if (!value || typeof value !== "object") {
@@ -43752,12 +43776,6 @@ function isPlainObject4(value) {
43752
43776
  }
43753
43777
  var init_isPlainObject = () => {};
43754
43778
 
43755
- // node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
43756
- function isUnsafeProperty(key) {
43757
- return key === "__proto__";
43758
- }
43759
- var init_isUnsafeProperty = () => {};
43760
-
43761
43779
  // node_modules/es-toolkit/dist/object/merge.mjs
43762
43780
  function merge3(target, source) {
43763
43781
  const sourceKeys = Object.keys(source);
@@ -43830,16 +43848,11 @@ var init_dist = __esm(() => {
43830
43848
  init_upperFirst();
43831
43849
  });
43832
43850
 
43833
- // node_modules/uuid/dist-node/stringify.js
43834
- function unsafeStringify(arr, offset = 0) {
43835
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
43836
- }
43837
- var byteToHex;
43838
- var init_stringify = __esm(() => {
43839
- byteToHex = [];
43840
- for (let i = 0;i < 256; ++i) {
43841
- byteToHex.push((i + 256).toString(16).slice(1));
43842
- }
43851
+ // node_modules/uuid/dist-node/native.js
43852
+ import { randomUUID } from "node:crypto";
43853
+ var native_default;
43854
+ var init_native = __esm(() => {
43855
+ native_default = { randomUUID };
43843
43856
  });
43844
43857
 
43845
43858
  // node_modules/uuid/dist-node/rng.js
@@ -43857,11 +43870,16 @@ var init_rng = __esm(() => {
43857
43870
  poolPtr = rnds8Pool.length;
43858
43871
  });
43859
43872
 
43860
- // node_modules/uuid/dist-node/native.js
43861
- import { randomUUID } from "node:crypto";
43862
- var native_default;
43863
- var init_native = __esm(() => {
43864
- native_default = { randomUUID };
43873
+ // node_modules/uuid/dist-node/stringify.js
43874
+ function unsafeStringify(arr, offset = 0) {
43875
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
43876
+ }
43877
+ var byteToHex;
43878
+ var init_stringify = __esm(() => {
43879
+ byteToHex = [];
43880
+ for (let i = 0;i < 256; ++i) {
43881
+ byteToHex.push((i + 256).toString(16).slice(1));
43882
+ }
43865
43883
  });
43866
43884
 
43867
43885
  // node_modules/uuid/dist-node/v4.js
@@ -46569,7 +46587,7 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
46569
46587
  options: localVarRequestOptions
46570
46588
  };
46571
46589
  },
46572
- v4WorkflowsWorkflowIdDataGet: async (workflowId, xApiKey, authorization, runId, format, sortBy, order, filters, page, limit, gzip, rowIds, includeAnomalies, options = {}) => {
46590
+ v4WorkflowsWorkflowIdDataGet: async (workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, options = {}) => {
46573
46591
  assertParamExists("v4WorkflowsWorkflowIdDataGet", "workflowId", workflowId);
46574
46592
  const localVarPath = `/v4/workflows/{workflowId}/data`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
46575
46593
  const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
@@ -46588,8 +46606,8 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
46588
46606
  if (format !== undefined) {
46589
46607
  localVarQueryParameter["format"] = format;
46590
46608
  }
46591
- if (sortBy !== undefined) {
46592
- localVarQueryParameter["sortBy"] = sortBy;
46609
+ if (sortBy2 !== undefined) {
46610
+ localVarQueryParameter["sortBy"] = sortBy2;
46593
46611
  }
46594
46612
  if (order !== undefined) {
46595
46613
  localVarQueryParameter["order"] = order;
@@ -46987,8 +47005,8 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
46987
47005
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdComplianceRejectPut"]?.[localVarOperationServerIndex]?.url;
46988
47006
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
46989
47007
  },
46990
- async v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy, order, filters, page, limit, gzip, rowIds, includeAnomalies, options) {
46991
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy, order, filters, page, limit, gzip, rowIds, includeAnomalies, options);
47008
+ async v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, options) {
47009
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, options);
46992
47010
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
46993
47011
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdDataGet"]?.[localVarOperationServerIndex]?.url;
46994
47012
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
@@ -48416,11 +48434,11 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
48416
48434
  }
48417
48435
  }, safeDelayMs);
48418
48436
  }
48419
- normalizeReconnectDelay(delay) {
48420
- if (typeof delay !== "number" || !Number.isFinite(delay)) {
48437
+ normalizeReconnectDelay(delay2) {
48438
+ if (typeof delay2 !== "number" || !Number.isFinite(delay2)) {
48421
48439
  return _Realtime2.DEFAULT_RECONNECT_DELAY_MS;
48422
48440
  }
48423
- return Math.min(Math.max(0, Math.trunc(delay)), _Realtime2.MAX_RECONNECT_DELAY_MS);
48441
+ return Math.min(Math.max(0, Math.trunc(delay2)), _Realtime2.MAX_RECONNECT_DELAY_MS);
48424
48442
  }
48425
48443
  isDuplicateEvent(eventId) {
48426
48444
  if (!eventId) {
@@ -49179,9 +49197,9 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
49179
49197
  this._baseUrl = config2.baseUrl ?? PUBLIC_API_URI;
49180
49198
  this._apiKey = config2.apiKey ?? "";
49181
49199
  this._bearerToken = config2.bearerToken;
49182
- const timeout = config2.timeout ?? 30000;
49200
+ const timeout2 = config2.timeout ?? 30000;
49183
49201
  const headers = createSdkHeaders();
49184
- this._axiosInstance = createAxiosInstance({ timeout, headers });
49202
+ this._axiosInstance = createAxiosInstance({ timeout: timeout2, headers });
49185
49203
  this._axiosInstance.interceptors.request.use((reqConfig) => {
49186
49204
  if (this._bearerToken) {
49187
49205
  if (!reqConfig.headers["Authorization"]) {
@@ -50963,7 +50981,7 @@ function registerTools(server, ctx) {
50963
50981
  inputSchema: strictSchema({
50964
50982
  key: exports_external.string().describe("Variable key (must be unique within scope). Referenced in prompts as @key."),
50965
50983
  value: exports_external.string().describe("Variable value"),
50966
- dataType: exports_external.enum(["STRING", "NUMBER", "BOOLEAN", "JSON"]).optional().describe("Data type of the value (defaults to STRING)")
50984
+ dataType: exports_external.enum(["STRING", "SECRET", "OBJECT", "ARRAY"]).optional().describe("Data type of the value (defaults to STRING)")
50967
50985
  }),
50968
50986
  annotations: {
50969
50987
  readOnlyHint: false,
@@ -51017,7 +51035,7 @@ function registerTools(server, ctx) {
51017
51035
  variableId: exports_external.string().describe("The variable ID to update"),
51018
51036
  key: exports_external.string().optional().describe("New variable key"),
51019
51037
  value: exports_external.string().optional().describe("New variable value"),
51020
- dataType: exports_external.enum(["STRING", "NUMBER", "BOOLEAN", "JSON"]).optional().describe("New data type")
51038
+ dataType: exports_external.enum(["STRING", "SECRET", "OBJECT", "ARRAY"]).optional().describe("New data type")
51021
51039
  }),
51022
51040
  annotations: {
51023
51041
  readOnlyHint: false,
@@ -51341,7 +51359,7 @@ var package_default;
51341
51359
  var init_package = __esm(() => {
51342
51360
  package_default = {
51343
51361
  name: "@kadoa/mcp",
51344
- version: "0.4.1-rc.3",
51362
+ version: "0.4.2-rc.1",
51345
51363
  description: "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
51346
51364
  type: "module",
51347
51365
  main: "dist/index.js",
@@ -51469,7 +51487,7 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
51469
51487
  };
51470
51488
  writable.on("close", cancel);
51471
51489
  writable.on("error", cancel);
51472
- (currentReadPromise ?? reader.read()).then(flow, handleStreamError);
51490
+ (currentReadPromise ?? reader.read()).then(flow2, handleStreamError);
51473
51491
  return reader.closed.finally(() => {
51474
51492
  writable.off("close", cancel);
51475
51493
  writable.off("error", cancel);
@@ -51480,16 +51498,16 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
51480
51498
  }
51481
51499
  }
51482
51500
  function onDrain() {
51483
- reader.read().then(flow, handleStreamError);
51501
+ reader.read().then(flow2, handleStreamError);
51484
51502
  }
51485
- function flow({ done, value }) {
51503
+ function flow2({ done, value }) {
51486
51504
  try {
51487
51505
  if (done) {
51488
51506
  writable.end();
51489
51507
  } else if (!writable.write(value)) {
51490
51508
  writable.once("drain", onDrain);
51491
51509
  } else {
51492
- return reader.read().then(flow, handleStreamError);
51510
+ return reader.read().then(flow2, handleStreamError);
51493
51511
  }
51494
51512
  } catch (e) {
51495
51513
  handleStreamError(e);
@@ -51660,8 +51678,8 @@ var RequestError, toRequestError = (e) => {
51660
51678
  await writeFromReadableStream(body, outgoing)?.catch((e) => handleResponseError(e, outgoing));
51661
51679
  }
51662
51680
  outgoing[outgoingEnded]?.();
51663
- }, isPromise = (res) => typeof res.then === "function", responseViaResponseObject = async (res, outgoing, options = {}) => {
51664
- if (isPromise(res)) {
51681
+ }, isPromise2 = (res) => typeof res.then === "function", responseViaResponseObject = async (res, outgoing, options = {}) => {
51682
+ if (isPromise2(res)) {
51665
51683
  if (options.errorHandler) {
51666
51684
  try {
51667
51685
  res = await res;
@@ -51689,11 +51707,11 @@ var RequestError, toRequestError = (e) => {
51689
51707
  let maxReadCount = 2;
51690
51708
  for (let i = 0;i < maxReadCount; i++) {
51691
51709
  currentReadPromise ||= reader.read();
51692
- const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
51710
+ const chunk2 = await readWithoutBlocking(currentReadPromise).catch((e) => {
51693
51711
  console.error(e);
51694
51712
  done = true;
51695
51713
  });
51696
- if (!chunk) {
51714
+ if (!chunk2) {
51697
51715
  if (i === 1) {
51698
51716
  await new Promise((resolve) => setTimeout(resolve));
51699
51717
  maxReadCount = 3;
@@ -51702,10 +51720,10 @@ var RequestError, toRequestError = (e) => {
51702
51720
  break;
51703
51721
  }
51704
51722
  currentReadPromise = undefined;
51705
- if (chunk.value) {
51706
- values.push(chunk.value);
51723
+ if (chunk2.value) {
51724
+ values.push(chunk2.value);
51707
51725
  }
51708
- if (chunk.done) {
51726
+ if (chunk2.done) {
51709
51727
  done = true;
51710
51728
  break;
51711
51729
  }
@@ -52842,7 +52860,7 @@ var require_lib = __commonJS((exports, module) => {
52842
52860
  preflightContinue: false,
52843
52861
  optionsSuccessStatus: 204
52844
52862
  };
52845
- function isString2(s) {
52863
+ function isString3(s) {
52846
52864
  return typeof s === "string" || s instanceof String;
52847
52865
  }
52848
52866
  function isOriginAllowed(origin2, allowedOrigin) {
@@ -52853,7 +52871,7 @@ var require_lib = __commonJS((exports, module) => {
52853
52871
  }
52854
52872
  }
52855
52873
  return false;
52856
- } else if (isString2(allowedOrigin)) {
52874
+ } else if (isString3(allowedOrigin)) {
52857
52875
  return origin2 === allowedOrigin;
52858
52876
  } else if (allowedOrigin instanceof RegExp) {
52859
52877
  return allowedOrigin.test(origin2);
@@ -52868,7 +52886,7 @@ var require_lib = __commonJS((exports, module) => {
52868
52886
  key: "Access-Control-Allow-Origin",
52869
52887
  value: "*"
52870
52888
  }]);
52871
- } else if (isString2(options.origin)) {
52889
+ } else if (isString3(options.origin)) {
52872
52890
  headers.push([{
52873
52891
  key: "Access-Control-Allow-Origin",
52874
52892
  value: options.origin
@@ -53513,7 +53531,7 @@ var require_ipv6 = __commonJS((exports) => {
53513
53531
  n = n.replace(/^(0{1,})(0)$/, '<span class="parse-error">$1</span>$2');
53514
53532
  return n;
53515
53533
  }
53516
- function compact(address, slice) {
53534
+ function compact2(address, slice) {
53517
53535
  const s1 = [];
53518
53536
  const s2 = [];
53519
53537
  let i;
@@ -53753,7 +53771,7 @@ var require_ipv6 = __commonJS((exports) => {
53753
53771
  const zeroLengths = zeroes.map((n) => n[1] - n[0] + 1);
53754
53772
  if (zeroes.length > 0) {
53755
53773
  const index = zeroLengths.indexOf(Math.max(...zeroLengths));
53756
- groups = compact(this.parsedAddress, zeroes[index]);
53774
+ groups = compact2(this.parsedAddress, zeroes[index]);
53757
53775
  } else {
53758
53776
  groups = this.parsedAddress;
53759
53777
  }
@@ -53803,14 +53821,14 @@ var require_ipv6 = __commonJS((exports) => {
53803
53821
  const halves = address.split("::");
53804
53822
  if (halves.length === 2) {
53805
53823
  let first = halves[0].split(":");
53806
- let last = halves[1].split(":");
53824
+ let last2 = halves[1].split(":");
53807
53825
  if (first.length === 1 && first[0] === "") {
53808
53826
  first = [];
53809
53827
  }
53810
- if (last.length === 1 && last[0] === "") {
53811
- last = [];
53828
+ if (last2.length === 1 && last2[0] === "") {
53829
+ last2 = [];
53812
53830
  }
53813
- const remaining = this.groups - (first.length + last.length);
53831
+ const remaining = this.groups - (first.length + last2.length);
53814
53832
  if (!remaining) {
53815
53833
  throw new address_error_1.AddressError("Error parsing groups");
53816
53834
  }
@@ -53821,7 +53839,7 @@ var require_ipv6 = __commonJS((exports) => {
53821
53839
  for (let i = 0;i < remaining; i++) {
53822
53840
  groups.push("0");
53823
53841
  }
53824
- groups = groups.concat(last);
53842
+ groups = groups.concat(last2);
53825
53843
  } else if (halves.length === 1) {
53826
53844
  groups = address.split(":");
53827
53845
  this.elidedGroups = 0;
@@ -56457,7 +56475,7 @@ async function startHttpServer(options) {
56457
56475
  });
56458
56476
  return;
56459
56477
  }
56460
- const identity = `jwt:${auth.userId.slice(0, 8)}...:team=${auth.teamId.slice(0, 8)}...`;
56478
+ const identity2 = `jwt:${auth.userId.slice(0, 8)}...:team=${auth.teamId.slice(0, 8)}...`;
56461
56479
  if (isJwtExpired(auth.jwt)) {
56462
56480
  try {
56463
56481
  const refreshed = await refreshSupabaseJwtRaw(auth.refreshToken);
@@ -56473,13 +56491,13 @@ async function startHttpServer(options) {
56473
56491
  supabaseJwt: refreshed.jwt,
56474
56492
  supabaseRefreshToken: refreshed.refreshToken
56475
56493
  }, Math.ceil(remainingMs / 1000));
56476
- console.error(`[PROACTIVE_REFRESH] OK: JWT refreshed on ${method} (${identity})`);
56494
+ console.error(`[PROACTIVE_REFRESH] OK: JWT refreshed on ${method} (${identity2})`);
56477
56495
  }
56478
56496
  }
56479
56497
  }
56480
56498
  } catch (error48) {
56481
56499
  if (error48 instanceof SessionExpiredError) {
56482
- console.error(`[PROACTIVE_REFRESH] Session dead on ${method} (${identity}): ${error48.message}`);
56500
+ console.error(`[PROACTIVE_REFRESH] Session dead on ${method} (${identity2}): ${error48.message}`);
56483
56501
  await store.del("access_tokens", auth.mcpToken);
56484
56502
  res.status(401).json({
56485
56503
  jsonrpc: "2.0",
@@ -56492,7 +56510,7 @@ async function startHttpServer(options) {
56492
56510
  }
56493
56511
  }
56494
56512
  try {
56495
- console.error(`[MCP] POST method=${method} auth=${identity}`);
56513
+ console.error(`[MCP] POST method=${method} auth=${identity2}`);
56496
56514
  const transport = new StreamableHTTPServerTransport({
56497
56515
  sessionIdGenerator: undefined
56498
56516
  });
@@ -56524,7 +56542,7 @@ async function startHttpServer(options) {
56524
56542
  await server.connect(transport);
56525
56543
  await transport.handleRequest(req, res, req.body);
56526
56544
  } catch (error48) {
56527
- console.error(`[MCP] 500 method=${method} auth=${identity} error=`, error48);
56545
+ console.error(`[MCP] 500 method=${method} auth=${identity2} error=`, error48);
56528
56546
  if (!res.headersSent) {
56529
56547
  res.status(500).json({
56530
56548
  jsonrpc: "2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kadoa/mcp",
3
- "version": "0.4.1-rc.3",
3
+ "version": "0.4.2-rc.1",
4
4
  "description": "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",