mpd-llm-cli 0.1.25 → 0.1.31

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/bundle/api.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url); globalThis.__filename = require('url').fileURLToPath(import.meta.url); globalThis.__dirname = require('path').dirname(globalThis.__filename);
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url); globalThis.require = require; globalThis.__filename = require('url').fileURLToPath(import.meta.url); globalThis.__dirname = require('path').dirname(globalThis.__filename);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -2887,7 +2887,7 @@ var require_require_directory = __commonJS({
2887
2887
  "node_modules/require-directory/index.js"(exports2, module2) {
2888
2888
  "use strict";
2889
2889
  var fs29 = __require("fs");
2890
- var join14 = __require("path").join;
2890
+ var join15 = __require("path").join;
2891
2891
  var resolve16 = __require("path").resolve;
2892
2892
  var dirname9 = __require("path").dirname;
2893
2893
  var defaultOptions2 = {
@@ -2924,7 +2924,7 @@ var require_require_directory = __commonJS({
2924
2924
  }
2925
2925
  path35 = !path35 ? dirname9(m.filename) : resolve16(dirname9(m.filename), path35);
2926
2926
  fs29.readdirSync(path35).forEach(function(filename) {
2927
- var joined = join14(path35, filename), files, key, obj;
2927
+ var joined = join15(path35, filename), files, key, obj;
2928
2928
  if (fs29.statSync(joined).isDirectory() && options.recurse) {
2929
2929
  files = requireDirectory(m, joined, options);
2930
2930
  if (Object.keys(files).length) {
@@ -19545,10 +19545,10 @@ async function cacheCredentials(credentials) {
19545
19545
  await fs5.writeFile(filePath, credString);
19546
19546
  }
19547
19547
  function getCachedCredentialPath() {
19548
- return path2.join(os2.homedir(), GEMINI_DIR, CREDENTIAL_FILENAME);
19548
+ return path2.join(os2.homedir(), MPDAI_DIR, CREDENTIAL_FILENAME);
19549
19549
  }
19550
19550
  function getGoogleAccountIdCachePath() {
19551
- return path2.join(os2.homedir(), GEMINI_DIR, GOOGLE_ACCOUNT_ID_FILENAME);
19551
+ return path2.join(os2.homedir(), MPDAI_DIR, GOOGLE_ACCOUNT_ID_FILENAME);
19552
19552
  }
19553
19553
  async function cacheGoogleAccountId(googleAccountId) {
19554
19554
  const filePath = getGoogleAccountIdCachePath();
@@ -19603,7 +19603,7 @@ async function getRawGoogleAccountId(client) {
19603
19603
  return null;
19604
19604
  }
19605
19605
  }
19606
- var import_google_auth_library, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_SCOPE, HTTP_REDIRECT, SIGN_IN_SUCCESS_URL, SIGN_IN_FAILURE_URL, GEMINI_DIR, CREDENTIAL_FILENAME, GOOGLE_ACCOUNT_ID_FILENAME;
19606
+ var import_google_auth_library, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET, OAUTH_SCOPE, HTTP_REDIRECT, SIGN_IN_SUCCESS_URL, SIGN_IN_FAILURE_URL, MPDAI_DIR, CREDENTIAL_FILENAME, GOOGLE_ACCOUNT_ID_FILENAME;
19607
19607
  var init_oauth2 = __esm({
19608
19608
  "packages/core/dist/src/code_assist/oauth2.js"() {
19609
19609
  "use strict";
@@ -19621,7 +19621,7 @@ var init_oauth2 = __esm({
19621
19621
  HTTP_REDIRECT = 301;
19622
19622
  SIGN_IN_SUCCESS_URL = "https://developers.google.com/gemini-code-assist/auth_success_gemini";
19623
19623
  SIGN_IN_FAILURE_URL = "https://developers.google.com/gemini-code-assist/auth_failure_gemini";
19624
- GEMINI_DIR = ".gemini";
19624
+ MPDAI_DIR = ".mpdai";
19625
19625
  CREDENTIAL_FILENAME = "oauth_creds.json";
19626
19626
  GOOGLE_ACCOUNT_ID_FILENAME = "google_account_id";
19627
19627
  }
@@ -19955,7 +19955,7 @@ var init_setup = __esm({
19955
19955
  init_server();
19956
19956
  ProjectIdRequiredError = class extends Error {
19957
19957
  constructor() {
19958
- super("This account requires setting the GOOGLE_CLOUD_PROJECT env var. See https://goo.gle/gemini-cli-auth-docs#workspace-gca");
19958
+ super("This account requires setting the GOOGLE_CLOUD_PROJECT env var. See https://git.rakuten-it.com/projects/MPD-AI/repos/mpd-llm-cli/browse/docs/cli/authentication.md");
19959
19959
  }
19960
19960
  };
19961
19961
  }
@@ -27717,7 +27717,7 @@ async function createContentGeneratorConfig(model, authType) {
27717
27717
  return contentGeneratorConfig;
27718
27718
  }
27719
27719
  async function createContentGenerator(config2, sessionId2) {
27720
- const version2 = "0.1.25";
27720
+ const version2 = "0.1.31";
27721
27721
  const httpOptions = {
27722
27722
  headers: {
27723
27723
  "User-Agent": `GeminiCLI/${version2} (${process.platform}; ${process.arch})`
@@ -35861,14 +35861,14 @@ var require_util4 = __commonJS({
35861
35861
  });
35862
35862
  }
35863
35863
  exports2.useFunc = useFunc;
35864
- var Type16;
35865
- (function(Type17) {
35866
- Type17[Type17["Num"] = 0] = "Num";
35867
- Type17[Type17["Str"] = 1] = "Str";
35868
- })(Type16 || (exports2.Type = Type16 = {}));
35864
+ var Type21;
35865
+ (function(Type22) {
35866
+ Type22[Type22["Num"] = 0] = "Num";
35867
+ Type22[Type22["Str"] = 1] = "Str";
35868
+ })(Type21 || (exports2.Type = Type21 = {}));
35869
35869
  function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
35870
35870
  if (dataProp instanceof codegen_1.Name) {
35871
- const isNumber3 = dataPropType === Type16.Num;
35871
+ const isNumber3 = dataPropType === Type21.Num;
35872
35872
  return jsPropertySyntax ? isNumber3 ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber3 ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
35873
35873
  }
35874
35874
  return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
@@ -61740,7 +61740,7 @@ var require_namespace = __commonJS({
61740
61740
  var Field = require_field();
61741
61741
  var util3 = require_util8();
61742
61742
  var OneOf = require_oneof();
61743
- var Type16;
61743
+ var Type21;
61744
61744
  var Service;
61745
61745
  var Enum;
61746
61746
  Namespace.fromJSON = function fromJSON(name2, json) {
@@ -61808,7 +61808,7 @@ var require_namespace = __commonJS({
61808
61808
  nested = nestedJson[names[i]];
61809
61809
  ns.add(
61810
61810
  // most to least likely
61811
- (nested.fields !== void 0 ? Type16.fromJSON : nested.values !== void 0 ? Enum.fromJSON : nested.methods !== void 0 ? Service.fromJSON : nested.id !== void 0 ? Field.fromJSON : Namespace.fromJSON)(names[i], nested)
61811
+ (nested.fields !== void 0 ? Type21.fromJSON : nested.values !== void 0 ? Enum.fromJSON : nested.methods !== void 0 ? Service.fromJSON : nested.id !== void 0 ? Field.fromJSON : Namespace.fromJSON)(names[i], nested)
61812
61812
  );
61813
61813
  }
61814
61814
  }
@@ -61823,14 +61823,14 @@ var require_namespace = __commonJS({
61823
61823
  throw Error("no such enum: " + name2);
61824
61824
  };
61825
61825
  Namespace.prototype.add = function add(object) {
61826
- if (!(object instanceof Field && object.extend !== void 0 || object instanceof Type16 || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))
61826
+ if (!(object instanceof Field && object.extend !== void 0 || object instanceof Type21 || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))
61827
61827
  throw TypeError("object must be a valid nested object");
61828
61828
  if (!this.nested)
61829
61829
  this.nested = {};
61830
61830
  else {
61831
61831
  var prev = this.get(object.name);
61832
61832
  if (prev) {
61833
- if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type16 || prev instanceof Service)) {
61833
+ if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type21 || prev instanceof Service)) {
61834
61834
  var nested = prev.nestedArray;
61835
61835
  for (var i = 0; i < nested.length; ++i)
61836
61836
  object.add(nested[i]);
@@ -61843,7 +61843,7 @@ var require_namespace = __commonJS({
61843
61843
  }
61844
61844
  }
61845
61845
  this.nested[object.name] = object;
61846
- if (!(this instanceof Type16 || this instanceof Service || this instanceof Enum || this instanceof Field)) {
61846
+ if (!(this instanceof Type21 || this instanceof Service || this instanceof Enum || this instanceof Field)) {
61847
61847
  if (!object._edition) {
61848
61848
  object._edition = object._defaultEdition;
61849
61849
  }
@@ -61970,7 +61970,7 @@ var require_namespace = __commonJS({
61970
61970
  return exact;
61971
61971
  };
61972
61972
  Namespace.prototype.lookupType = function lookupType(path35) {
61973
- var found = this.lookup(path35, [Type16]);
61973
+ var found = this.lookup(path35, [Type21]);
61974
61974
  if (!found)
61975
61975
  throw Error("no such type: " + path35);
61976
61976
  return found;
@@ -61982,7 +61982,7 @@ var require_namespace = __commonJS({
61982
61982
  return found;
61983
61983
  };
61984
61984
  Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path35) {
61985
- var found = this.lookup(path35, [Type16, Enum]);
61985
+ var found = this.lookup(path35, [Type21, Enum]);
61986
61986
  if (!found)
61987
61987
  throw Error("no such Type or Enum '" + path35 + "' in " + this);
61988
61988
  return found;
@@ -61994,7 +61994,7 @@ var require_namespace = __commonJS({
61994
61994
  return found;
61995
61995
  };
61996
61996
  Namespace._configure = function(Type_, Service_, Enum_) {
61997
- Type16 = Type_;
61997
+ Type21 = Type_;
61998
61998
  Service = Service_;
61999
61999
  Enum = Enum_;
62000
62000
  };
@@ -62691,9 +62691,9 @@ var require_wrappers = __commonJS({
62691
62691
  var require_type = __commonJS({
62692
62692
  "node_modules/protobufjs/src/type.js"(exports2, module2) {
62693
62693
  "use strict";
62694
- module2.exports = Type16;
62694
+ module2.exports = Type21;
62695
62695
  var Namespace = require_namespace();
62696
- ((Type16.prototype = Object.create(Namespace.prototype)).constructor = Type16).className = "Type";
62696
+ ((Type21.prototype = Object.create(Namespace.prototype)).constructor = Type21).className = "Type";
62697
62697
  var Enum = require_enum3();
62698
62698
  var OneOf = require_oneof();
62699
62699
  var Field = require_field();
@@ -62708,7 +62708,7 @@ var require_type = __commonJS({
62708
62708
  var verifier = require_verifier();
62709
62709
  var converter = require_converter();
62710
62710
  var wrappers = require_wrappers();
62711
- function Type16(name2, options) {
62711
+ function Type21(name2, options) {
62712
62712
  Namespace.call(this, name2, options);
62713
62713
  this.fields = {};
62714
62714
  this.oneofs = void 0;
@@ -62720,7 +62720,7 @@ var require_type = __commonJS({
62720
62720
  this._oneofsArray = null;
62721
62721
  this._ctor = null;
62722
62722
  }
62723
- Object.defineProperties(Type16.prototype, {
62723
+ Object.defineProperties(Type21.prototype, {
62724
62724
  /**
62725
62725
  * Message fields by id.
62726
62726
  * @name Type#fieldsById
@@ -62771,7 +62771,7 @@ var require_type = __commonJS({
62771
62771
  */
62772
62772
  ctor: {
62773
62773
  get: function() {
62774
- return this._ctor || (this.ctor = Type16.generateConstructor(this)());
62774
+ return this._ctor || (this.ctor = Type21.generateConstructor(this)());
62775
62775
  },
62776
62776
  set: function(ctor) {
62777
62777
  var prototype = ctor.prototype;
@@ -62798,7 +62798,7 @@ var require_type = __commonJS({
62798
62798
  }
62799
62799
  }
62800
62800
  });
62801
- Type16.generateConstructor = function generateConstructor(mtype) {
62801
+ Type21.generateConstructor = function generateConstructor(mtype) {
62802
62802
  var gen = util3.codegen(["p"], mtype.name);
62803
62803
  for (var i = 0, field; i < mtype.fieldsArray.length; ++i)
62804
62804
  if ((field = mtype._fieldsArray[i]).map) gen("this%s={}", util3.safeProp(field.name));
@@ -62812,8 +62812,8 @@ var require_type = __commonJS({
62812
62812
  delete type.verify;
62813
62813
  return type;
62814
62814
  }
62815
- Type16.fromJSON = function fromJSON(name2, json) {
62816
- var type = new Type16(name2, json.options);
62815
+ Type21.fromJSON = function fromJSON(name2, json) {
62816
+ var type = new Type21(name2, json.options);
62817
62817
  type.extensions = json.extensions;
62818
62818
  type.reserved = json.reserved;
62819
62819
  var names = Object.keys(json.fields), i = 0;
@@ -62829,7 +62829,7 @@ var require_type = __commonJS({
62829
62829
  var nested = json.nested[names[i]];
62830
62830
  type.add(
62831
62831
  // most to least likely
62832
- (nested.id !== void 0 ? Field.fromJSON : nested.fields !== void 0 ? Type16.fromJSON : nested.values !== void 0 ? Enum.fromJSON : nested.methods !== void 0 ? Service.fromJSON : Namespace.fromJSON)(names[i], nested)
62832
+ (nested.id !== void 0 ? Field.fromJSON : nested.fields !== void 0 ? Type21.fromJSON : nested.values !== void 0 ? Enum.fromJSON : nested.methods !== void 0 ? Service.fromJSON : Namespace.fromJSON)(names[i], nested)
62833
62833
  );
62834
62834
  }
62835
62835
  if (json.extensions && json.extensions.length)
@@ -62845,7 +62845,7 @@ var require_type = __commonJS({
62845
62845
  type._defaultEdition = "proto3";
62846
62846
  return type;
62847
62847
  };
62848
- Type16.prototype.toJSON = function toJSON(toJSONOptions) {
62848
+ Type21.prototype.toJSON = function toJSON(toJSONOptions) {
62849
62849
  var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
62850
62850
  var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
62851
62851
  return util3.toObject([
@@ -62871,7 +62871,7 @@ var require_type = __commonJS({
62871
62871
  keepComments ? this.comment : void 0
62872
62872
  ]);
62873
62873
  };
62874
- Type16.prototype.resolveAll = function resolveAll() {
62874
+ Type21.prototype.resolveAll = function resolveAll() {
62875
62875
  if (!this._needsRecursiveResolve) return this;
62876
62876
  Namespace.prototype.resolveAll.call(this);
62877
62877
  var oneofs = this.oneofsArray;
@@ -62883,7 +62883,7 @@ var require_type = __commonJS({
62883
62883
  fields[i++].resolve();
62884
62884
  return this;
62885
62885
  };
62886
- Type16.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
62886
+ Type21.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
62887
62887
  if (!this._needsRecursiveFeatureResolution) return this;
62888
62888
  edition = this._edition || edition;
62889
62889
  Namespace.prototype._resolveFeaturesRecursive.call(this, edition);
@@ -62895,10 +62895,10 @@ var require_type = __commonJS({
62895
62895
  });
62896
62896
  return this;
62897
62897
  };
62898
- Type16.prototype.get = function get2(name2) {
62898
+ Type21.prototype.get = function get2(name2) {
62899
62899
  return this.fields[name2] || this.oneofs && this.oneofs[name2] || this.nested && this.nested[name2] || null;
62900
62900
  };
62901
- Type16.prototype.add = function add(object) {
62901
+ Type21.prototype.add = function add(object) {
62902
62902
  if (this.get(object.name))
62903
62903
  throw Error("duplicate name '" + object.name + "' in " + this);
62904
62904
  if (object instanceof Field && object.extend === void 0) {
@@ -62927,7 +62927,7 @@ var require_type = __commonJS({
62927
62927
  }
62928
62928
  return Namespace.prototype.add.call(this, object);
62929
62929
  };
62930
- Type16.prototype.remove = function remove2(object) {
62930
+ Type21.prototype.remove = function remove2(object) {
62931
62931
  if (object instanceof Field && object.extend === void 0) {
62932
62932
  if (!this.fields || this.fields[object.name] !== object)
62933
62933
  throw Error(object + " is not a member of " + this);
@@ -62946,16 +62946,16 @@ var require_type = __commonJS({
62946
62946
  }
62947
62947
  return Namespace.prototype.remove.call(this, object);
62948
62948
  };
62949
- Type16.prototype.isReservedId = function isReservedId(id) {
62949
+ Type21.prototype.isReservedId = function isReservedId(id) {
62950
62950
  return Namespace.isReservedId(this.reserved, id);
62951
62951
  };
62952
- Type16.prototype.isReservedName = function isReservedName(name2) {
62952
+ Type21.prototype.isReservedName = function isReservedName(name2) {
62953
62953
  return Namespace.isReservedName(this.reserved, name2);
62954
62954
  };
62955
- Type16.prototype.create = function create(properties) {
62955
+ Type21.prototype.create = function create(properties) {
62956
62956
  return new this.ctor(properties);
62957
62957
  };
62958
- Type16.prototype.setup = function setup() {
62958
+ Type21.prototype.setup = function setup() {
62959
62959
  var fullName = this.fullName, types2 = [];
62960
62960
  for (var i = 0; i < /* initializes */
62961
62961
  this.fieldsArray.length; ++i)
@@ -62992,30 +62992,30 @@ var require_type = __commonJS({
62992
62992
  }
62993
62993
  return this;
62994
62994
  };
62995
- Type16.prototype.encode = function encode_setup(message, writer) {
62995
+ Type21.prototype.encode = function encode_setup(message, writer) {
62996
62996
  return this.setup().encode(message, writer);
62997
62997
  };
62998
- Type16.prototype.encodeDelimited = function encodeDelimited(message, writer) {
62998
+ Type21.prototype.encodeDelimited = function encodeDelimited(message, writer) {
62999
62999
  return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
63000
63000
  };
63001
- Type16.prototype.decode = function decode_setup(reader, length) {
63001
+ Type21.prototype.decode = function decode_setup(reader, length) {
63002
63002
  return this.setup().decode(reader, length);
63003
63003
  };
63004
- Type16.prototype.decodeDelimited = function decodeDelimited(reader) {
63004
+ Type21.prototype.decodeDelimited = function decodeDelimited(reader) {
63005
63005
  if (!(reader instanceof Reader))
63006
63006
  reader = Reader.create(reader);
63007
63007
  return this.decode(reader, reader.uint32());
63008
63008
  };
63009
- Type16.prototype.verify = function verify_setup(message) {
63009
+ Type21.prototype.verify = function verify_setup(message) {
63010
63010
  return this.setup().verify(message);
63011
63011
  };
63012
- Type16.prototype.fromObject = function fromObject(object) {
63012
+ Type21.prototype.fromObject = function fromObject(object) {
63013
63013
  return this.setup().fromObject(object);
63014
63014
  };
63015
- Type16.prototype.toObject = function toObject(message, options) {
63015
+ Type21.prototype.toObject = function toObject(message, options) {
63016
63016
  return this.setup().toObject(message, options);
63017
63017
  };
63018
- Type16.d = function decorateType(typeName) {
63018
+ Type21.d = function decorateType(typeName) {
63019
63019
  return function typeDecorator(target) {
63020
63020
  util3.decorateType(target, typeName);
63021
63021
  };
@@ -63034,7 +63034,7 @@ var require_root = __commonJS({
63034
63034
  var Enum = require_enum3();
63035
63035
  var OneOf = require_oneof();
63036
63036
  var util3 = require_util8();
63037
- var Type16;
63037
+ var Type21;
63038
63038
  var parse5;
63039
63039
  var common;
63040
63040
  function Root2(options) {
@@ -63218,7 +63218,7 @@ var require_root = __commonJS({
63218
63218
  if (exposeRe.test(object.name))
63219
63219
  object.parent[object.name] = object.values;
63220
63220
  } else if (!(object instanceof OneOf)) {
63221
- if (object instanceof Type16)
63221
+ if (object instanceof Type21)
63222
63222
  for (var i = 0; i < this.deferred.length; )
63223
63223
  if (tryHandleExtension(this, this.deferred[i]))
63224
63224
  this.deferred.splice(i, 1);
@@ -63230,7 +63230,7 @@ var require_root = __commonJS({
63230
63230
  if (exposeRe.test(object.name))
63231
63231
  object.parent[object.name] = object;
63232
63232
  }
63233
- if (object instanceof Type16 || object instanceof Enum || object instanceof Field) {
63233
+ if (object instanceof Type21 || object instanceof Enum || object instanceof Field) {
63234
63234
  this._fullyQualifiedObjects[object.fullName] = object;
63235
63235
  }
63236
63236
  };
@@ -63265,7 +63265,7 @@ var require_root = __commonJS({
63265
63265
  delete this._fullyQualifiedObjects[object.fullName];
63266
63266
  };
63267
63267
  Root2._configure = function(Type_, parse_2, common_) {
63268
- Type16 = Type_;
63268
+ Type21 = Type_;
63269
63269
  parse5 = parse_2;
63270
63270
  common = common_;
63271
63271
  };
@@ -63278,7 +63278,7 @@ var require_util8 = __commonJS({
63278
63278
  "use strict";
63279
63279
  var util3 = module2.exports = require_minimal();
63280
63280
  var roots = require_roots();
63281
- var Type16;
63281
+ var Type21;
63282
63282
  var Enum;
63283
63283
  util3.codegen = require_codegen2();
63284
63284
  util3.fetch = require_fetch();
@@ -63333,9 +63333,9 @@ var require_util8 = __commonJS({
63333
63333
  }
63334
63334
  return ctor.$type;
63335
63335
  }
63336
- if (!Type16)
63337
- Type16 = require_type();
63338
- var type = new Type16(typeName || ctor.name);
63336
+ if (!Type21)
63337
+ Type21 = require_type();
63338
+ var type = new Type21(typeName || ctor.name);
63339
63339
  util3.decorateRoot.add(type);
63340
63340
  type.ctor = ctor;
63341
63341
  Object.defineProperty(ctor, "$type", { value: type, enumerable: false });
@@ -63575,7 +63575,7 @@ var require_field = __commonJS({
63575
63575
  var Enum = require_enum3();
63576
63576
  var types2 = require_types5();
63577
63577
  var util3 = require_util8();
63578
- var Type16;
63578
+ var Type21;
63579
63579
  var ruleRe = /^required|optional|repeated$/;
63580
63580
  Field.fromJSON = function fromJSON(name2, json) {
63581
63581
  var field = new Field(name2, json.id, json.type, json.rule, json.extend, json.options, json.comment);
@@ -63638,7 +63638,7 @@ var require_field = __commonJS({
63638
63638
  });
63639
63639
  Object.defineProperty(Field.prototype, "delimited", {
63640
63640
  get: function() {
63641
- return this.resolvedType instanceof Type16 && this._features.message_encoding === "DELIMITED";
63641
+ return this.resolvedType instanceof Type21 && this._features.message_encoding === "DELIMITED";
63642
63642
  }
63643
63643
  });
63644
63644
  Object.defineProperty(Field.prototype, "packed", {
@@ -63683,7 +63683,7 @@ var require_field = __commonJS({
63683
63683
  return this;
63684
63684
  if ((this.typeDefault = types2.defaults[this.type]) === void 0) {
63685
63685
  this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);
63686
- if (this.resolvedType instanceof Type16)
63686
+ if (this.resolvedType instanceof Type21)
63687
63687
  this.typeDefault = null;
63688
63688
  else
63689
63689
  this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]];
@@ -63719,7 +63719,7 @@ var require_field = __commonJS({
63719
63719
  this.defaultValue = util3.emptyArray;
63720
63720
  else
63721
63721
  this.defaultValue = this.typeDefault;
63722
- if (this.parent instanceof Type16)
63722
+ if (this.parent instanceof Type21)
63723
63723
  this.parent.ctor.prototype[this.name] = this.defaultValue;
63724
63724
  return ReflectionObject.prototype.resolve.call(this);
63725
63725
  };
@@ -63733,7 +63733,7 @@ var require_field = __commonJS({
63733
63733
  }
63734
63734
  if (this.parent && types2.defaults[this.type] === void 0) {
63735
63735
  var type = this.parent.get(this.type.split(".").pop());
63736
- if (type && type instanceof Type16 && type.group) {
63736
+ if (type && type instanceof Type21 && type.group) {
63737
63737
  features.message_encoding = "DELIMITED";
63738
63738
  }
63739
63739
  }
@@ -63757,7 +63757,7 @@ var require_field = __commonJS({
63757
63757
  };
63758
63758
  };
63759
63759
  Field._configure = function configure(Type_) {
63760
- Type16 = Type_;
63760
+ Type21 = Type_;
63761
63761
  };
63762
63762
  }
63763
63763
  });
@@ -64529,7 +64529,7 @@ var require_parse4 = __commonJS({
64529
64529
  parse5.defaults = { keepCase: false };
64530
64530
  var tokenize2 = require_tokenize();
64531
64531
  var Root2 = require_root();
64532
- var Type16 = require_type();
64532
+ var Type21 = require_type();
64533
64533
  var Field = require_field();
64534
64534
  var MapField = require_mapfield();
64535
64535
  var OneOf = require_oneof();
@@ -64792,7 +64792,7 @@ var require_parse4 = __commonJS({
64792
64792
  function parseType(parent, token3) {
64793
64793
  if (!nameRe.test(token3 = next()))
64794
64794
  throw illegal(token3, "type name");
64795
- var type = new Type16(token3);
64795
+ var type = new Type21(token3);
64796
64796
  ifBlock(type, function parseType_block(token4) {
64797
64797
  if (parseCommon(type, token4))
64798
64798
  return;
@@ -64889,7 +64889,7 @@ var require_parse4 = __commonJS({
64889
64889
  name2 = util3.ucFirst(name2);
64890
64890
  skip("=");
64891
64891
  var id = parseId(next());
64892
- var type = new Type16(name2);
64892
+ var type = new Type21(name2);
64893
64893
  type.group = true;
64894
64894
  var field = new Field(fieldName, id, name2, rule);
64895
64895
  field.filename = parse5.filename;
@@ -66989,7 +66989,7 @@ var require_descriptor2 = __commonJS({
66989
66989
  var Namespace = $protobuf.Namespace;
66990
66990
  var Root2 = $protobuf.Root;
66991
66991
  var Enum = $protobuf.Enum;
66992
- var Type16 = $protobuf.Type;
66992
+ var Type21 = $protobuf.Type;
66993
66993
  var Field = $protobuf.Field;
66994
66994
  var MapField = $protobuf.MapField;
66995
66995
  var OneOf = $protobuf.OneOf;
@@ -67010,7 +67010,7 @@ var require_descriptor2 = __commonJS({
67010
67010
  root.files.push(filePackage.filename = fileDescriptor.name);
67011
67011
  if (fileDescriptor.messageType)
67012
67012
  for (i = 0; i < fileDescriptor.messageType.length; ++i)
67013
- filePackage.add(Type16.fromDescriptor(fileDescriptor.messageType[i], edition));
67013
+ filePackage.add(Type21.fromDescriptor(fileDescriptor.messageType[i], edition));
67014
67014
  if (fileDescriptor.enumType)
67015
67015
  for (i = 0; i < fileDescriptor.enumType.length; ++i)
67016
67016
  filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i], edition));
@@ -67041,7 +67041,7 @@ var require_descriptor2 = __commonJS({
67041
67041
  if (!(ns instanceof Root2))
67042
67042
  file["package"] = ns.fullName.substring(1);
67043
67043
  for (var i = 0, nested; i < ns.nestedArray.length; ++i)
67044
- if ((nested = ns._nestedArray[i]) instanceof Type16)
67044
+ if ((nested = ns._nestedArray[i]) instanceof Type21)
67045
67045
  file.messageType.push(nested.toDescriptor(edition));
67046
67046
  else if (nested instanceof Enum)
67047
67047
  file.enumType.push(nested.toDescriptor());
@@ -67057,10 +67057,10 @@ var require_descriptor2 = __commonJS({
67057
67057
  files.push(file);
67058
67058
  }
67059
67059
  var unnamedMessageIndex = 0;
67060
- Type16.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {
67060
+ Type21.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {
67061
67061
  if (typeof descriptor.length === "number")
67062
67062
  descriptor = exports2.DescriptorProto.decode(descriptor);
67063
- var type = new Type16(descriptor.name.length ? descriptor.name : "Type" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports2.MessageOptions)), i;
67063
+ var type = new Type21(descriptor.name.length ? descriptor.name : "Type" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports2.MessageOptions)), i;
67064
67064
  if (!nested)
67065
67065
  type._edition = edition;
67066
67066
  if (descriptor.oneofDecl)
@@ -67078,7 +67078,7 @@ var require_descriptor2 = __commonJS({
67078
67078
  type.add(Field.fromDescriptor(descriptor.extension[i], edition, true));
67079
67079
  if (descriptor.nestedType)
67080
67080
  for (i = 0; i < descriptor.nestedType.length; ++i) {
67081
- type.add(Type16.fromDescriptor(descriptor.nestedType[i], edition, true));
67081
+ type.add(Type21.fromDescriptor(descriptor.nestedType[i], edition, true));
67082
67082
  if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry)
67083
67083
  type.setOption("map_entry", true);
67084
67084
  }
@@ -67101,7 +67101,7 @@ var require_descriptor2 = __commonJS({
67101
67101
  }
67102
67102
  return type;
67103
67103
  };
67104
- Type16.prototype.toDescriptor = function toDescriptor(edition) {
67104
+ Type21.prototype.toDescriptor = function toDescriptor(edition) {
67105
67105
  var descriptor = exports2.DescriptorProto.create({ name: this.name }), i;
67106
67106
  for (i = 0; i < this.fieldsArray.length; ++i) {
67107
67107
  var fieldDescriptor;
@@ -67126,7 +67126,7 @@ var require_descriptor2 = __commonJS({
67126
67126
  for (i = 0; i < this.nestedArray.length; ++i) {
67127
67127
  if (this._nestedArray[i] instanceof Field)
67128
67128
  descriptor.field.push(this._nestedArray[i].toDescriptor(edition));
67129
- else if (this._nestedArray[i] instanceof Type16)
67129
+ else if (this._nestedArray[i] instanceof Type21)
67130
67130
  descriptor.nestedType.push(this._nestedArray[i].toDescriptor(edition));
67131
67131
  else if (this._nestedArray[i] instanceof Enum)
67132
67132
  descriptor.enumType.push(this._nestedArray[i].toDescriptor());
@@ -67453,7 +67453,7 @@ var require_descriptor2 = __commonJS({
67453
67453
  }
67454
67454
  if (resolvedType instanceof Enum)
67455
67455
  return 14;
67456
- if (resolvedType instanceof Type16)
67456
+ if (resolvedType instanceof Type21)
67457
67457
  return delimited ? 10 : 11;
67458
67458
  throw Error("illegal type: " + type);
67459
67459
  }
@@ -67463,7 +67463,7 @@ var require_descriptor2 = __commonJS({
67463
67463
  if ((key = (field = type._fieldsArray[i]).name) === "uninterpretedOption") continue;
67464
67464
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
67465
67465
  var newKey = underScore(key);
67466
- if (field.resolvedType instanceof Type16) {
67466
+ if (field.resolvedType instanceof Type21) {
67467
67467
  val[newKey] = fromDescriptorOptionsRecursive(obj[key], field.resolvedType);
67468
67468
  } else if (field.resolvedType instanceof Enum) {
67469
67469
  val[newKey] = field.resolvedType.valuesById[obj[key]];
@@ -67486,7 +67486,7 @@ var require_descriptor2 = __commonJS({
67486
67486
  var newKey = $protobuf.util.camelCase(key);
67487
67487
  if (!Object.prototype.hasOwnProperty.call(type.fields, newKey)) continue;
67488
67488
  var field = type.fields[newKey];
67489
- if (field.resolvedType instanceof Type16) {
67489
+ if (field.resolvedType instanceof Type21) {
67490
67490
  val[newKey] = toDescriptorOptionsRecursive(obj[key], field.resolvedType);
67491
67491
  } else {
67492
67492
  val[newKey] = obj[key];
@@ -98776,7 +98776,7 @@ var require_homedir = __commonJS({
98776
98776
  "node_modules/resolve/lib/homedir.js"(exports2, module2) {
98777
98777
  "use strict";
98778
98778
  var os11 = __require("os");
98779
- module2.exports = os11.homedir || function homedir8() {
98779
+ module2.exports = os11.homedir || function homedir9() {
98780
98780
  var home = process.env.HOME;
98781
98781
  var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
98782
98782
  if (process.platform === "win32") {
@@ -99257,11 +99257,11 @@ var require_async2 = __commonJS({
99257
99257
  var normalizeOptions = require_normalize_options();
99258
99258
  var isCore = require_is_core_module();
99259
99259
  var realpathFS = process.platform !== "win32" && fs29.realpath && typeof fs29.realpath.native === "function" ? fs29.realpath.native : fs29.realpath;
99260
- var homedir8 = getHomedir();
99260
+ var homedir9 = getHomedir();
99261
99261
  var defaultPaths = function() {
99262
99262
  return [
99263
- path35.join(homedir8, ".node_modules"),
99264
- path35.join(homedir8, ".node_libraries")
99263
+ path35.join(homedir9, ".node_modules"),
99264
+ path35.join(homedir9, ".node_libraries")
99265
99265
  ];
99266
99266
  };
99267
99267
  var defaultIsFile = function isFile(file, cb) {
@@ -99747,11 +99747,11 @@ var require_sync2 = __commonJS({
99747
99747
  var nodeModulesPaths = require_node_modules_paths();
99748
99748
  var normalizeOptions = require_normalize_options();
99749
99749
  var realpathFS = process.platform !== "win32" && fs29.realpathSync && typeof fs29.realpathSync.native === "function" ? fs29.realpathSync.native : fs29.realpathSync;
99750
- var homedir8 = getHomedir();
99750
+ var homedir9 = getHomedir();
99751
99751
  var defaultPaths = function() {
99752
99752
  return [
99753
- path35.join(homedir8, ".node_modules"),
99754
- path35.join(homedir8, ".node_libraries")
99753
+ path35.join(homedir9, ".node_modules"),
99754
+ path35.join(homedir9, ".node_libraries")
99755
99755
  ];
99756
99756
  };
99757
99757
  var defaultIsFile = function isFile(file) {
@@ -99788,8 +99788,8 @@ var require_sync2 = __commonJS({
99788
99788
  }
99789
99789
  return x;
99790
99790
  };
99791
- var defaultReadPackageSync = function defaultReadPackageSync2(readFileSync10, pkgfile) {
99792
- var body = readFileSync10(pkgfile);
99791
+ var defaultReadPackageSync = function defaultReadPackageSync2(readFileSync11, pkgfile) {
99792
+ var body = readFileSync11(pkgfile);
99793
99793
  try {
99794
99794
  var pkg2 = JSON.parse(body);
99795
99795
  return pkg2;
@@ -99809,7 +99809,7 @@ var require_sync2 = __commonJS({
99809
99809
  }
99810
99810
  var opts = normalizeOptions(x, options);
99811
99811
  var isFile = opts.isFile || defaultIsFile;
99812
- var readFileSync10 = opts.readFileSync || fs29.readFileSync;
99812
+ var readFileSync11 = opts.readFileSync || fs29.readFileSync;
99813
99813
  var isDirectory = opts.isDirectory || defaultIsDir;
99814
99814
  var realpathSync2 = opts.realpathSync || defaultRealpathSync;
99815
99815
  var readPackageSync2 = opts.readPackageSync || defaultReadPackageSync;
@@ -99866,7 +99866,7 @@ var require_sync2 = __commonJS({
99866
99866
  if (!isFile(pkgfile)) {
99867
99867
  return loadpkg(path35.dirname(dir));
99868
99868
  }
99869
- var pkg2 = readPackageSync2(readFileSync10, pkgfile);
99869
+ var pkg2 = readPackageSync2(readFileSync11, pkgfile);
99870
99870
  if (pkg2 && opts.packageFilter) {
99871
99871
  pkg2 = opts.packageFilter(
99872
99872
  pkg2,
@@ -99880,7 +99880,7 @@ var require_sync2 = __commonJS({
99880
99880
  var pkgfile = path35.join(maybeRealpathSync(realpathSync2, x2, opts), "/package.json");
99881
99881
  if (isFile(pkgfile)) {
99882
99882
  try {
99883
- var pkg2 = readPackageSync2(readFileSync10, pkgfile);
99883
+ var pkg2 = readPackageSync2(readFileSync11, pkgfile);
99884
99884
  } catch (e2) {
99885
99885
  }
99886
99886
  if (pkg2 && opts.packageFilter) {
@@ -132758,6 +132758,9 @@ import process12 from "node:process";
132758
132758
  init_contentGenerator();
132759
132759
  import * as path27 from "node:path";
132760
132760
  import process10 from "node:process";
132761
+ import { existsSync as existsSync5, readFileSync as readFileSync8 } from "node:fs";
132762
+ import { join as join11 } from "node:path";
132763
+ import { homedir as homedir6 } from "node:os";
132761
132764
 
132762
132765
  // packages/core/dist/src/tools/tool-registry.js
132763
132766
  import { Type as Type2 } from "@google/genai";
@@ -140492,6 +140495,12 @@ function _sanitizeParameters(schema, visited) {
140492
140495
  return;
140493
140496
  }
140494
140497
  visited.add(schema);
140498
+ if ("$schema" in schema) {
140499
+ delete schema.$schema;
140500
+ }
140501
+ if ("additionalProperties" in schema) {
140502
+ delete schema.additionalProperties;
140503
+ }
140495
140504
  if (schema.anyOf) {
140496
140505
  schema.default = void 0;
140497
140506
  for (const item of schema.anyOf) {
@@ -140581,7 +140590,7 @@ var SchemaValidator = class {
140581
140590
  import path4 from "node:path";
140582
140591
  import os3 from "os";
140583
140592
  import * as crypto8 from "crypto";
140584
- var GEMINI_DIR2 = ".gemini";
140593
+ var MPDAI_DIR2 = ".mpdai";
140585
140594
  var TMP_DIR_NAME = "tmp";
140586
140595
  function shortenPath(filePath, maxLen = 35) {
140587
140596
  if (filePath.length <= maxLen) {
@@ -140637,7 +140646,7 @@ function getProjectHash(projectRoot) {
140637
140646
  }
140638
140647
  function getProjectTempDir(projectRoot) {
140639
140648
  const hash = getProjectHash(projectRoot);
140640
- return path4.join(os3.homedir(), GEMINI_DIR2, TMP_DIR_NAME, hash);
140649
+ return path4.join(os3.homedir(), MPDAI_DIR2, TMP_DIR_NAME, hash);
140641
140650
  }
140642
140651
 
140643
140652
  // packages/core/dist/src/tools/ls.js
@@ -141248,7 +141257,7 @@ var ReadFileTool = class _ReadFileTool extends BaseTool {
141248
141257
  const fileService = this.config.getFileService();
141249
141258
  if (fileService.shouldGeminiIgnoreFile(params.absolute_path)) {
141250
141259
  const relativePath = makeRelative(params.absolute_path, this.rootDirectory);
141251
- return `File path '${shortenPath(relativePath)}' is ignored by .geminiignore pattern(s).`;
141260
+ return `File path '${shortenPath(relativePath)}' is ignored by .mpdaiignore pattern(s).`;
141252
141261
  }
141253
141262
  return null;
141254
141263
  }
@@ -149350,7 +149359,7 @@ Do NOT use this tool:
149350
149359
 
149351
149360
  - \`fact\` (string, required): The specific fact or piece of information to remember. This should be a clear, self-contained statement. For example, if the user says "My favorite color is blue", the fact would be "My favorite color is blue".
149352
149361
  `;
149353
- var GEMINI_CONFIG_DIR = ".gemini";
149362
+ var MPDAI_CONFIG_DIR = ".mpdai";
149354
149363
  var DEFAULT_CONTEXT_FILENAME = "MEMORY.md";
149355
149364
  var MEMORY_SECTION_HEADER = "## Memory Added Memories";
149356
149365
  var currentGeminiMdFilename = DEFAULT_CONTEXT_FILENAME;
@@ -149376,7 +149385,7 @@ function getAllGeminiMdFilenames() {
149376
149385
  return [currentGeminiMdFilename];
149377
149386
  }
149378
149387
  function getGlobalMemoryFilePath() {
149379
- return path13.join(homedir2(), GEMINI_CONFIG_DIR, getCurrentGeminiMdFilename());
149388
+ return path13.join(homedir2(), MPDAI_CONFIG_DIR, getCurrentGeminiMdFilename());
149380
149389
  }
149381
149390
  function ensureNewlineSeparation(currentContent) {
149382
149391
  if (currentContent.length === 0)
@@ -149596,7 +149605,7 @@ Use this tool when the user's query implies needing the content of several files
149596
149605
  if (this.geminiIgnorePatterns.length > 0) {
149597
149606
  const geminiPatternsInEffect = this.geminiIgnorePatterns.filter((p) => finalExclusionPatternsForDescription.includes(p)).length;
149598
149607
  if (geminiPatternsInEffect > 0) {
149599
- excludeDesc += ` (includes ${geminiPatternsInEffect} from .geminiignore)`;
149608
+ excludeDesc += ` (includes ${geminiPatternsInEffect} from .mpdaiignore)`;
149600
149609
  }
149601
149610
  }
149602
149611
  return `Will attempt to read and concatenate files ${pathDesc}. ${excludeDesc}. File encoding: ${DEFAULT_ENCODING}. Separator: "${DEFAULT_OUTPUT_SEPARATOR_FORMAT.replace("{filePath}", "path/to/file.ext")}".`;
@@ -151711,8 +151720,8 @@ function many(p) {
151711
151720
  function many1(p) {
151712
151721
  return ab(p, many(p), (head, tail) => [head, ...tail]);
151713
151722
  }
151714
- function ab(pa, pb, join14) {
151715
- return (data, i) => mapOuter(pa(data, i), (ma) => mapInner(pb(data, ma.position), (vb, j) => join14(ma.value, vb, data, i, j)));
151723
+ function ab(pa, pb, join15) {
151724
+ return (data, i) => mapOuter(pa(data, i), (ma) => mapInner(pb(data, ma.position), (vb, j) => join15(ma.value, vb, data, i, j)));
151716
151725
  }
151717
151726
  function left2(pa, pb) {
151718
151727
  return ab(pa, pb, (va) => va);
@@ -151720,8 +151729,8 @@ function left2(pa, pb) {
151720
151729
  function right2(pa, pb) {
151721
151730
  return ab(pa, pb, (va, vb) => vb);
151722
151731
  }
151723
- function abc(pa, pb, pc, join14) {
151724
- return (data, i) => mapOuter(pa(data, i), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j) => join14(ma.value, mb.value, vc, data, i, j))));
151732
+ function abc(pa, pb, pc, join15) {
151733
+ return (data, i) => mapOuter(pa(data, i), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j) => join15(ma.value, mb.value, vc, data, i, j))));
151725
151734
  }
151726
151735
  function middle(pa, pb, pc) {
151727
151736
  return abc(pa, pb, pc, (ra, rb) => rb);
@@ -156384,6 +156393,951 @@ ${modifiedResponseText}`,
156384
156393
  }
156385
156394
  };
156386
156395
 
156396
+ // packages/core/dist/src/tools/confluence-get-page.js
156397
+ init_errors();
156398
+ import { Type as Type15 } from "@google/genai";
156399
+ var CONFLUENCE_FETCH_TIMEOUT_MS = 3e4;
156400
+ var CONFLUENCE_URL = "https://confluence.rakuten-it.com/confluence";
156401
+ var ConfluenceGetPageTool = class _ConfluenceGetPageTool extends BaseTool {
156402
+ config;
156403
+ static Name = "confluence_get_page";
156404
+ constructor(config2) {
156405
+ super(_ConfluenceGetPageTool.Name, "ConfluenceGetPage", "Retrieves content from a Confluence page by its ID. Uses Personal Access Token from keys.json for authentication and can convert HTML content to markdown.", {
156406
+ properties: {
156407
+ page_id: {
156408
+ description: "The ID of the Confluence page to retrieve",
156409
+ type: Type15.STRING
156410
+ },
156411
+ convert_to_markdown: {
156412
+ description: "Whether to convert HTML content to markdown format (default: true)",
156413
+ type: Type15.STRING
156414
+ }
156415
+ },
156416
+ required: ["page_id"],
156417
+ type: Type15.OBJECT
156418
+ });
156419
+ this.config = config2;
156420
+ }
156421
+ validateParams(params) {
156422
+ const errors = SchemaValidator.validate(this.schema.parameters, params);
156423
+ if (errors) {
156424
+ return errors;
156425
+ }
156426
+ if (!params.page_id || params.page_id.trim() === "") {
156427
+ return "The 'page_id' parameter cannot be empty.";
156428
+ }
156429
+ return null;
156430
+ }
156431
+ getDescription(params) {
156432
+ return `Retrieving Confluence page ${params.page_id} from ${CONFLUENCE_URL}`;
156433
+ }
156434
+ /**
156435
+ * Process HTML content to handle user mentions and page links
156436
+ */
156437
+ processHtmlContent(html, spaceKey, baseUrl) {
156438
+ let processed = html;
156439
+ processed = processed.replace(/<ac:link>[\s\S]*?<ri:user[^>]+ri:username="([^"]+)"\s*\/>[\s\S]*?<\/ac:link>/g, "@$1");
156440
+ processed = processed.replace(/<ac:link[^>]*>[\s\S]*?<ri:page[^>]+ri:content-title="([^"]*)"\s*ri:space-key="([^"]*)"\s*\/>[\s\S]*?<\/ac:link>/g, (match2, title) => {
156441
+ return title || "Page Link";
156442
+ });
156443
+ processed = processed.replace(/<\/?(span|div|p)[^>]*>/g, "\n");
156444
+ processed = processed.replace(/<strong>([^<]*)<\/strong>/g, "**$1**");
156445
+ processed = processed.replace(/<b>([^<]*)<\/b>/g, "**$1**");
156446
+ processed = processed.replace(/<em>([^<]*)<\/em>/g, "*$1*");
156447
+ processed = processed.replace(/<i>([^<]*)<\/i>/g, "*$1*");
156448
+ for (let i = 1; i <= 6; i++) {
156449
+ const tag = `h${i}`;
156450
+ const prefix = "#".repeat(i);
156451
+ processed = processed.replace(new RegExp(`<${tag}>([^<]*)</${tag}>`, "g"), `${prefix} $1`);
156452
+ }
156453
+ processed = processed.replace(/<li>([^<]*)<\/li>/g, "- $1\n");
156454
+ processed = processed.replace(/<ul[^>]*>/g, "\n");
156455
+ processed = processed.replace(/<\/ul>/g, "\n");
156456
+ processed = processed.replace(/<ol[^>]*>/g, "\n");
156457
+ processed = processed.replace(/<\/ol>/g, "\n");
156458
+ processed = processed.replace(/<a[^>]+href="([^"]*)"[^>]*>([^<]*)<\/a>/g, "[$2]($1)");
156459
+ processed = processed.replace(/<[^>]+>/g, "");
156460
+ processed = processed.replace(/\n{3,}/g, "\n\n");
156461
+ return processed.trim();
156462
+ }
156463
+ async execute(params, signal) {
156464
+ const validationError = this.validateParams(params);
156465
+ if (validationError) {
156466
+ return {
156467
+ llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
156468
+ returnDisplay: validationError
156469
+ };
156470
+ }
156471
+ const { page_id, convert_to_markdown = true } = params;
156472
+ const personal_access_token = this.config.getConfluenceToken();
156473
+ if (!personal_access_token) {
156474
+ return {
156475
+ llmContent: "Error: Confluence Personal Access Token not found in keys.json. Please configure it first.",
156476
+ returnDisplay: "Confluence token not configured"
156477
+ };
156478
+ }
156479
+ try {
156480
+ const isCloud = CONFLUENCE_URL.includes(".atlassian.net");
156481
+ const apiUrl = `${CONFLUENCE_URL.replace(/\/$/, "")}/rest/api/content/${page_id}`;
156482
+ const paramsObj = new URLSearchParams({
156483
+ expand: "body.storage,version,space,children.attachment,ancestors"
156484
+ });
156485
+ const fullUrl = `${apiUrl}?${paramsObj.toString()}`;
156486
+ const headers = {
156487
+ "Accept": "application/json",
156488
+ "Content-Type": "application/json",
156489
+ "Authorization": `Bearer ${personal_access_token}`
156490
+ };
156491
+ const controller = new AbortController();
156492
+ const timeoutId = setTimeout(() => controller.abort(), CONFLUENCE_FETCH_TIMEOUT_MS);
156493
+ let response;
156494
+ try {
156495
+ response = await fetch(fullUrl, {
156496
+ method: "GET",
156497
+ headers,
156498
+ signal: signal || controller.signal
156499
+ });
156500
+ } finally {
156501
+ clearTimeout(timeoutId);
156502
+ }
156503
+ if (response.status === 401) {
156504
+ return {
156505
+ llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
156506
+ returnDisplay: "Authentication failed (401)"
156507
+ };
156508
+ }
156509
+ if (response.status === 403) {
156510
+ return {
156511
+ llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
156512
+ returnDisplay: "Access denied (403)"
156513
+ };
156514
+ }
156515
+ if (response.status === 404) {
156516
+ return {
156517
+ llmContent: `Error: Page not found (404). Page ID ${page_id} may not exist.`,
156518
+ returnDisplay: `Page not found (404): ${page_id}`
156519
+ };
156520
+ }
156521
+ if (!response.ok) {
156522
+ const errorText = await response.text().catch(() => "Unknown error");
156523
+ return {
156524
+ llmContent: `Error: API call failed with status ${response.status}: ${errorText}`,
156525
+ returnDisplay: `API error (${response.status})`
156526
+ };
156527
+ }
156528
+ const pageData = await response.json();
156529
+ const content = pageData.body.storage.value;
156530
+ const spaceKey = pageData.space.key;
156531
+ const title = pageData.title;
156532
+ const version2 = pageData.version.number;
156533
+ const created = pageData.created;
156534
+ const updated = pageData.updated;
156535
+ let pageUrl;
156536
+ if (isCloud) {
156537
+ pageUrl = `${CONFLUENCE_URL}/spaces/${spaceKey}/pages/${pageData.id}`;
156538
+ } else {
156539
+ pageUrl = `${CONFLUENCE_URL}/pages/viewpage.action?pageId=${pageData.id}`;
156540
+ }
156541
+ let processedContent;
156542
+ let contentFormat;
156543
+ if (convert_to_markdown) {
156544
+ processedContent = this.processHtmlContent(content, spaceKey, CONFLUENCE_URL);
156545
+ contentFormat = "markdown";
156546
+ } else {
156547
+ processedContent = content;
156548
+ contentFormat = "storage";
156549
+ }
156550
+ const result = {
156551
+ id: pageData.id,
156552
+ title,
156553
+ type: pageData.type,
156554
+ status: pageData.status,
156555
+ created,
156556
+ updated,
156557
+ url: pageUrl,
156558
+ space: {
156559
+ key: spaceKey,
156560
+ name: pageData.space.name
156561
+ },
156562
+ version: version2,
156563
+ attachments: pageData.children?.attachment?.results || [],
156564
+ ancestors: pageData.ancestors || [],
156565
+ content: {
156566
+ value: processedContent,
156567
+ format: contentFormat
156568
+ }
156569
+ };
156570
+ const resultText = `# ${title}
156571
+
156572
+ **Page ID:** ${pageData.id}
156573
+ **Space:** ${spaceKey}
156574
+ **Version:** ${version2}
156575
+ **Created:** ${created}
156576
+ **Updated:** ${updated}
156577
+ **URL:** ${pageUrl}
156578
+
156579
+ ---
156580
+
156581
+ ${processedContent}
156582
+ `;
156583
+ return {
156584
+ llmContent: resultText,
156585
+ returnDisplay: `Retrieved Confluence page: ${title}`
156586
+ };
156587
+ } catch (error) {
156588
+ const errorMessage = `Error retrieving Confluence page ${page_id}: ${getErrorMessage(error)}`;
156589
+ console.error(errorMessage, error);
156590
+ return {
156591
+ llmContent: `Error: ${errorMessage}`,
156592
+ returnDisplay: `Error: ${errorMessage}`
156593
+ };
156594
+ }
156595
+ }
156596
+ };
156597
+
156598
+ // packages/core/dist/src/tools/jira-get-issue.js
156599
+ init_errors();
156600
+ import { Type as Type16 } from "@google/genai";
156601
+ var JIRA_FETCH_TIMEOUT_MS = 3e4;
156602
+ var JIRA_URL = "https://jira.rakuten-it.com/jira";
156603
+ var JiraGetIssueTool = class _JiraGetIssueTool extends BaseTool {
156604
+ config;
156605
+ static Name = "jira_get_issue";
156606
+ constructor(config2) {
156607
+ super(_JiraGetIssueTool.Name, "JiraGetIssue", "Retrieves content from a Jira issue by its key. Uses Personal Access Token from keys.json for authentication.", {
156608
+ properties: {
156609
+ issue_key: {
156610
+ description: "The Jira issue key to retrieve (e.g., PROJECT-123)",
156611
+ type: Type16.STRING
156612
+ },
156613
+ expand: {
156614
+ description: 'Fields to expand in the response (e.g., "renderedFields,changelog")',
156615
+ type: Type16.STRING
156616
+ },
156617
+ comment_limit: {
156618
+ description: 'Maximum number of comments to include (default: 10, use "all" for all comments)',
156619
+ type: Type16.STRING
156620
+ }
156621
+ },
156622
+ required: ["issue_key"],
156623
+ type: Type16.OBJECT
156624
+ });
156625
+ this.config = config2;
156626
+ }
156627
+ validateParams(params) {
156628
+ const errors = SchemaValidator.validate(this.schema.parameters, params);
156629
+ if (errors) {
156630
+ return errors;
156631
+ }
156632
+ if (!params.issue_key || params.issue_key.trim() === "") {
156633
+ return "The 'issue_key' parameter cannot be empty.";
156634
+ }
156635
+ const issueKeyPattern = /^[A-Z]+-\d+$/;
156636
+ if (!issueKeyPattern.test(params.issue_key.trim())) {
156637
+ return "The 'issue_key' must be in format PROJECT-123 (e.g., PROJ-456)";
156638
+ }
156639
+ return null;
156640
+ }
156641
+ getDescription(params) {
156642
+ return `Retrieving Jira issue ${params.issue_key} from ${JIRA_URL}`;
156643
+ }
156644
+ /**
156645
+ * Normalize comment limit to a number
156646
+ */
156647
+ normalizeCommentLimit(commentLimit) {
156648
+ if (commentLimit === void 0) {
156649
+ return 10;
156650
+ }
156651
+ if (typeof commentLimit === "number") {
156652
+ return commentLimit;
156653
+ }
156654
+ if (commentLimit === "all" || commentLimit === "") {
156655
+ return null;
156656
+ }
156657
+ try {
156658
+ return parseInt(commentLimit, 10);
156659
+ } catch {
156660
+ return 10;
156661
+ }
156662
+ }
156663
+ /**
156664
+ * Convert Jira formatted text to plain text
156665
+ */
156666
+ convertJiraTextToPlainText(content) {
156667
+ if (typeof content === "string") {
156668
+ return content;
156669
+ }
156670
+ if (typeof content === "object" && content !== null) {
156671
+ const obj = content;
156672
+ if (Array.isArray(obj.content)) {
156673
+ return this.extractTextFromContent(obj.content);
156674
+ }
156675
+ }
156676
+ return "";
156677
+ }
156678
+ /**
156679
+ * Extract text from Jira content structure
156680
+ */
156681
+ extractTextFromContent(content) {
156682
+ let text = "";
156683
+ for (const item of content) {
156684
+ if (typeof item === "object" && item !== null) {
156685
+ const obj = item;
156686
+ if (obj.text) {
156687
+ text += obj.text;
156688
+ }
156689
+ if (obj.content && Array.isArray(obj.content)) {
156690
+ text += this.extractTextFromContent(obj.content);
156691
+ }
156692
+ }
156693
+ }
156694
+ return text;
156695
+ }
156696
+ /**
156697
+ * Format date string
156698
+ */
156699
+ formatDate(dateStr) {
156700
+ if (!dateStr) {
156701
+ return "";
156702
+ }
156703
+ try {
156704
+ const date = new Date(dateStr);
156705
+ return date.toLocaleString();
156706
+ } catch {
156707
+ return dateStr;
156708
+ }
156709
+ }
156710
+ async execute(params, signal) {
156711
+ const validationError = this.validateParams(params);
156712
+ if (validationError) {
156713
+ return {
156714
+ llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
156715
+ returnDisplay: validationError
156716
+ };
156717
+ }
156718
+ const { issue_key, expand: expand2, comment_limit } = params;
156719
+ const personal_access_token = this.config.getJiraToken();
156720
+ if (!personal_access_token) {
156721
+ return {
156722
+ llmContent: "Error: Jira Personal Access Token not found in keys.json. Please configure it first.",
156723
+ returnDisplay: "Jira token not configured"
156724
+ };
156725
+ }
156726
+ try {
156727
+ const apiUrl = `${JIRA_URL}/rest/api/2/issue/${issue_key}`;
156728
+ const queryParams = new URLSearchParams();
156729
+ const expandParams = expand2 ? expand2.split(",").map((s2) => s2.trim()) : [];
156730
+ if (!expandParams.includes("renderedFields")) {
156731
+ expandParams.push("renderedFields");
156732
+ }
156733
+ if (expandParams.length > 0) {
156734
+ queryParams.set("expand", expandParams.join(","));
156735
+ }
156736
+ const fullUrl = `${apiUrl}?${queryParams.toString()}`;
156737
+ const headers = {
156738
+ "Accept": "application/json",
156739
+ "Content-Type": "application/json",
156740
+ "Authorization": `Bearer ${personal_access_token}`
156741
+ };
156742
+ console.log("Jira API request:", {
156743
+ url: fullUrl,
156744
+ authMethod: "Bearer",
156745
+ tokenLength: personal_access_token.length,
156746
+ headers: { ...headers, Authorization: "Bearer ***" }
156747
+ });
156748
+ const controller = new AbortController();
156749
+ const timeoutId = setTimeout(() => controller.abort(), JIRA_FETCH_TIMEOUT_MS);
156750
+ let response;
156751
+ try {
156752
+ response = await fetch(fullUrl, {
156753
+ method: "GET",
156754
+ headers,
156755
+ signal: signal || controller.signal
156756
+ });
156757
+ } finally {
156758
+ clearTimeout(timeoutId);
156759
+ }
156760
+ if (response.status === 401) {
156761
+ return {
156762
+ llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
156763
+ returnDisplay: "Authentication failed (401)"
156764
+ };
156765
+ }
156766
+ if (response.status === 403) {
156767
+ return {
156768
+ llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
156769
+ returnDisplay: "Access denied (403)"
156770
+ };
156771
+ }
156772
+ if (response.status === 404) {
156773
+ return {
156774
+ llmContent: `Error: Issue not found (404). Issue key ${issue_key} may not exist.`,
156775
+ returnDisplay: `Issue not found (404): ${issue_key}`
156776
+ };
156777
+ }
156778
+ if (!response.ok) {
156779
+ const errorText = await response.text().catch(() => "Unknown error");
156780
+ console.error(`Jira API error (${response.status}):`, errorText.substring(0, 500));
156781
+ return {
156782
+ llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
156783
+ returnDisplay: `API error (${response.status})`
156784
+ };
156785
+ }
156786
+ const contentType = response.headers.get("content-type") || "";
156787
+ if (!contentType.includes("application/json")) {
156788
+ const responseText = await response.text();
156789
+ console.error("Jira API returned non-JSON response:", responseText.substring(0, 500));
156790
+ return {
156791
+ llmContent: "Error: Jira API returned non-JSON response. This usually means authentication failed. Please check your Personal Access Token in keys.json.",
156792
+ returnDisplay: "Authentication failed - invalid response format"
156793
+ };
156794
+ }
156795
+ const issueData = await response.json();
156796
+ const fields = issueData.fields || {};
156797
+ const summary = fields.summary || "";
156798
+ const status = fields.status?.name || "Unknown";
156799
+ const issueType = fields.issuetype?.name || "Unknown";
156800
+ const created = this.formatDate(fields.created);
156801
+ const updated = this.formatDate(fields.updated);
156802
+ const assignee = fields.assignee?.displayName || fields.assignee?.name || "Unassigned";
156803
+ const reporter = fields.reporter?.displayName || fields.reporter?.name || "Unknown";
156804
+ const description = this.convertJiraTextToPlainText(fields.description);
156805
+ const comments = fields.comment?.comments || [];
156806
+ const normalizedCommentLimit = this.normalizeCommentLimit(comment_limit);
156807
+ const limitedComments = normalizedCommentLimit !== null ? comments.slice(0, normalizedCommentLimit) : comments;
156808
+ const issueUrl = `${JIRA_URL}/browse/${issue_key}`;
156809
+ let resultText = `# ${issue_key}: ${summary}
156810
+
156811
+ `;
156812
+ resultText += `**Type**: ${issueType}
156813
+ `;
156814
+ resultText += `**Status**: ${status}
156815
+ `;
156816
+ resultText += `**Reporter**: ${reporter}
156817
+ `;
156818
+ resultText += `**Assignee**: ${assignee}
156819
+ `;
156820
+ resultText += `**Created**: ${created}
156821
+ `;
156822
+ resultText += `**Updated**: ${updated}
156823
+ `;
156824
+ resultText += `**URL**: ${issueUrl}
156825
+
156826
+ `;
156827
+ if (description) {
156828
+ resultText += `## Description
156829
+
156830
+ ${description}
156831
+
156832
+ `;
156833
+ }
156834
+ if (limitedComments.length > 0) {
156835
+ resultText += `## Comments (${limitedComments.length}${normalizedCommentLimit !== null ? ` of ${comments.length}` : ""})
156836
+
156837
+ `;
156838
+ for (const comment of limitedComments) {
156839
+ const commentAuthor = comment.author?.displayName || comment.author?.name || "Unknown";
156840
+ const commentBody = this.convertJiraTextToPlainText(comment.body);
156841
+ const commentCreated = this.formatDate(comment.created);
156842
+ if (commentBody) {
156843
+ resultText += `**${commentAuthor}** (${commentCreated}):
156844
+ ${commentBody}
156845
+
156846
+ `;
156847
+ }
156848
+ }
156849
+ }
156850
+ return {
156851
+ llmContent: resultText,
156852
+ returnDisplay: `Retrieved Jira issue: ${issue_key}`
156853
+ };
156854
+ } catch (error) {
156855
+ const errorMessage = `Error retrieving Jira issue ${issue_key}: ${getErrorMessage(error)}`;
156856
+ console.error(errorMessage, error);
156857
+ return {
156858
+ llmContent: `Error: ${errorMessage}`,
156859
+ returnDisplay: `Error: ${errorMessage}`
156860
+ };
156861
+ }
156862
+ }
156863
+ };
156864
+
156865
+ // packages/core/dist/src/tools/bitbucket-get-pr-diff.js
156866
+ init_errors();
156867
+ import { Type as Type17 } from "@google/genai";
156868
+ var BITBUCKET_FETCH_TIMEOUT_MS = 3e4;
156869
+ var BITBUCKET_URL = "https://git.rakuten-it.com";
156870
+ var BitbucketGetPrDiffTool = class _BitbucketGetPrDiffTool extends BaseTool {
156871
+ config;
156872
+ static Name = "bitbucket_get_pr_diff";
156873
+ constructor(config2) {
156874
+ super(_BitbucketGetPrDiffTool.Name, "BitbucketGetPrDiff", "Retrieves the diff content for a specified Bitbucket Pull Request. Uses Personal Access Token from keys.json for authentication.", {
156875
+ properties: {
156876
+ project_key: {
156877
+ description: "The unique identifier for the Bitbucket project that owns the PR",
156878
+ type: Type17.STRING
156879
+ },
156880
+ repo_slug: {
156881
+ description: "The repository slug name that owns the PR",
156882
+ type: Type17.STRING
156883
+ },
156884
+ pr_id: {
156885
+ description: "The Pull Request unique identifier",
156886
+ type: Type17.NUMBER
156887
+ }
156888
+ },
156889
+ required: ["project_key", "repo_slug", "pr_id"],
156890
+ type: Type17.OBJECT
156891
+ });
156892
+ this.config = config2;
156893
+ }
156894
+ validateParams(params) {
156895
+ const errors = SchemaValidator.validate(this.schema.parameters, params);
156896
+ if (errors) {
156897
+ return errors;
156898
+ }
156899
+ if (!params.project_key || params.project_key.trim() === "") {
156900
+ return "The 'project_key' parameter cannot be empty.";
156901
+ }
156902
+ if (!params.repo_slug || params.repo_slug.trim() === "") {
156903
+ return "The 'repo_slug' parameter cannot be empty.";
156904
+ }
156905
+ if (params.pr_id <= 0) {
156906
+ return "The 'pr_id' must be a positive number.";
156907
+ }
156908
+ return null;
156909
+ }
156910
+ getDescription(params) {
156911
+ return `Retrieving diff for Bitbucket PR #${params.pr_id} in ${params.project_key}/${params.repo_slug}`;
156912
+ }
156913
+ async execute(params, signal) {
156914
+ const validationError = this.validateParams(params);
156915
+ if (validationError) {
156916
+ return {
156917
+ llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
156918
+ returnDisplay: validationError
156919
+ };
156920
+ }
156921
+ const { project_key, repo_slug, pr_id } = params;
156922
+ const personal_access_token = this.config.getBitbucketToken();
156923
+ if (!personal_access_token) {
156924
+ return {
156925
+ llmContent: "Error: Bitbucket Personal Access Token not found in keys.json. Please configure it first.",
156926
+ returnDisplay: "Bitbucket token not configured"
156927
+ };
156928
+ }
156929
+ try {
156930
+ const apiUrl = `${BITBUCKET_URL}/rest/api/1.0/projects/${project_key}/repos/${repo_slug}/pull-requests/${pr_id}/diff`;
156931
+ const headers = {
156932
+ "Authorization": `Bearer ${personal_access_token}`,
156933
+ "Accept": "text/plain"
156934
+ };
156935
+ console.log("Bitbucket API request:", {
156936
+ url: apiUrl,
156937
+ authMethod: "Bearer",
156938
+ tokenLength: personal_access_token.length,
156939
+ headers: { ...headers, Authorization: "Bearer ***" }
156940
+ });
156941
+ const controller = new AbortController();
156942
+ const timeoutId = setTimeout(() => controller.abort(), BITBUCKET_FETCH_TIMEOUT_MS);
156943
+ let response;
156944
+ try {
156945
+ response = await fetch(apiUrl, {
156946
+ method: "GET",
156947
+ headers,
156948
+ signal: signal || controller.signal
156949
+ });
156950
+ } finally {
156951
+ clearTimeout(timeoutId);
156952
+ }
156953
+ if (response.status === 401) {
156954
+ return {
156955
+ llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
156956
+ returnDisplay: "Authentication failed (401)"
156957
+ };
156958
+ }
156959
+ if (response.status === 403) {
156960
+ return {
156961
+ llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
156962
+ returnDisplay: "Access denied (403)"
156963
+ };
156964
+ }
156965
+ if (response.status === 404) {
156966
+ return {
156967
+ llmContent: `Error: Pull Request not found (404). PR #${pr_id} in ${project_key}/${repo_slug} may not exist.`,
156968
+ returnDisplay: `PR not found (404): #${pr_id}`
156969
+ };
156970
+ }
156971
+ if (!response.ok) {
156972
+ const errorText = await response.text().catch(() => "Unknown error");
156973
+ console.error(`Bitbucket API error (${response.status}):`, errorText.substring(0, 500));
156974
+ return {
156975
+ llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
156976
+ returnDisplay: `API error (${response.status})`
156977
+ };
156978
+ }
156979
+ const diffText = await response.text();
156980
+ let resultText = `# Pull Request Diff: ${project_key}/${repo_slug}#${pr_id}
156981
+
156982
+ `;
156983
+ resultText += `\`\`\`diff
156984
+ ${diffText}
156985
+ \`\`\``;
156986
+ return {
156987
+ llmContent: resultText,
156988
+ returnDisplay: `Retrieved diff for Bitbucket PR #${pr_id}`
156989
+ };
156990
+ } catch (error) {
156991
+ const errorMessage = `Error retrieving Bitbucket PR diff ${project_key}/${repo_slug}#${pr_id}: ${getErrorMessage(error)}`;
156992
+ console.error(errorMessage, error);
156993
+ return {
156994
+ llmContent: `Error: ${errorMessage}`,
156995
+ returnDisplay: `Error: ${errorMessage}`
156996
+ };
156997
+ }
156998
+ }
156999
+ };
157000
+
157001
+ // packages/core/dist/src/tools/bitbucket-add-pr-comment.js
157002
+ init_errors();
157003
+ import { Type as Type18 } from "@google/genai";
157004
+ var BITBUCKET_FETCH_TIMEOUT_MS2 = 3e4;
157005
+ var BITBUCKET_URL2 = "https://git.rakuten-it.com";
157006
+ var BitbucketAddPrCommentTool = class _BitbucketAddPrCommentTool extends BaseTool {
157007
+ config;
157008
+ static Name = "bitbucket_add_pr_comment";
157009
+ constructor(config2) {
157010
+ super(_BitbucketAddPrCommentTool.Name, "BitbucketAddPrComment", "Adds a general comment to a specified Bitbucket Pull Request. Uses Personal Access Token from keys.json for authentication.", {
157011
+ properties: {
157012
+ project_key: {
157013
+ description: "The unique identifier for the Bitbucket project that owns the PR",
157014
+ type: Type18.STRING
157015
+ },
157016
+ repo_slug: {
157017
+ description: "The repository slug name that owns the PR",
157018
+ type: Type18.STRING
157019
+ },
157020
+ pr_id: {
157021
+ description: "The Pull Request unique identifier",
157022
+ type: Type18.NUMBER
157023
+ },
157024
+ comment_text: {
157025
+ description: "The text content of the comment to add",
157026
+ type: Type18.STRING
157027
+ }
157028
+ },
157029
+ required: ["project_key", "repo_slug", "pr_id", "comment_text"],
157030
+ type: Type18.OBJECT
157031
+ });
157032
+ this.config = config2;
157033
+ }
157034
+ validateParams(params) {
157035
+ const errors = SchemaValidator.validate(this.schema.parameters, params);
157036
+ if (errors) {
157037
+ return errors;
157038
+ }
157039
+ if (!params.project_key || params.project_key.trim() === "") {
157040
+ return "The 'project_key' parameter cannot be empty.";
157041
+ }
157042
+ if (!params.repo_slug || params.repo_slug.trim() === "") {
157043
+ return "The 'repo_slug' parameter cannot be empty.";
157044
+ }
157045
+ if (params.pr_id <= 0) {
157046
+ return "The 'pr_id' must be a positive number.";
157047
+ }
157048
+ if (!params.comment_text || params.comment_text.trim() === "") {
157049
+ return "The 'comment_text' parameter cannot be empty.";
157050
+ }
157051
+ return null;
157052
+ }
157053
+ getDescription(params) {
157054
+ return `Adding comment to Bitbucket PR #${params.pr_id} in ${params.project_key}/${params.repo_slug}`;
157055
+ }
157056
+ async execute(params, signal) {
157057
+ const validationError = this.validateParams(params);
157058
+ if (validationError) {
157059
+ return {
157060
+ llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
157061
+ returnDisplay: validationError
157062
+ };
157063
+ }
157064
+ const { project_key, repo_slug, pr_id, comment_text } = params;
157065
+ const personal_access_token = this.config.getBitbucketToken();
157066
+ if (!personal_access_token) {
157067
+ return {
157068
+ llmContent: "Error: Bitbucket Personal Access Token not found in keys.json. Please configure it first.",
157069
+ returnDisplay: "Bitbucket token not configured"
157070
+ };
157071
+ }
157072
+ try {
157073
+ const apiUrl = `${BITBUCKET_URL2}/rest/api/latest/projects/${project_key}/repos/${repo_slug}/pull-requests/${pr_id}/comments`;
157074
+ const headers = {
157075
+ "Authorization": `Bearer ${personal_access_token}`,
157076
+ "Content-Type": "application/json"
157077
+ };
157078
+ const payload = {
157079
+ text: comment_text
157080
+ };
157081
+ console.log("Bitbucket API request:", {
157082
+ url: apiUrl,
157083
+ method: "POST",
157084
+ authMethod: "Bearer",
157085
+ tokenLength: personal_access_token.length,
157086
+ headers: { ...headers, Authorization: "Bearer ***" }
157087
+ });
157088
+ const controller = new AbortController();
157089
+ const timeoutId = setTimeout(() => controller.abort(), BITBUCKET_FETCH_TIMEOUT_MS2);
157090
+ let response;
157091
+ try {
157092
+ response = await fetch(apiUrl, {
157093
+ method: "POST",
157094
+ headers,
157095
+ body: JSON.stringify(payload),
157096
+ signal: signal || controller.signal
157097
+ });
157098
+ } finally {
157099
+ clearTimeout(timeoutId);
157100
+ }
157101
+ if (response.status === 401) {
157102
+ return {
157103
+ llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
157104
+ returnDisplay: "Authentication failed (401)"
157105
+ };
157106
+ }
157107
+ if (response.status === 403) {
157108
+ return {
157109
+ llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
157110
+ returnDisplay: "Access denied (403)"
157111
+ };
157112
+ }
157113
+ if (response.status === 404) {
157114
+ return {
157115
+ llmContent: `Error: Pull Request not found (404). PR #${pr_id} in ${project_key}/${repo_slug} may not exist.`,
157116
+ returnDisplay: `PR not found (404): #${pr_id}`
157117
+ };
157118
+ }
157119
+ if (!response.ok) {
157120
+ const errorText = await response.text().catch(() => "Unknown error");
157121
+ console.error(`Bitbucket API error (${response.status}):`, errorText.substring(0, 500));
157122
+ return {
157123
+ llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
157124
+ returnDisplay: `API error (${response.status})`
157125
+ };
157126
+ }
157127
+ const responseData = await response.json();
157128
+ let resultText = `# Comment added to Pull Request: ${project_key}/${repo_slug}#${pr_id}
157129
+
157130
+ `;
157131
+ resultText += `**Comment ID**: ${responseData.id || "Unknown"}
157132
+ `;
157133
+ resultText += `**Text**: ${comment_text}
157134
+ `;
157135
+ return {
157136
+ llmContent: resultText,
157137
+ returnDisplay: `Added comment to Bitbucket PR #${pr_id}`
157138
+ };
157139
+ } catch (error) {
157140
+ const errorMessage = `Error adding comment to Bitbucket PR ${project_key}/${repo_slug}#${pr_id}: ${getErrorMessage(error)}`;
157141
+ console.error(errorMessage, error);
157142
+ return {
157143
+ llmContent: `Error: ${errorMessage}`,
157144
+ returnDisplay: `Error: ${errorMessage}`
157145
+ };
157146
+ }
157147
+ }
157148
+ };
157149
+
157150
+ // packages/core/dist/src/tools/bitbucket-add-pr-inline-comment.js
157151
+ init_errors();
157152
+ import { Type as Type19 } from "@google/genai";
157153
+ var BITBUCKET_FETCH_TIMEOUT_MS3 = 3e4;
157154
+ var BITBUCKET_URL3 = "https://git.rakuten-it.com";
157155
+ var BitbucketAddPrInlineCommentTool = class _BitbucketAddPrInlineCommentTool extends BaseTool {
157156
+ config;
157157
+ static Name = "bitbucket_add_pr_inline_comment";
157158
+ constructor(config2) {
157159
+ super(_BitbucketAddPrInlineCommentTool.Name, "BitbucketAddPrInlineComment", "Adds an inline comment to a specific file and line in a Bitbucket Pull Request diff. Uses Personal Access Token from keys.json for authentication.", {
157160
+ properties: {
157161
+ project_key: {
157162
+ description: "The unique identifier for the Bitbucket project that owns the PR",
157163
+ type: Type19.STRING
157164
+ },
157165
+ repo_slug: {
157166
+ description: "The repository slug name that owns the PR",
157167
+ type: Type19.STRING
157168
+ },
157169
+ pr_id: {
157170
+ description: "The Pull Request unique identifier",
157171
+ type: Type19.NUMBER
157172
+ },
157173
+ file_path: {
157174
+ description: "The file path relative to repository root to add comment to",
157175
+ type: Type19.STRING
157176
+ },
157177
+ line: {
157178
+ description: "The line number to add comment to",
157179
+ type: Type19.NUMBER
157180
+ },
157181
+ comment_text: {
157182
+ description: "The text content of the inline comment to add",
157183
+ type: Type19.STRING
157184
+ },
157185
+ line_type: {
157186
+ description: "The line type, default is ADDED, optional values: ADDED, REMOVED, CONTEXT",
157187
+ type: Type19.STRING
157188
+ },
157189
+ file_type: {
157190
+ description: "The file type, default is TO, optional values: TO, FROM",
157191
+ type: Type19.STRING
157192
+ }
157193
+ },
157194
+ required: ["project_key", "repo_slug", "pr_id", "file_path", "line", "comment_text"],
157195
+ type: Type19.OBJECT
157196
+ });
157197
+ this.config = config2;
157198
+ }
157199
+ validateParams(params) {
157200
+ const errors = SchemaValidator.validate(this.schema.parameters, params);
157201
+ if (errors) {
157202
+ return errors;
157203
+ }
157204
+ if (!params.project_key || params.project_key.trim() === "") {
157205
+ return "The 'project_key' parameter cannot be empty.";
157206
+ }
157207
+ if (!params.repo_slug || params.repo_slug.trim() === "") {
157208
+ return "The 'repo_slug' parameter cannot be empty.";
157209
+ }
157210
+ if (params.pr_id <= 0) {
157211
+ return "The 'pr_id' must be a positive number.";
157212
+ }
157213
+ if (!params.file_path || params.file_path.trim() === "") {
157214
+ return "The 'file_path' parameter cannot be empty.";
157215
+ }
157216
+ if (params.line <= 0) {
157217
+ return "The 'line' must be a positive number.";
157218
+ }
157219
+ if (!params.comment_text || params.comment_text.trim() === "") {
157220
+ return "The 'comment_text' parameter cannot be empty.";
157221
+ }
157222
+ if (params.line_type && !["ADDED", "REMOVED", "CONTEXT"].includes(params.line_type)) {
157223
+ return "The 'line_type' must be one of: ADDED, REMOVED, CONTEXT";
157224
+ }
157225
+ if (params.file_type && !["TO", "FROM"].includes(params.file_type)) {
157226
+ return "The 'file_type' must be one of: TO, FROM";
157227
+ }
157228
+ return null;
157229
+ }
157230
+ getDescription(params) {
157231
+ return `Adding inline comment to Bitbucket PR #${params.pr_id} in ${params.project_key}/${params.repo_slug} at ${params.file_path}:${params.line}`;
157232
+ }
157233
+ async execute(params, signal) {
157234
+ const validationError = this.validateParams(params);
157235
+ if (validationError) {
157236
+ return {
157237
+ llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
157238
+ returnDisplay: validationError
157239
+ };
157240
+ }
157241
+ const { project_key, repo_slug, pr_id, file_path, line, comment_text, line_type, file_type } = params;
157242
+ const personal_access_token = this.config.getBitbucketToken();
157243
+ if (!personal_access_token) {
157244
+ return {
157245
+ llmContent: "Error: Bitbucket Personal Access Token not found in keys.json. Please configure it first.",
157246
+ returnDisplay: "Bitbucket token not configured"
157247
+ };
157248
+ }
157249
+ try {
157250
+ const apiUrl = `${BITBUCKET_URL3}/rest/api/latest/projects/${project_key}/repos/${repo_slug}/pull-requests/${pr_id}/comments`;
157251
+ const headers = {
157252
+ "Authorization": `Bearer ${personal_access_token}`,
157253
+ "Content-Type": "application/json"
157254
+ };
157255
+ const payload = {
157256
+ text: comment_text,
157257
+ anchor: {
157258
+ path: file_path,
157259
+ line,
157260
+ lineType: line_type || "ADDED",
157261
+ fileType: file_type || "TO"
157262
+ }
157263
+ };
157264
+ console.log("Bitbucket API request:", {
157265
+ url: apiUrl,
157266
+ method: "POST",
157267
+ authMethod: "Bearer",
157268
+ tokenLength: personal_access_token.length,
157269
+ headers: { ...headers, Authorization: "Bearer ***" }
157270
+ });
157271
+ const controller = new AbortController();
157272
+ const timeoutId = setTimeout(() => controller.abort(), BITBUCKET_FETCH_TIMEOUT_MS3);
157273
+ let response;
157274
+ try {
157275
+ response = await fetch(apiUrl, {
157276
+ method: "POST",
157277
+ headers,
157278
+ body: JSON.stringify(payload),
157279
+ signal: signal || controller.signal
157280
+ });
157281
+ } finally {
157282
+ clearTimeout(timeoutId);
157283
+ }
157284
+ if (response.status === 401) {
157285
+ return {
157286
+ llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
157287
+ returnDisplay: "Authentication failed (401)"
157288
+ };
157289
+ }
157290
+ if (response.status === 403) {
157291
+ return {
157292
+ llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
157293
+ returnDisplay: "Access denied (403)"
157294
+ };
157295
+ }
157296
+ if (response.status === 404) {
157297
+ return {
157298
+ llmContent: `Error: Pull Request not found (404). PR #${pr_id} in ${project_key}/${repo_slug} may not exist.`,
157299
+ returnDisplay: `PR not found (404): #${pr_id}`
157300
+ };
157301
+ }
157302
+ if (!response.ok) {
157303
+ const errorText = await response.text().catch(() => "Unknown error");
157304
+ console.error(`Bitbucket API error (${response.status}):`, errorText.substring(0, 500));
157305
+ return {
157306
+ llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
157307
+ returnDisplay: `API error (${response.status})`
157308
+ };
157309
+ }
157310
+ const responseData = await response.json();
157311
+ let resultText = `# Inline comment added to Pull Request: ${project_key}/${repo_slug}#${pr_id}
157312
+
157313
+ `;
157314
+ resultText += `**File**: ${file_path}
157315
+ `;
157316
+ resultText += `**Line**: ${line}
157317
+ `;
157318
+ resultText += `**Line Type**: ${line_type || "ADDED"}
157319
+ `;
157320
+ resultText += `**File Type**: ${file_type || "TO"}
157321
+ `;
157322
+ resultText += `**Comment ID**: ${responseData.id || "Unknown"}
157323
+ `;
157324
+ resultText += `**Text**: ${comment_text}
157325
+ `;
157326
+ return {
157327
+ llmContent: resultText,
157328
+ returnDisplay: `Added inline comment to Bitbucket PR #${pr_id} at ${file_path}:${line}`
157329
+ };
157330
+ } catch (error) {
157331
+ const errorMessage = `Error adding inline comment to Bitbucket PR ${project_key}/${repo_slug}#${pr_id}: ${getErrorMessage(error)}`;
157332
+ console.error(errorMessage, error);
157333
+ return {
157334
+ llmContent: `Error: ${errorMessage}`,
157335
+ returnDisplay: `Error: ${errorMessage}`
157336
+ };
157337
+ }
157338
+ }
157339
+ };
157340
+
156387
157341
  // packages/core/dist/src/utils/getFolderStructure.js
156388
157342
  init_errors();
156389
157343
  import * as fs16 from "fs/promises";
@@ -156747,7 +157701,7 @@ import fs18 from "node:fs";
156747
157701
  import process9 from "node:process";
156748
157702
  function getCoreSystemPrompt(userMemory) {
156749
157703
  let systemMdEnabled = false;
156750
- let systemMdPath = path19.join(GEMINI_CONFIG_DIR, "system.md");
157704
+ let systemMdPath = path19.join(MPDAI_CONFIG_DIR, "system.md");
156751
157705
  const systemMdVar = process9.env.GEMINI_SYSTEM_MD?.toLowerCase();
156752
157706
  if (systemMdVar && !["0", "false"].includes(systemMdVar)) {
156753
157707
  systemMdEnabled = true;
@@ -157052,7 +158006,7 @@ The structure MUST be as follows:
157052
158006
  }
157053
158007
 
157054
158008
  // packages/core/dist/src/utils/nextSpeakerChecker.js
157055
- import { Type as Type15 } from "@google/genai";
158009
+ import { Type as Type20 } from "@google/genai";
157056
158010
  var CHECK_PROMPT = `Analyze *only* the content and structure of your immediately preceding response (your last turn in the conversation history). Based *strictly* on that response, determine who should logically speak next: the 'user' or the 'model' (you).
157057
158011
  **Decision Rules (apply in order):**
157058
158012
  1. **Model Continues:** If your last response explicitly states an immediate next action *you* intend to take (e.g., "Next, I will...", "Now I'll process...", "Moving on to analyze...", indicates an intended tool call that didn't execute), OR if the response seems clearly incomplete (cut off mid-thought without a natural conclusion), then the **'model'** should speak next.
@@ -157079,14 +158033,14 @@ Respond *only* in JSON format according to the following schema. Do not include
157079
158033
  \`\`\`
157080
158034
  `;
157081
158035
  var RESPONSE_SCHEMA = {
157082
- type: Type15.OBJECT,
158036
+ type: Type20.OBJECT,
157083
158037
  properties: {
157084
158038
  reasoning: {
157085
- type: Type15.STRING,
158039
+ type: Type20.STRING,
157086
158040
  description: "Brief explanation justifying the 'next_speaker' choice based *strictly* on the applicable rule and the content/structure of the preceding turn."
157087
158041
  },
157088
158042
  next_speaker: {
157089
- type: Type15.STRING,
158043
+ type: Type20.STRING,
157090
158044
  enum: ["user", "model"],
157091
158045
  description: "Who should speak next based *only* on the preceding turn and the decision rules"
157092
158046
  }
@@ -157551,7 +158505,7 @@ import * as fs19 from "fs";
157551
158505
  import * as path20 from "path";
157552
158506
  import { randomUUID } from "crypto";
157553
158507
  var homeDir = os6.homedir() ?? "";
157554
- var geminiDir = path20.join(homeDir, GEMINI_DIR2);
158508
+ var geminiDir = path20.join(homeDir, MPDAI_DIR2);
157555
158509
  var installationIdFile = path20.join(geminiDir, "installation_id");
157556
158510
  function ensureGeminiDirExists() {
157557
158511
  if (!fs19.existsSync(geminiDir)) {
@@ -159110,7 +160064,7 @@ var GitIgnoreParser = class {
159110
160064
 
159111
160065
  // packages/core/dist/src/services/fileDiscoveryService.js
159112
160066
  import * as path22 from "path";
159113
- var GEMINI_IGNORE_FILE_NAME = ".geminiignore";
160067
+ var GEMINI_IGNORE_FILE_NAME = ".mpdaiignore";
159114
160068
  var FileDiscoveryService = class {
159115
160069
  gitIgnoreFilter = null;
159116
160070
  geminiIgnoreFilter = null;
@@ -159181,7 +160135,7 @@ var FileDiscoveryService = class {
159181
160135
  return false;
159182
160136
  }
159183
160137
  /**
159184
- * Returns loaded patterns from .geminiignore
160138
+ * Returns loaded patterns from .mpdaiignore
159185
160139
  */
159186
160140
  getGeminiIgnorePatterns() {
159187
160141
  return this.geminiIgnoreFilter?.getPatterns() ?? [];
@@ -163724,7 +164678,7 @@ var GitService = class {
163724
164678
  }
163725
164679
  getHistoryDir() {
163726
164680
  const hash = getProjectHash(this.projectRoot);
163727
- return path23.join(os7.homedir(), GEMINI_DIR2, "history", hash);
164681
+ return path23.join(os7.homedir(), MPDAI_DIR2, "history", hash);
163728
164682
  }
163729
164683
  async initialize() {
163730
164684
  if (!isGitRepository(this.projectRoot)) {
@@ -164002,7 +164956,7 @@ async function getGeminiMdFilePathsInternal(currentWorkingDirectory, userHomePat
164002
164956
  for (const geminiMdFilename of geminiMdFilenames) {
164003
164957
  const resolvedCwd = path26.resolve(currentWorkingDirectory);
164004
164958
  const resolvedHome = path26.resolve(userHomePath);
164005
- const globalMemoryPath = path26.join(resolvedHome, GEMINI_CONFIG_DIR, geminiMdFilename);
164959
+ const globalMemoryPath = path26.join(resolvedHome, MPDAI_CONFIG_DIR, geminiMdFilename);
164006
164960
  if (debugMode)
164007
164961
  logger3.debug(`Searching for ${geminiMdFilename} starting from CWD: ${resolvedCwd}`);
164008
164962
  if (debugMode)
@@ -164026,7 +164980,7 @@ async function getGeminiMdFilePathsInternal(currentWorkingDirectory, userHomePat
164026
164980
  if (debugMode) {
164027
164981
  logger3.debug(`Checking for ${geminiMdFilename} in (upward scan): ${currentDir}`);
164028
164982
  }
164029
- if (currentDir === path26.join(resolvedHome, GEMINI_CONFIG_DIR)) {
164983
+ if (currentDir === path26.join(resolvedHome, MPDAI_CONFIG_DIR)) {
164030
164984
  if (debugMode) {
164031
164985
  logger3.debug(`Upward scan reached global config dir path, stopping upward search here: ${currentDir}`);
164032
164986
  }
@@ -164370,7 +165324,7 @@ var Config = class {
164370
165324
  return this.geminiClient;
164371
165325
  }
164372
165326
  getGeminiDir() {
164373
- return path27.join(this.targetDir, GEMINI_CONFIG_DIR);
165327
+ return path27.join(this.targetDir, MPDAI_CONFIG_DIR);
164374
165328
  }
164375
165329
  getProjectTempDir() {
164376
165330
  return getProjectTempDir(this.getProjectRoot());
@@ -164424,6 +165378,72 @@ var Config = class {
164424
165378
  this.setGeminiMdFileCount(fileCount);
164425
165379
  return { memoryContent, fileCount };
164426
165380
  }
165381
+ /**
165382
+ * Get Confluence Advanced Access Token from keys.json
165383
+ * @returns The Personal Access Token or null if not found
165384
+ */
165385
+ getConfluenceToken() {
165386
+ try {
165387
+ const keysJsonPath = join11(homedir6(), ".mpdai", "keys.json");
165388
+ if (!existsSync5(keysJsonPath)) {
165389
+ return null;
165390
+ }
165391
+ const content = readFileSync8(keysJsonPath, "utf-8");
165392
+ const keys = JSON.parse(content);
165393
+ const confluenceKey = keys.find((key) => key.name === "confluence");
165394
+ if (confluenceKey && confluenceKey.value1) {
165395
+ return confluenceKey.value1;
165396
+ }
165397
+ return null;
165398
+ } catch (error) {
165399
+ console.error("Failed to read Confluence token from keys.json:", error);
165400
+ return null;
165401
+ }
165402
+ }
165403
+ /**
165404
+ * Get Jira Personal Access Token from keys.json
165405
+ * @returns The Personal Access Token or null if not found
165406
+ */
165407
+ getJiraToken() {
165408
+ try {
165409
+ const keysJsonPath = join11(homedir6(), ".mpdai", "keys.json");
165410
+ if (!existsSync5(keysJsonPath)) {
165411
+ return null;
165412
+ }
165413
+ const content = readFileSync8(keysJsonPath, "utf-8");
165414
+ const keys = JSON.parse(content);
165415
+ const jiraKey = keys.find((key) => key.name === "jira");
165416
+ if (jiraKey && jiraKey.value1) {
165417
+ return jiraKey.value1;
165418
+ }
165419
+ return null;
165420
+ } catch (error) {
165421
+ console.error("Failed to read Jira token from keys.json:", error);
165422
+ return null;
165423
+ }
165424
+ }
165425
+ /**
165426
+ * Get Bitbucket Personal Access Token from keys.json
165427
+ * @returns The Personal Access Token or null if not found
165428
+ */
165429
+ getBitbucketToken() {
165430
+ try {
165431
+ const keysJsonPath = join11(homedir6(), ".mpdai", "keys.json");
165432
+ if (!existsSync5(keysJsonPath)) {
165433
+ return null;
165434
+ }
165435
+ const content = readFileSync8(keysJsonPath, "utf-8");
165436
+ const keys = JSON.parse(content);
165437
+ const bitbucketKey = keys.find((key) => key.name === "bitbucket");
165438
+ if (bitbucketKey && bitbucketKey.value1) {
165439
+ return bitbucketKey.value1;
165440
+ }
165441
+ return null;
165442
+ } catch (error) {
165443
+ console.error("Failed to read Bitbucket token from keys.json:", error);
165444
+ return null;
165445
+ }
165446
+ }
164427
165447
  async createToolRegistry() {
164428
165448
  const registry = new ToolRegistry(this);
164429
165449
  const targetDir = this.getTargetDir();
@@ -164456,9 +165476,24 @@ var Config = class {
164456
165476
  registerCoreTool(EditTool, this);
164457
165477
  registerCoreTool(WriteFileTool, this);
164458
165478
  }
164459
- if (process10.env.USE_GEMINI_TOOL) {
165479
+ const useMpdaiTool = process10.env.USE_MPDAI_TOOL !== "false";
165480
+ if (useMpdaiTool) {
164460
165481
  registerCoreTool(WebFetchTool, this);
164461
165482
  registerCoreTool(WebSearchTool, this);
165483
+ const confluenceToken = this.getConfluenceToken();
165484
+ if (confluenceToken) {
165485
+ registerCoreTool(ConfluenceGetPageTool, this);
165486
+ }
165487
+ const jiraToken = this.getJiraToken();
165488
+ if (jiraToken) {
165489
+ registerCoreTool(JiraGetIssueTool, this);
165490
+ }
165491
+ const bitbucketToken = this.getBitbucketToken();
165492
+ if (bitbucketToken) {
165493
+ registerCoreTool(BitbucketGetPrDiffTool, this);
165494
+ registerCoreTool(BitbucketAddPrCommentTool, this);
165495
+ registerCoreTool(BitbucketAddPrInlineCommentTool, this);
165496
+ }
164462
165497
  }
164463
165498
  await registry.discoverTools();
164464
165499
  return registry;
@@ -165050,7 +166085,7 @@ init_models();
165050
166085
  import * as fs26 from "fs";
165051
166086
  import * as path29 from "path";
165052
166087
  import * as os9 from "os";
165053
- var EXTENSIONS_DIRECTORY_NAME = path29.join(".gemini", "extensions");
166088
+ var EXTENSIONS_DIRECTORY_NAME = path29.join(".mpdai", "extensions");
165054
166089
  var EXTENSIONS_CONFIG_FILENAME = "gemini-extension.json";
165055
166090
  function loadExtensions(workspaceDir) {
165056
166091
  const allExtensions = [
@@ -165370,7 +166405,7 @@ async function getPackageJson() {
165370
166405
  // packages/cli/src/utils/version.ts
165371
166406
  async function getCliVersion() {
165372
166407
  const pkgJson = await getPackageJson();
165373
- return "0.1.25";
166408
+ return "0.1.31";
165374
166409
  }
165375
166410
 
165376
166411
  // packages/cli/src/config/sandboxConfig.ts
@@ -165661,7 +166696,7 @@ function mergeExcludeTools(settings, extensions) {
165661
166696
  var dotenv = __toESM(require_main(), 1);
165662
166697
  import * as fs27 from "fs";
165663
166698
  import * as path34 from "path";
165664
- import { homedir as homedir7 } from "os";
166699
+ import { homedir as homedir8 } from "os";
165665
166700
  var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
165666
166701
 
165667
166702
  // packages/cli/src/ui/themes/theme.ts
@@ -166178,8 +167213,8 @@ var DefaultDark = new Theme(
166178
167213
  );
166179
167214
 
166180
167215
  // packages/cli/src/config/settings.ts
166181
- var SETTINGS_DIRECTORY_NAME = ".gemini";
166182
- var USER_SETTINGS_DIR = path34.join(homedir7(), SETTINGS_DIRECTORY_NAME);
167216
+ var SETTINGS_DIRECTORY_NAME = ".mpdai";
167217
+ var USER_SETTINGS_DIR = path34.join(homedir8(), SETTINGS_DIRECTORY_NAME);
166183
167218
  var USER_SETTINGS_PATH = path34.join(USER_SETTINGS_DIR, "settings.json");
166184
167219
  var LoadedSettings = class {
166185
167220
  constructor(user, workspace, errors) {
@@ -166252,7 +167287,7 @@ function resolveEnvVarsInObject(obj) {
166252
167287
  function findEnvFile(startDir) {
166253
167288
  let currentDir = path34.resolve(startDir);
166254
167289
  while (true) {
166255
- const geminiEnvPath = path34.join(currentDir, GEMINI_CONFIG_DIR, ".env");
167290
+ const geminiEnvPath = path34.join(currentDir, MPDAI_CONFIG_DIR, ".env");
166256
167291
  if (fs27.existsSync(geminiEnvPath)) {
166257
167292
  return geminiEnvPath;
166258
167293
  }
@@ -166262,11 +167297,11 @@ function findEnvFile(startDir) {
166262
167297
  }
166263
167298
  const parentDir = path34.dirname(currentDir);
166264
167299
  if (parentDir === currentDir || !parentDir) {
166265
- const homeGeminiEnvPath = path34.join(homedir7(), GEMINI_CONFIG_DIR, ".env");
167300
+ const homeGeminiEnvPath = path34.join(homedir8(), MPDAI_CONFIG_DIR, ".env");
166266
167301
  if (fs27.existsSync(homeGeminiEnvPath)) {
166267
167302
  return homeGeminiEnvPath;
166268
167303
  }
166269
- const homeEnvPath = path34.join(homedir7(), ".env");
167304
+ const homeEnvPath = path34.join(homedir8(), ".env");
166270
167305
  if (fs27.existsSync(homeEnvPath)) {
166271
167306
  return homeEnvPath;
166272
167307
  }
@@ -166375,10 +167410,10 @@ function saveSettings(settingsFile) {
166375
167410
 
166376
167411
  // packages/cli/src/utils/cleanup.ts
166377
167412
  import { promises as fs28 } from "fs";
166378
- import { join as join13 } from "path";
167413
+ import { join as join14 } from "path";
166379
167414
  async function cleanupCheckpoints() {
166380
167415
  const tempDir = getProjectTempDir(process.cwd());
166381
- const checkpointsDir = join13(tempDir, "checkpoints");
167416
+ const checkpointsDir = join14(tempDir, "checkpoints");
166382
167417
  try {
166383
167418
  await fs28.rm(checkpointsDir, { recursive: true, force: true });
166384
167419
  } catch {