@fre4x/jules 1.0.43 → 1.0.45

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 +30 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3498,7 +3498,7 @@ var require_schemes = __commonJS({
3498
3498
  serialize: httpSerialize
3499
3499
  }
3500
3500
  );
3501
- var https2 = (
3501
+ var https3 = (
3502
3502
  /** @type {SchemeHandler} */
3503
3503
  {
3504
3504
  scheme: "https",
@@ -3547,7 +3547,7 @@ var require_schemes = __commonJS({
3547
3547
  /** @type {Record<SchemeName, SchemeHandler>} */
3548
3548
  {
3549
3549
  http: http3,
3550
- https: https2,
3550
+ https: https3,
3551
3551
  ws,
3552
3552
  wss,
3553
3553
  urn,
@@ -16763,7 +16763,7 @@ var require_form_data = __commonJS({
16763
16763
  var util4 = __require("util");
16764
16764
  var path = __require("path");
16765
16765
  var http3 = __require("http");
16766
- var https2 = __require("https");
16766
+ var https3 = __require("https");
16767
16767
  var parseUrl = __require("url").parse;
16768
16768
  var fs = __require("fs");
16769
16769
  var Stream = __require("stream").Stream;
@@ -17032,7 +17032,7 @@ var require_form_data = __commonJS({
17032
17032
  }
17033
17033
  options.headers = this.getHeaders(params.headers);
17034
17034
  if (options.protocol === "https:") {
17035
- request = https2.request(options);
17035
+ request = https3.request(options);
17036
17036
  } else {
17037
17037
  request = http3.request(options);
17038
17038
  }
@@ -17945,7 +17945,7 @@ var require_follow_redirects = __commonJS({
17945
17945
  var url3 = __require("url");
17946
17946
  var URL2 = url3.URL;
17947
17947
  var http3 = __require("http");
17948
- var https2 = __require("https");
17948
+ var https3 = __require("https");
17949
17949
  var Writable = __require("stream").Writable;
17950
17950
  var assert2 = __require("assert");
17951
17951
  var debug = require_debug();
@@ -18430,7 +18430,7 @@ var require_follow_redirects = __commonJS({
18430
18430
  function isURL(value) {
18431
18431
  return URL2 && value instanceof URL2;
18432
18432
  }
18433
- module.exports = wrap({ http: http3, https: https2 });
18433
+ module.exports = wrap({ http: http3, https: https3 });
18434
18434
  module.exports.wrap = wrap;
18435
18435
  }
18436
18436
  });
@@ -45842,6 +45842,26 @@ var {
45842
45842
  } = axios_default;
45843
45843
 
45844
45844
  // src/services/julesApiClient.ts
45845
+ import https2 from "node:https";
45846
+ var httpsAgent = new https2.Agent({ keepAlive: true });
45847
+ var _julesClient = null;
45848
+ var _lastApiKey;
45849
+ function getJulesClient(apiKey) {
45850
+ if (!_julesClient || apiKey !== _lastApiKey) {
45851
+ _julesClient = axios_default.create({
45852
+ baseURL: API_BASE_URL,
45853
+ timeout: 3e4,
45854
+ httpsAgent,
45855
+ headers: {
45856
+ "Content-Type": "application/json",
45857
+ Accept: "application/json",
45858
+ "X-Goog-Api-Key": apiKey
45859
+ }
45860
+ });
45861
+ _lastApiKey = apiKey;
45862
+ }
45863
+ return _julesClient;
45864
+ }
45845
45865
  function apiError(message) {
45846
45866
  return { content: [{ type: "text", text: message }], isError: true };
45847
45867
  }
@@ -45850,17 +45870,12 @@ async function julesApiRequest(endpoint, method = "GET", data, params) {
45850
45870
  if (!apiKey) {
45851
45871
  throw new Error("JULES_API_KEY environment variable is missing.");
45852
45872
  }
45853
- const response = await axios_default({
45873
+ const client = getJulesClient(apiKey);
45874
+ const response = await client.request({
45854
45875
  method,
45855
- url: `${API_BASE_URL}${endpoint.startsWith("/") ? endpoint : `/${endpoint}`}`,
45876
+ url: endpoint.startsWith("/") ? endpoint : `/${endpoint}`,
45856
45877
  data,
45857
- params,
45858
- timeout: 3e4,
45859
- headers: {
45860
- "Content-Type": "application/json",
45861
- Accept: "application/json",
45862
- "X-Goog-Api-Key": apiKey
45863
- }
45878
+ params
45864
45879
  });
45865
45880
  return response.data;
45866
45881
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fre4x/jules",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "MCP server for Jules API integration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,7 @@
15
15
  "dev": "tsx src/index.ts",
16
16
  "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && npx esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --format=esm --banner:js=\"import{createRequire}from'module';const require=createRequire(import.meta.url);\"",
17
17
  "typecheck": "cross-env NODE_OPTIONS=--max-old-space-size=4096 tsc --noEmit",
18
- "inspector": "MOCK=true npx @modelcontextprotocol/inspector dist/index.js",
18
+ "inspector": "cross-env MOCK=true npx @modelcontextprotocol/inspector node dist/index.js",
19
19
  "test": "vitest run --exclude dist",
20
20
  "test:watch": "vitest",
21
21
  "clean": "rm -rf dist"