@fre4x/grok 1.1.8 → 1.1.9

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 +106 -90
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2991,7 +2991,7 @@ var require_compile = __commonJS({
2991
2991
  const schOrFunc = root.refs[ref];
2992
2992
  if (schOrFunc)
2993
2993
  return schOrFunc;
2994
- let _sch = resolve.call(this, root, ref);
2994
+ let _sch = resolve2.call(this, root, ref);
2995
2995
  if (_sch === void 0) {
2996
2996
  const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
2997
2997
  const { schemaId } = this.opts;
@@ -3018,7 +3018,7 @@ var require_compile = __commonJS({
3018
3018
  function sameSchemaEnv(s1, s2) {
3019
3019
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3020
3020
  }
3021
- function resolve(root, ref) {
3021
+ function resolve2(root, ref) {
3022
3022
  let sch;
3023
3023
  while (typeof (sch = this.refs[ref]) == "string")
3024
3024
  ref = sch;
@@ -3236,8 +3236,8 @@ var require_utils = __commonJS({
3236
3236
  }
3237
3237
  return ind;
3238
3238
  }
3239
- function removeDotSegments(path3) {
3240
- let input = path3;
3239
+ function removeDotSegments(path4) {
3240
+ let input = path4;
3241
3241
  const output = [];
3242
3242
  let nextSlash = -1;
3243
3243
  let len = 0;
@@ -3489,8 +3489,8 @@ var require_schemes = __commonJS({
3489
3489
  wsComponent.secure = void 0;
3490
3490
  }
3491
3491
  if (wsComponent.resourceName) {
3492
- const [path3, query] = wsComponent.resourceName.split("?");
3493
- wsComponent.path = path3 && path3 !== "/" ? path3 : void 0;
3492
+ const [path4, query] = wsComponent.resourceName.split("?");
3493
+ wsComponent.path = path4 && path4 !== "/" ? path4 : void 0;
3494
3494
  wsComponent.query = query;
3495
3495
  wsComponent.resourceName = void 0;
3496
3496
  }
@@ -3649,7 +3649,7 @@ var require_fast_uri = __commonJS({
3649
3649
  }
3650
3650
  return uri;
3651
3651
  }
3652
- function resolve(baseURI, relativeURI, options) {
3652
+ function resolve2(baseURI, relativeURI, options) {
3653
3653
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
3654
3654
  const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
3655
3655
  schemelessOptions.skipEscape = true;
@@ -3907,7 +3907,7 @@ var require_fast_uri = __commonJS({
3907
3907
  var fastUri = {
3908
3908
  SCHEMES,
3909
3909
  normalize,
3910
- resolve,
3910
+ resolve: resolve2,
3911
3911
  resolveComponent,
3912
3912
  equal,
3913
3913
  serialize,
@@ -15743,11 +15743,11 @@ var require_mime_types = __commonJS({
15743
15743
  }
15744
15744
  return exts[0];
15745
15745
  }
15746
- function lookup(path3) {
15747
- if (!path3 || typeof path3 !== "string") {
15746
+ function lookup(path4) {
15747
+ if (!path4 || typeof path4 !== "string") {
15748
15748
  return false;
15749
15749
  }
15750
- var extension2 = extname("x." + path3).toLowerCase().substr(1);
15750
+ var extension2 = extname("x." + path4).toLowerCase().substr(1);
15751
15751
  if (!extension2) {
15752
15752
  return false;
15753
15753
  }
@@ -16852,7 +16852,7 @@ var require_form_data = __commonJS({
16852
16852
  "use strict";
16853
16853
  var CombinedStream = require_combined_stream();
16854
16854
  var util4 = __require("util");
16855
- var path3 = __require("path");
16855
+ var path4 = __require("path");
16856
16856
  var http3 = __require("http");
16857
16857
  var https3 = __require("https");
16858
16858
  var parseUrl = __require("url").parse;
@@ -16983,11 +16983,11 @@ var require_form_data = __commonJS({
16983
16983
  FormData3.prototype._getContentDisposition = function(value, options) {
16984
16984
  var filename;
16985
16985
  if (typeof options.filepath === "string") {
16986
- filename = path3.normalize(options.filepath).replace(/\\/g, "/");
16986
+ filename = path4.normalize(options.filepath).replace(/\\/g, "/");
16987
16987
  } else if (options.filename || value && (value.name || value.path)) {
16988
- filename = path3.basename(options.filename || value && (value.name || value.path));
16988
+ filename = path4.basename(options.filename || value && (value.name || value.path));
16989
16989
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
16990
- filename = path3.basename(value.client._httpMessage.path || "");
16990
+ filename = path4.basename(value.client._httpMessage.path || "");
16991
16991
  }
16992
16992
  if (filename) {
16993
16993
  return 'filename="' + escapeHeaderParam(filename) + '"';
@@ -17718,7 +17718,7 @@ var require_has_flag = __commonJS({
17718
17718
  var require_supports_color = __commonJS({
17719
17719
  "../node_modules/supports-color/index.js"(exports, module) {
17720
17720
  "use strict";
17721
- var os2 = __require("os");
17721
+ var os3 = __require("os");
17722
17722
  var tty = __require("tty");
17723
17723
  var hasFlag = require_has_flag();
17724
17724
  var { env } = process;
@@ -17775,7 +17775,7 @@ var require_supports_color = __commonJS({
17775
17775
  return min;
17776
17776
  }
17777
17777
  if (process.platform === "win32") {
17778
- const osRelease = os2.release().split(".");
17778
+ const osRelease = os3.release().split(".");
17779
17779
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
17780
17780
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
17781
17781
  }
@@ -18907,8 +18907,8 @@ function getErrorMap() {
18907
18907
 
18908
18908
  // ../node_modules/zod/v3/helpers/parseUtil.js
18909
18909
  var makeIssue = (params) => {
18910
- const { data, path: path3, errorMaps, issueData } = params;
18911
- const fullPath = [...path3, ...issueData.path || []];
18910
+ const { data, path: path4, errorMaps, issueData } = params;
18911
+ const fullPath = [...path4, ...issueData.path || []];
18912
18912
  const fullIssue = {
18913
18913
  ...issueData,
18914
18914
  path: fullPath
@@ -19023,11 +19023,11 @@ var errorUtil;
19023
19023
 
19024
19024
  // ../node_modules/zod/v3/types.js
19025
19025
  var ParseInputLazyPath = class {
19026
- constructor(parent, value, path3, key) {
19026
+ constructor(parent, value, path4, key) {
19027
19027
  this._cachedPath = [];
19028
19028
  this.parent = parent;
19029
19029
  this.data = value;
19030
- this._path = path3;
19030
+ this._path = path4;
19031
19031
  this._key = key;
19032
19032
  }
19033
19033
  get path() {
@@ -22950,10 +22950,10 @@ function mergeDefs(...defs) {
22950
22950
  function cloneDef(schema) {
22951
22951
  return mergeDefs(schema._zod.def);
22952
22952
  }
22953
- function getElementAtPath(obj, path3) {
22954
- if (!path3)
22953
+ function getElementAtPath(obj, path4) {
22954
+ if (!path4)
22955
22955
  return obj;
22956
- return path3.reduce((acc, key) => acc?.[key], obj);
22956
+ return path4.reduce((acc, key) => acc?.[key], obj);
22957
22957
  }
22958
22958
  function promiseAllObject(promisesObj) {
22959
22959
  const keys = Object.keys(promisesObj);
@@ -23336,11 +23336,11 @@ function aborted(x, startIndex = 0) {
23336
23336
  }
23337
23337
  return false;
23338
23338
  }
23339
- function prefixIssues(path3, issues) {
23339
+ function prefixIssues(path4, issues) {
23340
23340
  return issues.map((iss) => {
23341
23341
  var _a2;
23342
23342
  (_a2 = iss).path ?? (_a2.path = []);
23343
- iss.path.unshift(path3);
23343
+ iss.path.unshift(path4);
23344
23344
  return iss;
23345
23345
  });
23346
23346
  }
@@ -23523,7 +23523,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
23523
23523
  }
23524
23524
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
23525
23525
  const result = { errors: [] };
23526
- const processError = (error49, path3 = []) => {
23526
+ const processError = (error49, path4 = []) => {
23527
23527
  var _a2, _b;
23528
23528
  for (const issue2 of error49.issues) {
23529
23529
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -23533,7 +23533,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
23533
23533
  } else if (issue2.code === "invalid_element") {
23534
23534
  processError({ issues: issue2.issues }, issue2.path);
23535
23535
  } else {
23536
- const fullpath = [...path3, ...issue2.path];
23536
+ const fullpath = [...path4, ...issue2.path];
23537
23537
  if (fullpath.length === 0) {
23538
23538
  result.errors.push(mapper(issue2));
23539
23539
  continue;
@@ -23565,8 +23565,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
23565
23565
  }
23566
23566
  function toDotPath(_path) {
23567
23567
  const segs = [];
23568
- const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
23569
- for (const seg of path3) {
23568
+ const path4 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
23569
+ for (const seg of path4) {
23570
23570
  if (typeof seg === "number")
23571
23571
  segs.push(`[${seg}]`);
23572
23572
  else if (typeof seg === "symbol")
@@ -35972,13 +35972,13 @@ function resolveRef(ref, ctx) {
35972
35972
  if (!ref.startsWith("#")) {
35973
35973
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
35974
35974
  }
35975
- const path3 = ref.slice(1).split("/").filter(Boolean);
35976
- if (path3.length === 0) {
35975
+ const path4 = ref.slice(1).split("/").filter(Boolean);
35976
+ if (path4.length === 0) {
35977
35977
  return ctx.rootSchema;
35978
35978
  }
35979
35979
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
35980
- if (path3[0] === defsKey) {
35981
- const key = path3[1];
35980
+ if (path4[0] === defsKey) {
35981
+ const key = path4[1];
35982
35982
  if (!key || !ctx.defs[key]) {
35983
35983
  throw new Error(`Reference not found: ${ref}`);
35984
35984
  }
@@ -39742,7 +39742,7 @@ var Protocol = class {
39742
39742
  return;
39743
39743
  }
39744
39744
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
39745
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
39745
+ await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
39746
39746
  options?.signal?.throwIfAborted();
39747
39747
  }
39748
39748
  } catch (error48) {
@@ -39759,7 +39759,7 @@ var Protocol = class {
39759
39759
  */
39760
39760
  request(request, resultSchema, options) {
39761
39761
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
39762
- return new Promise((resolve, reject) => {
39762
+ return new Promise((resolve2, reject) => {
39763
39763
  const earlyReject = (error48) => {
39764
39764
  reject(error48);
39765
39765
  };
@@ -39837,7 +39837,7 @@ var Protocol = class {
39837
39837
  if (!parseResult.success) {
39838
39838
  reject(parseResult.error);
39839
39839
  } else {
39840
- resolve(parseResult.data);
39840
+ resolve2(parseResult.data);
39841
39841
  }
39842
39842
  } catch (error48) {
39843
39843
  reject(error48);
@@ -40098,12 +40098,12 @@ var Protocol = class {
40098
40098
  }
40099
40099
  } catch {
40100
40100
  }
40101
- return new Promise((resolve, reject) => {
40101
+ return new Promise((resolve2, reject) => {
40102
40102
  if (signal.aborted) {
40103
40103
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
40104
40104
  return;
40105
40105
  }
40106
- const timeoutId = setTimeout(resolve, interval);
40106
+ const timeoutId = setTimeout(resolve2, interval);
40107
40107
  signal.addEventListener("abort", () => {
40108
40108
  clearTimeout(timeoutId);
40109
40109
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -41447,7 +41447,7 @@ var McpServer = class {
41447
41447
  let task = createTaskResult.task;
41448
41448
  const pollInterval = task.pollInterval ?? 5e3;
41449
41449
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
41450
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
41450
+ await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
41451
41451
  const updatedTask = await extra.taskStore.getTask(taskId);
41452
41452
  if (!updatedTask) {
41453
41453
  throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
@@ -42096,12 +42096,12 @@ var StdioServerTransport = class {
42096
42096
  this.onclose?.();
42097
42097
  }
42098
42098
  send(message) {
42099
- return new Promise((resolve) => {
42099
+ return new Promise((resolve2) => {
42100
42100
  const json2 = serializeMessage(message);
42101
42101
  if (this._stdout.write(json2)) {
42102
- resolve();
42102
+ resolve2();
42103
42103
  } else {
42104
- this._stdout.once("drain", resolve);
42104
+ this._stdout.once("drain", resolve2);
42105
42105
  }
42106
42106
  });
42107
42107
  }
@@ -42161,7 +42161,7 @@ function createInternalError(error48) {
42161
42161
  type: "text",
42162
42162
  text: `Internal Error: ${message}
42163
42163
 
42164
- Suggestion: If the problem persists, check server logs.`
42164
+ Suggestion: Use the error details above to correct tool arguments and retry the tool call.`
42165
42165
  }
42166
42166
  ]
42167
42167
  };
@@ -42209,17 +42209,33 @@ var paginationSchema = z2.object({
42209
42209
 
42210
42210
  // ../packages/shared/dist/cache.js
42211
42211
  import * as fs from "node:fs/promises";
42212
- import * as path from "node:path";
42213
- import * as os from "node:os";
42212
+ import * as path2 from "node:path";
42213
+ import * as os2 from "node:os";
42214
42214
  import * as crypto from "node:crypto";
42215
+
42216
+ // ../packages/shared/dist/paths.js
42217
+ import * as os from "node:os";
42218
+ import * as path from "node:path";
42219
+ function resolveUserPath(input) {
42220
+ const value = input.trim();
42221
+ if (value === "~") {
42222
+ return os.homedir();
42223
+ }
42224
+ if (value.startsWith("~/") || value.startsWith(`~${path.sep}`)) {
42225
+ return path.join(os.homedir(), value.slice(2));
42226
+ }
42227
+ return path.resolve(value);
42228
+ }
42229
+
42230
+ // ../packages/shared/dist/cache.js
42215
42231
  var PersistentCache = class {
42216
42232
  cacheDir;
42217
42233
  memoryCache = /* @__PURE__ */ new Map();
42218
42234
  onDiskWriteError;
42219
42235
  dirPromise;
42220
42236
  constructor(namespace, options = {}) {
42221
- const baseDir = options.dir ?? process.env.FRE4X_CACHE_DIR ?? path.join(os.homedir(), ".fre4x-cache");
42222
- this.cacheDir = path.join(baseDir, namespace);
42237
+ const baseDir = resolveUserPath(options.dir ?? process.env.FRE4X_CACHE_DIR ?? path2.join(os2.homedir(), ".fre4x-cache"));
42238
+ this.cacheDir = path2.join(baseDir, namespace);
42223
42239
  this.onDiskWriteError = options.onDiskWriteError;
42224
42240
  }
42225
42241
  async ensureDir() {
@@ -42230,7 +42246,7 @@ var PersistentCache = class {
42230
42246
  }
42231
42247
  getFilePath(key) {
42232
42248
  const safeKey = crypto.createHash("sha256").update(key).digest("hex");
42233
- return path.join(this.cacheDir, `${safeKey}.json`);
42249
+ return path2.join(this.cacheDir, `${safeKey}.json`);
42234
42250
  }
42235
42251
  async get(key) {
42236
42252
  const now = Date.now();
@@ -42793,9 +42809,9 @@ function isVisitable(thing) {
42793
42809
  function removeBrackets(key) {
42794
42810
  return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
42795
42811
  }
42796
- function renderKey(path3, key, dots) {
42797
- if (!path3) return key;
42798
- return path3.concat(key).map(function each(token, i) {
42812
+ function renderKey(path4, key, dots) {
42813
+ if (!path4) return key;
42814
+ return path4.concat(key).map(function each(token, i) {
42799
42815
  token = removeBrackets(token);
42800
42816
  return !dots && i ? "[" + token + "]" : token;
42801
42817
  }).join(dots ? "." : "");
@@ -42843,9 +42859,9 @@ function toFormData(obj, formData, options) {
42843
42859
  }
42844
42860
  return value;
42845
42861
  }
42846
- function defaultVisitor(value, key, path3) {
42862
+ function defaultVisitor(value, key, path4) {
42847
42863
  let arr = value;
42848
- if (value && !path3 && typeof value === "object") {
42864
+ if (value && !path4 && typeof value === "object") {
42849
42865
  if (utils_default.endsWith(key, "{}")) {
42850
42866
  key = metaTokens ? key : key.slice(0, -2);
42851
42867
  value = JSON.stringify(value);
@@ -42864,7 +42880,7 @@ function toFormData(obj, formData, options) {
42864
42880
  if (isVisitable(value)) {
42865
42881
  return true;
42866
42882
  }
42867
- formData.append(renderKey(path3, key, dots), convertValue(value));
42883
+ formData.append(renderKey(path4, key, dots), convertValue(value));
42868
42884
  return false;
42869
42885
  }
42870
42886
  const stack = [];
@@ -42873,10 +42889,10 @@ function toFormData(obj, formData, options) {
42873
42889
  convertValue,
42874
42890
  isVisitable
42875
42891
  });
42876
- function build(value, path3) {
42892
+ function build(value, path4) {
42877
42893
  if (utils_default.isUndefined(value)) return;
42878
42894
  if (stack.indexOf(value) !== -1) {
42879
- throw Error("Circular reference detected in " + path3.join("."));
42895
+ throw Error("Circular reference detected in " + path4.join("."));
42880
42896
  }
42881
42897
  stack.push(value);
42882
42898
  utils_default.forEach(value, function each(el, key) {
@@ -42884,11 +42900,11 @@ function toFormData(obj, formData, options) {
42884
42900
  formData,
42885
42901
  el,
42886
42902
  utils_default.isString(key) ? key.trim() : key,
42887
- path3,
42903
+ path4,
42888
42904
  exposedHelpers
42889
42905
  );
42890
42906
  if (result === true) {
42891
- build(el, path3 ? path3.concat(key) : [key]);
42907
+ build(el, path4 ? path4.concat(key) : [key]);
42892
42908
  }
42893
42909
  });
42894
42910
  stack.pop();
@@ -43100,7 +43116,7 @@ var platform_default = {
43100
43116
  // ../node_modules/axios/lib/helpers/toURLEncodedForm.js
43101
43117
  function toURLEncodedForm(data, options) {
43102
43118
  return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
43103
- visitor: function(value, key, path3, helpers) {
43119
+ visitor: function(value, key, path4, helpers) {
43104
43120
  if (platform_default.isNode && utils_default.isBuffer(value)) {
43105
43121
  this.append(key, value.toString("base64"));
43106
43122
  return false;
@@ -43130,11 +43146,11 @@ function arrayToObject(arr) {
43130
43146
  return obj;
43131
43147
  }
43132
43148
  function formDataToJSON(formData) {
43133
- function buildPath(path3, value, target, index) {
43134
- let name = path3[index++];
43149
+ function buildPath(path4, value, target, index) {
43150
+ let name = path4[index++];
43135
43151
  if (name === "__proto__") return true;
43136
43152
  const isNumericKey = Number.isFinite(+name);
43137
- const isLast = index >= path3.length;
43153
+ const isLast = index >= path4.length;
43138
43154
  name = !name && utils_default.isArray(target) ? target.length : name;
43139
43155
  if (isLast) {
43140
43156
  if (utils_default.hasOwnProp(target, name)) {
@@ -43147,7 +43163,7 @@ function formDataToJSON(formData) {
43147
43163
  if (!target[name] || !utils_default.isObject(target[name])) {
43148
43164
  target[name] = [];
43149
43165
  }
43150
- const result = buildPath(path3, value, target[name], index);
43166
+ const result = buildPath(path4, value, target[name], index);
43151
43167
  if (result && utils_default.isArray(target[name])) {
43152
43168
  target[name] = arrayToObject(target[name]);
43153
43169
  }
@@ -43585,10 +43601,10 @@ var CanceledError = class extends AxiosError_default {
43585
43601
  var CanceledError_default = CanceledError;
43586
43602
 
43587
43603
  // ../node_modules/axios/lib/core/settle.js
43588
- function settle(resolve, reject, response) {
43604
+ function settle(resolve2, reject, response) {
43589
43605
  const validateStatus2 = response.config.validateStatus;
43590
43606
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
43591
- resolve(response);
43607
+ resolve2(response);
43592
43608
  } else {
43593
43609
  reject(new AxiosError_default(
43594
43610
  "Request failed with status code " + response.status,
@@ -44217,7 +44233,7 @@ function setProxy(options, configProxy, location) {
44217
44233
  }
44218
44234
  var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
44219
44235
  var wrapAsync = (asyncExecutor) => {
44220
- return new Promise((resolve, reject) => {
44236
+ return new Promise((resolve2, reject) => {
44221
44237
  let onDone;
44222
44238
  let isDone;
44223
44239
  const done = (value, isRejected) => {
@@ -44227,7 +44243,7 @@ var wrapAsync = (asyncExecutor) => {
44227
44243
  };
44228
44244
  const _resolve = (value) => {
44229
44245
  done(value);
44230
- resolve(value);
44246
+ resolve2(value);
44231
44247
  };
44232
44248
  const _reject = (reason) => {
44233
44249
  done(reason, true);
@@ -44279,7 +44295,7 @@ var http2Transport = {
44279
44295
  }
44280
44296
  };
44281
44297
  var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
44282
- return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
44298
+ return wrapAsync(async function dispatchHttpRequest(resolve2, reject, onDone) {
44283
44299
  let { data, lookup, family, httpVersion = 1, http2Options } = config2;
44284
44300
  const { responseType, responseEncoding } = config2;
44285
44301
  const method = config2.method.toUpperCase();
@@ -44364,7 +44380,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
44364
44380
  }
44365
44381
  let convertedData;
44366
44382
  if (method !== "GET") {
44367
- return settle(resolve, reject, {
44383
+ return settle(resolve2, reject, {
44368
44384
  status: 405,
44369
44385
  statusText: "method not allowed",
44370
44386
  headers: {},
@@ -44386,7 +44402,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
44386
44402
  } else if (responseType === "stream") {
44387
44403
  convertedData = stream3.Readable.from(convertedData);
44388
44404
  }
44389
- return settle(resolve, reject, {
44405
+ return settle(resolve2, reject, {
44390
44406
  data: convertedData,
44391
44407
  status: 200,
44392
44408
  statusText: "OK",
@@ -44484,9 +44500,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
44484
44500
  auth = urlUsername + ":" + urlPassword;
44485
44501
  }
44486
44502
  auth && headers.delete("authorization");
44487
- let path3;
44503
+ let path4;
44488
44504
  try {
44489
- path3 = buildURL(
44505
+ path4 = buildURL(
44490
44506
  parsed.pathname + parsed.search,
44491
44507
  config2.params,
44492
44508
  config2.paramsSerializer
@@ -44504,7 +44520,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
44504
44520
  false
44505
44521
  );
44506
44522
  const options = {
44507
- path: path3,
44523
+ path: path4,
44508
44524
  method,
44509
44525
  headers: headers.toJSON(),
44510
44526
  agents: { http: config2.httpAgent, https: config2.httpsAgent },
@@ -44605,7 +44621,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
44605
44621
  };
44606
44622
  if (responseType === "stream") {
44607
44623
  response.data = responseStream;
44608
- settle(resolve, reject, response);
44624
+ settle(resolve2, reject, response);
44609
44625
  } else {
44610
44626
  const responseBuffer = [];
44611
44627
  let totalResponseBytes = 0;
@@ -44653,7 +44669,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
44653
44669
  } catch (err) {
44654
44670
  return reject(AxiosError_default.from(err, null, config2, response.request, response));
44655
44671
  }
44656
- settle(resolve, reject, response);
44672
+ settle(resolve2, reject, response);
44657
44673
  });
44658
44674
  }
44659
44675
  abortEmitter.once("abort", (err) => {
@@ -44740,14 +44756,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
44740
44756
  var cookies_default = platform_default.hasStandardBrowserEnv ? (
44741
44757
  // Standard browser envs support document.cookie
44742
44758
  {
44743
- write(name, value, expires, path3, domain2, secure, sameSite) {
44759
+ write(name, value, expires, path4, domain2, secure, sameSite) {
44744
44760
  if (typeof document === "undefined") return;
44745
44761
  const cookie = [`${name}=${encodeURIComponent(value)}`];
44746
44762
  if (utils_default.isNumber(expires)) {
44747
44763
  cookie.push(`expires=${new Date(expires).toUTCString()}`);
44748
44764
  }
44749
- if (utils_default.isString(path3)) {
44750
- cookie.push(`path=${path3}`);
44765
+ if (utils_default.isString(path4)) {
44766
+ cookie.push(`path=${path4}`);
44751
44767
  }
44752
44768
  if (utils_default.isString(domain2)) {
44753
44769
  cookie.push(`domain=${domain2}`);
@@ -44907,7 +44923,7 @@ var resolveConfig_default = (config2) => {
44907
44923
  // ../node_modules/axios/lib/adapters/xhr.js
44908
44924
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
44909
44925
  var xhr_default = isXHRAdapterSupported && function(config2) {
44910
- return new Promise(function dispatchXhrRequest(resolve, reject) {
44926
+ return new Promise(function dispatchXhrRequest(resolve2, reject) {
44911
44927
  const _config = resolveConfig_default(config2);
44912
44928
  let requestData = _config.data;
44913
44929
  const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
@@ -44941,7 +44957,7 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
44941
44957
  request
44942
44958
  };
44943
44959
  settle(function _resolve(value) {
44944
- resolve(value);
44960
+ resolve2(value);
44945
44961
  done();
44946
44962
  }, function _reject(err) {
44947
44963
  reject(err);
@@ -45312,8 +45328,8 @@ var factory = (env) => {
45312
45328
  responseType = responseType || "text";
45313
45329
  let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config2);
45314
45330
  !isStreamResponse && unsubscribe && unsubscribe();
45315
- return await new Promise((resolve, reject) => {
45316
- settle(resolve, reject, {
45331
+ return await new Promise((resolve2, reject) => {
45332
+ settle(resolve2, reject, {
45317
45333
  data: responseData,
45318
45334
  headers: AxiosHeaders_default.from(response.headers),
45319
45335
  status: response.status,
@@ -45716,8 +45732,8 @@ var CancelToken = class _CancelToken {
45716
45732
  throw new TypeError("executor must be a function.");
45717
45733
  }
45718
45734
  let resolvePromise;
45719
- this.promise = new Promise(function promiseExecutor(resolve) {
45720
- resolvePromise = resolve;
45735
+ this.promise = new Promise(function promiseExecutor(resolve2) {
45736
+ resolvePromise = resolve2;
45721
45737
  });
45722
45738
  const token = this;
45723
45739
  this.promise.then((cancel) => {
@@ -45730,9 +45746,9 @@ var CancelToken = class _CancelToken {
45730
45746
  });
45731
45747
  this.promise.then = (onfulfilled) => {
45732
45748
  let _resolve;
45733
- const promise2 = new Promise((resolve) => {
45734
- token.subscribe(resolve);
45735
- _resolve = resolve;
45749
+ const promise2 = new Promise((resolve2) => {
45750
+ token.subscribe(resolve2);
45751
+ _resolve = resolve2;
45736
45752
  }).then(onfulfilled);
45737
45753
  promise2.cancel = function reject() {
45738
45754
  token.unsubscribe(_resolve);
@@ -46106,7 +46122,7 @@ function assertRuntimeConfig() {
46106
46122
 
46107
46123
  // src/utils.ts
46108
46124
  import * as fs2 from "node:fs/promises";
46109
- import * as path2 from "node:path";
46125
+ import * as path3 from "node:path";
46110
46126
  function getErrorMessage(error48) {
46111
46127
  return error48 instanceof Error ? error48.message : String(error48);
46112
46128
  }
@@ -46163,7 +46179,7 @@ function toolResult(text, structuredContent, extraContent = []) {
46163
46179
  }
46164
46180
  async function saveFile(outputDir, filename, data) {
46165
46181
  await fs2.mkdir(outputDir, { recursive: true });
46166
- const filePath = path2.join(outputDir, filename);
46182
+ const filePath = path3.join(outputDir, filename);
46167
46183
  await fs2.writeFile(filePath, data);
46168
46184
  return filePath;
46169
46185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fre4x/grok",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "An MCP server for xAI (Grok) with search and generation capabilities.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",