mpd-llm-cli 0.1.25 → 0.1.28
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.cjs +1157 -128
- package/bundle/api.js +1150 -121
- package/bundle/gemini.js +1270 -136
- package/package.json +2 -2
package/bundle/api.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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(),
|
|
19548
|
+
return path2.join(os2.homedir(), MPDAI_DIR, CREDENTIAL_FILENAME);
|
|
19549
19549
|
}
|
|
19550
19550
|
function getGoogleAccountIdCachePath() {
|
|
19551
|
-
return path2.join(os2.homedir(),
|
|
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,
|
|
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
|
-
|
|
19624
|
+
MPDAI_DIR = ".mpdai";
|
|
19625
19625
|
CREDENTIAL_FILENAME = "oauth_creds.json";
|
|
19626
19626
|
GOOGLE_ACCOUNT_ID_FILENAME = "google_account_id";
|
|
19627
19627
|
}
|
|
@@ -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.
|
|
27720
|
+
const version2 = "0.1.28";
|
|
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
|
|
35865
|
-
(function(
|
|
35866
|
-
|
|
35867
|
-
|
|
35868
|
-
})(
|
|
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 ===
|
|
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
|
|
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 ?
|
|
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
|
|
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
|
|
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
|
|
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, [
|
|
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, [
|
|
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
|
-
|
|
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 =
|
|
62694
|
+
module2.exports = Type21;
|
|
62695
62695
|
var Namespace = require_namespace();
|
|
62696
|
-
((
|
|
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
|
|
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(
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
62816
|
-
var type = new
|
|
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 ?
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
62949
|
+
Type21.prototype.isReservedId = function isReservedId(id) {
|
|
62950
62950
|
return Namespace.isReservedId(this.reserved, id);
|
|
62951
62951
|
};
|
|
62952
|
-
|
|
62952
|
+
Type21.prototype.isReservedName = function isReservedName(name2) {
|
|
62953
62953
|
return Namespace.isReservedName(this.reserved, name2);
|
|
62954
62954
|
};
|
|
62955
|
-
|
|
62955
|
+
Type21.prototype.create = function create(properties) {
|
|
62956
62956
|
return new this.ctor(properties);
|
|
62957
62957
|
};
|
|
62958
|
-
|
|
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
|
-
|
|
62995
|
+
Type21.prototype.encode = function encode_setup(message, writer) {
|
|
62996
62996
|
return this.setup().encode(message, writer);
|
|
62997
62997
|
};
|
|
62998
|
-
|
|
62998
|
+
Type21.prototype.encodeDelimited = function encodeDelimited(message, writer) {
|
|
62999
62999
|
return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
|
|
63000
63000
|
};
|
|
63001
|
-
|
|
63001
|
+
Type21.prototype.decode = function decode_setup(reader, length) {
|
|
63002
63002
|
return this.setup().decode(reader, length);
|
|
63003
63003
|
};
|
|
63004
|
-
|
|
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
|
-
|
|
63009
|
+
Type21.prototype.verify = function verify_setup(message) {
|
|
63010
63010
|
return this.setup().verify(message);
|
|
63011
63011
|
};
|
|
63012
|
-
|
|
63012
|
+
Type21.prototype.fromObject = function fromObject(object) {
|
|
63013
63013
|
return this.setup().fromObject(object);
|
|
63014
63014
|
};
|
|
63015
|
-
|
|
63015
|
+
Type21.prototype.toObject = function toObject(message, options) {
|
|
63016
63016
|
return this.setup().toObject(message, options);
|
|
63017
63017
|
};
|
|
63018
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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 (!
|
|
63337
|
-
|
|
63338
|
-
var type = new
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
-
|
|
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
|
|
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(
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
99260
|
+
var homedir9 = getHomedir();
|
|
99261
99261
|
var defaultPaths = function() {
|
|
99262
99262
|
return [
|
|
99263
|
-
path35.join(
|
|
99264
|
-
path35.join(
|
|
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
|
|
99750
|
+
var homedir9 = getHomedir();
|
|
99751
99751
|
var defaultPaths = function() {
|
|
99752
99752
|
return [
|
|
99753
|
-
path35.join(
|
|
99754
|
-
path35.join(
|
|
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(
|
|
99792
|
-
var body =
|
|
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
|
|
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(
|
|
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(
|
|
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";
|
|
@@ -140581,7 +140584,7 @@ var SchemaValidator = class {
|
|
|
140581
140584
|
import path4 from "node:path";
|
|
140582
140585
|
import os3 from "os";
|
|
140583
140586
|
import * as crypto8 from "crypto";
|
|
140584
|
-
var
|
|
140587
|
+
var MPDAI_DIR2 = ".mpdai";
|
|
140585
140588
|
var TMP_DIR_NAME = "tmp";
|
|
140586
140589
|
function shortenPath(filePath, maxLen = 35) {
|
|
140587
140590
|
if (filePath.length <= maxLen) {
|
|
@@ -140637,7 +140640,7 @@ function getProjectHash(projectRoot) {
|
|
|
140637
140640
|
}
|
|
140638
140641
|
function getProjectTempDir(projectRoot) {
|
|
140639
140642
|
const hash = getProjectHash(projectRoot);
|
|
140640
|
-
return path4.join(os3.homedir(),
|
|
140643
|
+
return path4.join(os3.homedir(), MPDAI_DIR2, TMP_DIR_NAME, hash);
|
|
140641
140644
|
}
|
|
140642
140645
|
|
|
140643
140646
|
// packages/core/dist/src/tools/ls.js
|
|
@@ -141248,7 +141251,7 @@ var ReadFileTool = class _ReadFileTool extends BaseTool {
|
|
|
141248
141251
|
const fileService = this.config.getFileService();
|
|
141249
141252
|
if (fileService.shouldGeminiIgnoreFile(params.absolute_path)) {
|
|
141250
141253
|
const relativePath = makeRelative(params.absolute_path, this.rootDirectory);
|
|
141251
|
-
return `File path '${shortenPath(relativePath)}' is ignored by .
|
|
141254
|
+
return `File path '${shortenPath(relativePath)}' is ignored by .mpdaiignore pattern(s).`;
|
|
141252
141255
|
}
|
|
141253
141256
|
return null;
|
|
141254
141257
|
}
|
|
@@ -149350,7 +149353,7 @@ Do NOT use this tool:
|
|
|
149350
149353
|
|
|
149351
149354
|
- \`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
149355
|
`;
|
|
149353
|
-
var
|
|
149356
|
+
var MPDAI_CONFIG_DIR = ".mpdai";
|
|
149354
149357
|
var DEFAULT_CONTEXT_FILENAME = "MEMORY.md";
|
|
149355
149358
|
var MEMORY_SECTION_HEADER = "## Memory Added Memories";
|
|
149356
149359
|
var currentGeminiMdFilename = DEFAULT_CONTEXT_FILENAME;
|
|
@@ -149376,7 +149379,7 @@ function getAllGeminiMdFilenames() {
|
|
|
149376
149379
|
return [currentGeminiMdFilename];
|
|
149377
149380
|
}
|
|
149378
149381
|
function getGlobalMemoryFilePath() {
|
|
149379
|
-
return path13.join(homedir2(),
|
|
149382
|
+
return path13.join(homedir2(), MPDAI_CONFIG_DIR, getCurrentGeminiMdFilename());
|
|
149380
149383
|
}
|
|
149381
149384
|
function ensureNewlineSeparation(currentContent) {
|
|
149382
149385
|
if (currentContent.length === 0)
|
|
@@ -149596,7 +149599,7 @@ Use this tool when the user's query implies needing the content of several files
|
|
|
149596
149599
|
if (this.geminiIgnorePatterns.length > 0) {
|
|
149597
149600
|
const geminiPatternsInEffect = this.geminiIgnorePatterns.filter((p) => finalExclusionPatternsForDescription.includes(p)).length;
|
|
149598
149601
|
if (geminiPatternsInEffect > 0) {
|
|
149599
|
-
excludeDesc += ` (includes ${geminiPatternsInEffect} from .
|
|
149602
|
+
excludeDesc += ` (includes ${geminiPatternsInEffect} from .mpdaiignore)`;
|
|
149600
149603
|
}
|
|
149601
149604
|
}
|
|
149602
149605
|
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 +151714,8 @@ function many(p) {
|
|
|
151711
151714
|
function many1(p) {
|
|
151712
151715
|
return ab(p, many(p), (head, tail) => [head, ...tail]);
|
|
151713
151716
|
}
|
|
151714
|
-
function ab(pa, pb,
|
|
151715
|
-
return (data, i) => mapOuter(pa(data, i), (ma) => mapInner(pb(data, ma.position), (vb, j) =>
|
|
151717
|
+
function ab(pa, pb, join15) {
|
|
151718
|
+
return (data, i) => mapOuter(pa(data, i), (ma) => mapInner(pb(data, ma.position), (vb, j) => join15(ma.value, vb, data, i, j)));
|
|
151716
151719
|
}
|
|
151717
151720
|
function left2(pa, pb) {
|
|
151718
151721
|
return ab(pa, pb, (va) => va);
|
|
@@ -151720,8 +151723,8 @@ function left2(pa, pb) {
|
|
|
151720
151723
|
function right2(pa, pb) {
|
|
151721
151724
|
return ab(pa, pb, (va, vb) => vb);
|
|
151722
151725
|
}
|
|
151723
|
-
function abc(pa, pb, pc,
|
|
151724
|
-
return (data, i) => mapOuter(pa(data, i), (ma) => mapOuter(pb(data, ma.position), (mb) => mapInner(pc(data, mb.position), (vc, j) =>
|
|
151726
|
+
function abc(pa, pb, pc, join15) {
|
|
151727
|
+
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
151728
|
}
|
|
151726
151729
|
function middle(pa, pb, pc) {
|
|
151727
151730
|
return abc(pa, pb, pc, (ra, rb) => rb);
|
|
@@ -156384,6 +156387,951 @@ ${modifiedResponseText}`,
|
|
|
156384
156387
|
}
|
|
156385
156388
|
};
|
|
156386
156389
|
|
|
156390
|
+
// packages/core/dist/src/tools/confluence-get-page.js
|
|
156391
|
+
init_errors();
|
|
156392
|
+
import { Type as Type15 } from "@google/genai";
|
|
156393
|
+
var CONFLUENCE_FETCH_TIMEOUT_MS = 3e4;
|
|
156394
|
+
var CONFLUENCE_URL = "https://confluence.rakuten-it.com/confluence";
|
|
156395
|
+
var ConfluenceGetPageTool = class _ConfluenceGetPageTool extends BaseTool {
|
|
156396
|
+
config;
|
|
156397
|
+
static Name = "confluence_get_page";
|
|
156398
|
+
constructor(config2) {
|
|
156399
|
+
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.", {
|
|
156400
|
+
properties: {
|
|
156401
|
+
page_id: {
|
|
156402
|
+
description: "The ID of the Confluence page to retrieve",
|
|
156403
|
+
type: Type15.STRING
|
|
156404
|
+
},
|
|
156405
|
+
convert_to_markdown: {
|
|
156406
|
+
description: "Whether to convert HTML content to markdown format (default: true)",
|
|
156407
|
+
type: Type15.STRING
|
|
156408
|
+
}
|
|
156409
|
+
},
|
|
156410
|
+
required: ["page_id"],
|
|
156411
|
+
type: Type15.OBJECT
|
|
156412
|
+
});
|
|
156413
|
+
this.config = config2;
|
|
156414
|
+
}
|
|
156415
|
+
validateParams(params) {
|
|
156416
|
+
const errors = SchemaValidator.validate(this.schema.parameters, params);
|
|
156417
|
+
if (errors) {
|
|
156418
|
+
return errors;
|
|
156419
|
+
}
|
|
156420
|
+
if (!params.page_id || params.page_id.trim() === "") {
|
|
156421
|
+
return "The 'page_id' parameter cannot be empty.";
|
|
156422
|
+
}
|
|
156423
|
+
return null;
|
|
156424
|
+
}
|
|
156425
|
+
getDescription(params) {
|
|
156426
|
+
return `Retrieving Confluence page ${params.page_id} from ${CONFLUENCE_URL}`;
|
|
156427
|
+
}
|
|
156428
|
+
/**
|
|
156429
|
+
* Process HTML content to handle user mentions and page links
|
|
156430
|
+
*/
|
|
156431
|
+
processHtmlContent(html, spaceKey, baseUrl) {
|
|
156432
|
+
let processed = html;
|
|
156433
|
+
processed = processed.replace(/<ac:link>[\s\S]*?<ri:user[^>]+ri:username="([^"]+)"\s*\/>[\s\S]*?<\/ac:link>/g, "@$1");
|
|
156434
|
+
processed = processed.replace(/<ac:link[^>]*>[\s\S]*?<ri:page[^>]+ri:content-title="([^"]*)"\s*ri:space-key="([^"]*)"\s*\/>[\s\S]*?<\/ac:link>/g, (match2, title) => {
|
|
156435
|
+
return title || "Page Link";
|
|
156436
|
+
});
|
|
156437
|
+
processed = processed.replace(/<\/?(span|div|p)[^>]*>/g, "\n");
|
|
156438
|
+
processed = processed.replace(/<strong>([^<]*)<\/strong>/g, "**$1**");
|
|
156439
|
+
processed = processed.replace(/<b>([^<]*)<\/b>/g, "**$1**");
|
|
156440
|
+
processed = processed.replace(/<em>([^<]*)<\/em>/g, "*$1*");
|
|
156441
|
+
processed = processed.replace(/<i>([^<]*)<\/i>/g, "*$1*");
|
|
156442
|
+
for (let i = 1; i <= 6; i++) {
|
|
156443
|
+
const tag = `h${i}`;
|
|
156444
|
+
const prefix = "#".repeat(i);
|
|
156445
|
+
processed = processed.replace(new RegExp(`<${tag}>([^<]*)</${tag}>`, "g"), `${prefix} $1`);
|
|
156446
|
+
}
|
|
156447
|
+
processed = processed.replace(/<li>([^<]*)<\/li>/g, "- $1\n");
|
|
156448
|
+
processed = processed.replace(/<ul[^>]*>/g, "\n");
|
|
156449
|
+
processed = processed.replace(/<\/ul>/g, "\n");
|
|
156450
|
+
processed = processed.replace(/<ol[^>]*>/g, "\n");
|
|
156451
|
+
processed = processed.replace(/<\/ol>/g, "\n");
|
|
156452
|
+
processed = processed.replace(/<a[^>]+href="([^"]*)"[^>]*>([^<]*)<\/a>/g, "[$2]($1)");
|
|
156453
|
+
processed = processed.replace(/<[^>]+>/g, "");
|
|
156454
|
+
processed = processed.replace(/\n{3,}/g, "\n\n");
|
|
156455
|
+
return processed.trim();
|
|
156456
|
+
}
|
|
156457
|
+
async execute(params, signal) {
|
|
156458
|
+
const validationError = this.validateParams(params);
|
|
156459
|
+
if (validationError) {
|
|
156460
|
+
return {
|
|
156461
|
+
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
|
156462
|
+
returnDisplay: validationError
|
|
156463
|
+
};
|
|
156464
|
+
}
|
|
156465
|
+
const { page_id, convert_to_markdown = true } = params;
|
|
156466
|
+
const personal_access_token = this.config.getConfluenceToken();
|
|
156467
|
+
if (!personal_access_token) {
|
|
156468
|
+
return {
|
|
156469
|
+
llmContent: "Error: Confluence Personal Access Token not found in keys.json. Please configure it first.",
|
|
156470
|
+
returnDisplay: "Confluence token not configured"
|
|
156471
|
+
};
|
|
156472
|
+
}
|
|
156473
|
+
try {
|
|
156474
|
+
const isCloud = CONFLUENCE_URL.includes(".atlassian.net");
|
|
156475
|
+
const apiUrl = `${CONFLUENCE_URL.replace(/\/$/, "")}/rest/api/content/${page_id}`;
|
|
156476
|
+
const paramsObj = new URLSearchParams({
|
|
156477
|
+
expand: "body.storage,version,space,children.attachment,ancestors"
|
|
156478
|
+
});
|
|
156479
|
+
const fullUrl = `${apiUrl}?${paramsObj.toString()}`;
|
|
156480
|
+
const headers = {
|
|
156481
|
+
"Accept": "application/json",
|
|
156482
|
+
"Content-Type": "application/json",
|
|
156483
|
+
"Authorization": `Bearer ${personal_access_token}`
|
|
156484
|
+
};
|
|
156485
|
+
const controller = new AbortController();
|
|
156486
|
+
const timeoutId = setTimeout(() => controller.abort(), CONFLUENCE_FETCH_TIMEOUT_MS);
|
|
156487
|
+
let response;
|
|
156488
|
+
try {
|
|
156489
|
+
response = await fetch(fullUrl, {
|
|
156490
|
+
method: "GET",
|
|
156491
|
+
headers,
|
|
156492
|
+
signal: signal || controller.signal
|
|
156493
|
+
});
|
|
156494
|
+
} finally {
|
|
156495
|
+
clearTimeout(timeoutId);
|
|
156496
|
+
}
|
|
156497
|
+
if (response.status === 401) {
|
|
156498
|
+
return {
|
|
156499
|
+
llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
|
|
156500
|
+
returnDisplay: "Authentication failed (401)"
|
|
156501
|
+
};
|
|
156502
|
+
}
|
|
156503
|
+
if (response.status === 403) {
|
|
156504
|
+
return {
|
|
156505
|
+
llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
|
|
156506
|
+
returnDisplay: "Access denied (403)"
|
|
156507
|
+
};
|
|
156508
|
+
}
|
|
156509
|
+
if (response.status === 404) {
|
|
156510
|
+
return {
|
|
156511
|
+
llmContent: `Error: Page not found (404). Page ID ${page_id} may not exist.`,
|
|
156512
|
+
returnDisplay: `Page not found (404): ${page_id}`
|
|
156513
|
+
};
|
|
156514
|
+
}
|
|
156515
|
+
if (!response.ok) {
|
|
156516
|
+
const errorText = await response.text().catch(() => "Unknown error");
|
|
156517
|
+
return {
|
|
156518
|
+
llmContent: `Error: API call failed with status ${response.status}: ${errorText}`,
|
|
156519
|
+
returnDisplay: `API error (${response.status})`
|
|
156520
|
+
};
|
|
156521
|
+
}
|
|
156522
|
+
const pageData = await response.json();
|
|
156523
|
+
const content = pageData.body.storage.value;
|
|
156524
|
+
const spaceKey = pageData.space.key;
|
|
156525
|
+
const title = pageData.title;
|
|
156526
|
+
const version2 = pageData.version.number;
|
|
156527
|
+
const created = pageData.created;
|
|
156528
|
+
const updated = pageData.updated;
|
|
156529
|
+
let pageUrl;
|
|
156530
|
+
if (isCloud) {
|
|
156531
|
+
pageUrl = `${CONFLUENCE_URL}/spaces/${spaceKey}/pages/${pageData.id}`;
|
|
156532
|
+
} else {
|
|
156533
|
+
pageUrl = `${CONFLUENCE_URL}/pages/viewpage.action?pageId=${pageData.id}`;
|
|
156534
|
+
}
|
|
156535
|
+
let processedContent;
|
|
156536
|
+
let contentFormat;
|
|
156537
|
+
if (convert_to_markdown) {
|
|
156538
|
+
processedContent = this.processHtmlContent(content, spaceKey, CONFLUENCE_URL);
|
|
156539
|
+
contentFormat = "markdown";
|
|
156540
|
+
} else {
|
|
156541
|
+
processedContent = content;
|
|
156542
|
+
contentFormat = "storage";
|
|
156543
|
+
}
|
|
156544
|
+
const result = {
|
|
156545
|
+
id: pageData.id,
|
|
156546
|
+
title,
|
|
156547
|
+
type: pageData.type,
|
|
156548
|
+
status: pageData.status,
|
|
156549
|
+
created,
|
|
156550
|
+
updated,
|
|
156551
|
+
url: pageUrl,
|
|
156552
|
+
space: {
|
|
156553
|
+
key: spaceKey,
|
|
156554
|
+
name: pageData.space.name
|
|
156555
|
+
},
|
|
156556
|
+
version: version2,
|
|
156557
|
+
attachments: pageData.children?.attachment?.results || [],
|
|
156558
|
+
ancestors: pageData.ancestors || [],
|
|
156559
|
+
content: {
|
|
156560
|
+
value: processedContent,
|
|
156561
|
+
format: contentFormat
|
|
156562
|
+
}
|
|
156563
|
+
};
|
|
156564
|
+
const resultText = `# ${title}
|
|
156565
|
+
|
|
156566
|
+
**Page ID:** ${pageData.id}
|
|
156567
|
+
**Space:** ${spaceKey}
|
|
156568
|
+
**Version:** ${version2}
|
|
156569
|
+
**Created:** ${created}
|
|
156570
|
+
**Updated:** ${updated}
|
|
156571
|
+
**URL:** ${pageUrl}
|
|
156572
|
+
|
|
156573
|
+
---
|
|
156574
|
+
|
|
156575
|
+
${processedContent}
|
|
156576
|
+
`;
|
|
156577
|
+
return {
|
|
156578
|
+
llmContent: resultText,
|
|
156579
|
+
returnDisplay: `Retrieved Confluence page: ${title}`
|
|
156580
|
+
};
|
|
156581
|
+
} catch (error) {
|
|
156582
|
+
const errorMessage = `Error retrieving Confluence page ${page_id}: ${getErrorMessage(error)}`;
|
|
156583
|
+
console.error(errorMessage, error);
|
|
156584
|
+
return {
|
|
156585
|
+
llmContent: `Error: ${errorMessage}`,
|
|
156586
|
+
returnDisplay: `Error: ${errorMessage}`
|
|
156587
|
+
};
|
|
156588
|
+
}
|
|
156589
|
+
}
|
|
156590
|
+
};
|
|
156591
|
+
|
|
156592
|
+
// packages/core/dist/src/tools/jira-get-issue.js
|
|
156593
|
+
init_errors();
|
|
156594
|
+
import { Type as Type16 } from "@google/genai";
|
|
156595
|
+
var JIRA_FETCH_TIMEOUT_MS = 3e4;
|
|
156596
|
+
var JIRA_URL = "https://jira.rakuten-it.com/jira";
|
|
156597
|
+
var JiraGetIssueTool = class _JiraGetIssueTool extends BaseTool {
|
|
156598
|
+
config;
|
|
156599
|
+
static Name = "jira_get_issue";
|
|
156600
|
+
constructor(config2) {
|
|
156601
|
+
super(_JiraGetIssueTool.Name, "JiraGetIssue", "Retrieves content from a Jira issue by its key. Uses Personal Access Token from keys.json for authentication.", {
|
|
156602
|
+
properties: {
|
|
156603
|
+
issue_key: {
|
|
156604
|
+
description: "The Jira issue key to retrieve (e.g., PROJECT-123)",
|
|
156605
|
+
type: Type16.STRING
|
|
156606
|
+
},
|
|
156607
|
+
expand: {
|
|
156608
|
+
description: 'Fields to expand in the response (e.g., "renderedFields,changelog")',
|
|
156609
|
+
type: Type16.STRING
|
|
156610
|
+
},
|
|
156611
|
+
comment_limit: {
|
|
156612
|
+
description: 'Maximum number of comments to include (default: 10, use "all" for all comments)',
|
|
156613
|
+
type: Type16.STRING
|
|
156614
|
+
}
|
|
156615
|
+
},
|
|
156616
|
+
required: ["issue_key"],
|
|
156617
|
+
type: Type16.OBJECT
|
|
156618
|
+
});
|
|
156619
|
+
this.config = config2;
|
|
156620
|
+
}
|
|
156621
|
+
validateParams(params) {
|
|
156622
|
+
const errors = SchemaValidator.validate(this.schema.parameters, params);
|
|
156623
|
+
if (errors) {
|
|
156624
|
+
return errors;
|
|
156625
|
+
}
|
|
156626
|
+
if (!params.issue_key || params.issue_key.trim() === "") {
|
|
156627
|
+
return "The 'issue_key' parameter cannot be empty.";
|
|
156628
|
+
}
|
|
156629
|
+
const issueKeyPattern = /^[A-Z]+-\d+$/;
|
|
156630
|
+
if (!issueKeyPattern.test(params.issue_key.trim())) {
|
|
156631
|
+
return "The 'issue_key' must be in format PROJECT-123 (e.g., PROJ-456)";
|
|
156632
|
+
}
|
|
156633
|
+
return null;
|
|
156634
|
+
}
|
|
156635
|
+
getDescription(params) {
|
|
156636
|
+
return `Retrieving Jira issue ${params.issue_key} from ${JIRA_URL}`;
|
|
156637
|
+
}
|
|
156638
|
+
/**
|
|
156639
|
+
* Normalize comment limit to a number
|
|
156640
|
+
*/
|
|
156641
|
+
normalizeCommentLimit(commentLimit) {
|
|
156642
|
+
if (commentLimit === void 0) {
|
|
156643
|
+
return 10;
|
|
156644
|
+
}
|
|
156645
|
+
if (typeof commentLimit === "number") {
|
|
156646
|
+
return commentLimit;
|
|
156647
|
+
}
|
|
156648
|
+
if (commentLimit === "all" || commentLimit === "") {
|
|
156649
|
+
return null;
|
|
156650
|
+
}
|
|
156651
|
+
try {
|
|
156652
|
+
return parseInt(commentLimit, 10);
|
|
156653
|
+
} catch {
|
|
156654
|
+
return 10;
|
|
156655
|
+
}
|
|
156656
|
+
}
|
|
156657
|
+
/**
|
|
156658
|
+
* Convert Jira formatted text to plain text
|
|
156659
|
+
*/
|
|
156660
|
+
convertJiraTextToPlainText(content) {
|
|
156661
|
+
if (typeof content === "string") {
|
|
156662
|
+
return content;
|
|
156663
|
+
}
|
|
156664
|
+
if (typeof content === "object" && content !== null) {
|
|
156665
|
+
const obj = content;
|
|
156666
|
+
if (Array.isArray(obj.content)) {
|
|
156667
|
+
return this.extractTextFromContent(obj.content);
|
|
156668
|
+
}
|
|
156669
|
+
}
|
|
156670
|
+
return "";
|
|
156671
|
+
}
|
|
156672
|
+
/**
|
|
156673
|
+
* Extract text from Jira content structure
|
|
156674
|
+
*/
|
|
156675
|
+
extractTextFromContent(content) {
|
|
156676
|
+
let text = "";
|
|
156677
|
+
for (const item of content) {
|
|
156678
|
+
if (typeof item === "object" && item !== null) {
|
|
156679
|
+
const obj = item;
|
|
156680
|
+
if (obj.text) {
|
|
156681
|
+
text += obj.text;
|
|
156682
|
+
}
|
|
156683
|
+
if (obj.content && Array.isArray(obj.content)) {
|
|
156684
|
+
text += this.extractTextFromContent(obj.content);
|
|
156685
|
+
}
|
|
156686
|
+
}
|
|
156687
|
+
}
|
|
156688
|
+
return text;
|
|
156689
|
+
}
|
|
156690
|
+
/**
|
|
156691
|
+
* Format date string
|
|
156692
|
+
*/
|
|
156693
|
+
formatDate(dateStr) {
|
|
156694
|
+
if (!dateStr) {
|
|
156695
|
+
return "";
|
|
156696
|
+
}
|
|
156697
|
+
try {
|
|
156698
|
+
const date = new Date(dateStr);
|
|
156699
|
+
return date.toLocaleString();
|
|
156700
|
+
} catch {
|
|
156701
|
+
return dateStr;
|
|
156702
|
+
}
|
|
156703
|
+
}
|
|
156704
|
+
async execute(params, signal) {
|
|
156705
|
+
const validationError = this.validateParams(params);
|
|
156706
|
+
if (validationError) {
|
|
156707
|
+
return {
|
|
156708
|
+
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
|
156709
|
+
returnDisplay: validationError
|
|
156710
|
+
};
|
|
156711
|
+
}
|
|
156712
|
+
const { issue_key, expand: expand2, comment_limit } = params;
|
|
156713
|
+
const personal_access_token = this.config.getJiraToken();
|
|
156714
|
+
if (!personal_access_token) {
|
|
156715
|
+
return {
|
|
156716
|
+
llmContent: "Error: Jira Personal Access Token not found in keys.json. Please configure it first.",
|
|
156717
|
+
returnDisplay: "Jira token not configured"
|
|
156718
|
+
};
|
|
156719
|
+
}
|
|
156720
|
+
try {
|
|
156721
|
+
const apiUrl = `${JIRA_URL}/rest/api/2/issue/${issue_key}`;
|
|
156722
|
+
const queryParams = new URLSearchParams();
|
|
156723
|
+
const expandParams = expand2 ? expand2.split(",").map((s2) => s2.trim()) : [];
|
|
156724
|
+
if (!expandParams.includes("renderedFields")) {
|
|
156725
|
+
expandParams.push("renderedFields");
|
|
156726
|
+
}
|
|
156727
|
+
if (expandParams.length > 0) {
|
|
156728
|
+
queryParams.set("expand", expandParams.join(","));
|
|
156729
|
+
}
|
|
156730
|
+
const fullUrl = `${apiUrl}?${queryParams.toString()}`;
|
|
156731
|
+
const headers = {
|
|
156732
|
+
"Accept": "application/json",
|
|
156733
|
+
"Content-Type": "application/json",
|
|
156734
|
+
"Authorization": `Bearer ${personal_access_token}`
|
|
156735
|
+
};
|
|
156736
|
+
console.log("Jira API request:", {
|
|
156737
|
+
url: fullUrl,
|
|
156738
|
+
authMethod: "Bearer",
|
|
156739
|
+
tokenLength: personal_access_token.length,
|
|
156740
|
+
headers: { ...headers, Authorization: "Bearer ***" }
|
|
156741
|
+
});
|
|
156742
|
+
const controller = new AbortController();
|
|
156743
|
+
const timeoutId = setTimeout(() => controller.abort(), JIRA_FETCH_TIMEOUT_MS);
|
|
156744
|
+
let response;
|
|
156745
|
+
try {
|
|
156746
|
+
response = await fetch(fullUrl, {
|
|
156747
|
+
method: "GET",
|
|
156748
|
+
headers,
|
|
156749
|
+
signal: signal || controller.signal
|
|
156750
|
+
});
|
|
156751
|
+
} finally {
|
|
156752
|
+
clearTimeout(timeoutId);
|
|
156753
|
+
}
|
|
156754
|
+
if (response.status === 401) {
|
|
156755
|
+
return {
|
|
156756
|
+
llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
|
|
156757
|
+
returnDisplay: "Authentication failed (401)"
|
|
156758
|
+
};
|
|
156759
|
+
}
|
|
156760
|
+
if (response.status === 403) {
|
|
156761
|
+
return {
|
|
156762
|
+
llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
|
|
156763
|
+
returnDisplay: "Access denied (403)"
|
|
156764
|
+
};
|
|
156765
|
+
}
|
|
156766
|
+
if (response.status === 404) {
|
|
156767
|
+
return {
|
|
156768
|
+
llmContent: `Error: Issue not found (404). Issue key ${issue_key} may not exist.`,
|
|
156769
|
+
returnDisplay: `Issue not found (404): ${issue_key}`
|
|
156770
|
+
};
|
|
156771
|
+
}
|
|
156772
|
+
if (!response.ok) {
|
|
156773
|
+
const errorText = await response.text().catch(() => "Unknown error");
|
|
156774
|
+
console.error(`Jira API error (${response.status}):`, errorText.substring(0, 500));
|
|
156775
|
+
return {
|
|
156776
|
+
llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
|
|
156777
|
+
returnDisplay: `API error (${response.status})`
|
|
156778
|
+
};
|
|
156779
|
+
}
|
|
156780
|
+
const contentType = response.headers.get("content-type") || "";
|
|
156781
|
+
if (!contentType.includes("application/json")) {
|
|
156782
|
+
const responseText = await response.text();
|
|
156783
|
+
console.error("Jira API returned non-JSON response:", responseText.substring(0, 500));
|
|
156784
|
+
return {
|
|
156785
|
+
llmContent: "Error: Jira API returned non-JSON response. This usually means authentication failed. Please check your Personal Access Token in keys.json.",
|
|
156786
|
+
returnDisplay: "Authentication failed - invalid response format"
|
|
156787
|
+
};
|
|
156788
|
+
}
|
|
156789
|
+
const issueData = await response.json();
|
|
156790
|
+
const fields = issueData.fields || {};
|
|
156791
|
+
const summary = fields.summary || "";
|
|
156792
|
+
const status = fields.status?.name || "Unknown";
|
|
156793
|
+
const issueType = fields.issuetype?.name || "Unknown";
|
|
156794
|
+
const created = this.formatDate(fields.created);
|
|
156795
|
+
const updated = this.formatDate(fields.updated);
|
|
156796
|
+
const assignee = fields.assignee?.displayName || fields.assignee?.name || "Unassigned";
|
|
156797
|
+
const reporter = fields.reporter?.displayName || fields.reporter?.name || "Unknown";
|
|
156798
|
+
const description = this.convertJiraTextToPlainText(fields.description);
|
|
156799
|
+
const comments = fields.comment?.comments || [];
|
|
156800
|
+
const normalizedCommentLimit = this.normalizeCommentLimit(comment_limit);
|
|
156801
|
+
const limitedComments = normalizedCommentLimit !== null ? comments.slice(0, normalizedCommentLimit) : comments;
|
|
156802
|
+
const issueUrl = `${JIRA_URL}/browse/${issue_key}`;
|
|
156803
|
+
let resultText = `# ${issue_key}: ${summary}
|
|
156804
|
+
|
|
156805
|
+
`;
|
|
156806
|
+
resultText += `**Type**: ${issueType}
|
|
156807
|
+
`;
|
|
156808
|
+
resultText += `**Status**: ${status}
|
|
156809
|
+
`;
|
|
156810
|
+
resultText += `**Reporter**: ${reporter}
|
|
156811
|
+
`;
|
|
156812
|
+
resultText += `**Assignee**: ${assignee}
|
|
156813
|
+
`;
|
|
156814
|
+
resultText += `**Created**: ${created}
|
|
156815
|
+
`;
|
|
156816
|
+
resultText += `**Updated**: ${updated}
|
|
156817
|
+
`;
|
|
156818
|
+
resultText += `**URL**: ${issueUrl}
|
|
156819
|
+
|
|
156820
|
+
`;
|
|
156821
|
+
if (description) {
|
|
156822
|
+
resultText += `## Description
|
|
156823
|
+
|
|
156824
|
+
${description}
|
|
156825
|
+
|
|
156826
|
+
`;
|
|
156827
|
+
}
|
|
156828
|
+
if (limitedComments.length > 0) {
|
|
156829
|
+
resultText += `## Comments (${limitedComments.length}${normalizedCommentLimit !== null ? ` of ${comments.length}` : ""})
|
|
156830
|
+
|
|
156831
|
+
`;
|
|
156832
|
+
for (const comment of limitedComments) {
|
|
156833
|
+
const commentAuthor = comment.author?.displayName || comment.author?.name || "Unknown";
|
|
156834
|
+
const commentBody = this.convertJiraTextToPlainText(comment.body);
|
|
156835
|
+
const commentCreated = this.formatDate(comment.created);
|
|
156836
|
+
if (commentBody) {
|
|
156837
|
+
resultText += `**${commentAuthor}** (${commentCreated}):
|
|
156838
|
+
${commentBody}
|
|
156839
|
+
|
|
156840
|
+
`;
|
|
156841
|
+
}
|
|
156842
|
+
}
|
|
156843
|
+
}
|
|
156844
|
+
return {
|
|
156845
|
+
llmContent: resultText,
|
|
156846
|
+
returnDisplay: `Retrieved Jira issue: ${issue_key}`
|
|
156847
|
+
};
|
|
156848
|
+
} catch (error) {
|
|
156849
|
+
const errorMessage = `Error retrieving Jira issue ${issue_key}: ${getErrorMessage(error)}`;
|
|
156850
|
+
console.error(errorMessage, error);
|
|
156851
|
+
return {
|
|
156852
|
+
llmContent: `Error: ${errorMessage}`,
|
|
156853
|
+
returnDisplay: `Error: ${errorMessage}`
|
|
156854
|
+
};
|
|
156855
|
+
}
|
|
156856
|
+
}
|
|
156857
|
+
};
|
|
156858
|
+
|
|
156859
|
+
// packages/core/dist/src/tools/bitbucket-get-pr-diff.js
|
|
156860
|
+
init_errors();
|
|
156861
|
+
import { Type as Type17 } from "@google/genai";
|
|
156862
|
+
var BITBUCKET_FETCH_TIMEOUT_MS = 3e4;
|
|
156863
|
+
var BITBUCKET_URL = "https://git.rakuten-it.com";
|
|
156864
|
+
var BitbucketGetPrDiffTool = class _BitbucketGetPrDiffTool extends BaseTool {
|
|
156865
|
+
config;
|
|
156866
|
+
static Name = "bitbucket_get_pr_diff";
|
|
156867
|
+
constructor(config2) {
|
|
156868
|
+
super(_BitbucketGetPrDiffTool.Name, "BitbucketGetPrDiff", "Retrieves the diff content for a specified Bitbucket Pull Request. Uses Personal Access Token from keys.json for authentication.", {
|
|
156869
|
+
properties: {
|
|
156870
|
+
project_key: {
|
|
156871
|
+
description: "The unique identifier for the Bitbucket project that owns the PR",
|
|
156872
|
+
type: Type17.STRING
|
|
156873
|
+
},
|
|
156874
|
+
repo_slug: {
|
|
156875
|
+
description: "The repository slug name that owns the PR",
|
|
156876
|
+
type: Type17.STRING
|
|
156877
|
+
},
|
|
156878
|
+
pr_id: {
|
|
156879
|
+
description: "The Pull Request unique identifier",
|
|
156880
|
+
type: Type17.NUMBER
|
|
156881
|
+
}
|
|
156882
|
+
},
|
|
156883
|
+
required: ["project_key", "repo_slug", "pr_id"],
|
|
156884
|
+
type: Type17.OBJECT
|
|
156885
|
+
});
|
|
156886
|
+
this.config = config2;
|
|
156887
|
+
}
|
|
156888
|
+
validateParams(params) {
|
|
156889
|
+
const errors = SchemaValidator.validate(this.schema.parameters, params);
|
|
156890
|
+
if (errors) {
|
|
156891
|
+
return errors;
|
|
156892
|
+
}
|
|
156893
|
+
if (!params.project_key || params.project_key.trim() === "") {
|
|
156894
|
+
return "The 'project_key' parameter cannot be empty.";
|
|
156895
|
+
}
|
|
156896
|
+
if (!params.repo_slug || params.repo_slug.trim() === "") {
|
|
156897
|
+
return "The 'repo_slug' parameter cannot be empty.";
|
|
156898
|
+
}
|
|
156899
|
+
if (params.pr_id <= 0) {
|
|
156900
|
+
return "The 'pr_id' must be a positive number.";
|
|
156901
|
+
}
|
|
156902
|
+
return null;
|
|
156903
|
+
}
|
|
156904
|
+
getDescription(params) {
|
|
156905
|
+
return `Retrieving diff for Bitbucket PR #${params.pr_id} in ${params.project_key}/${params.repo_slug}`;
|
|
156906
|
+
}
|
|
156907
|
+
async execute(params, signal) {
|
|
156908
|
+
const validationError = this.validateParams(params);
|
|
156909
|
+
if (validationError) {
|
|
156910
|
+
return {
|
|
156911
|
+
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
|
156912
|
+
returnDisplay: validationError
|
|
156913
|
+
};
|
|
156914
|
+
}
|
|
156915
|
+
const { project_key, repo_slug, pr_id } = params;
|
|
156916
|
+
const personal_access_token = this.config.getBitbucketToken();
|
|
156917
|
+
if (!personal_access_token) {
|
|
156918
|
+
return {
|
|
156919
|
+
llmContent: "Error: Bitbucket Personal Access Token not found in keys.json. Please configure it first.",
|
|
156920
|
+
returnDisplay: "Bitbucket token not configured"
|
|
156921
|
+
};
|
|
156922
|
+
}
|
|
156923
|
+
try {
|
|
156924
|
+
const apiUrl = `${BITBUCKET_URL}/rest/api/1.0/projects/${project_key}/repos/${repo_slug}/pull-requests/${pr_id}/diff`;
|
|
156925
|
+
const headers = {
|
|
156926
|
+
"Authorization": `Bearer ${personal_access_token}`,
|
|
156927
|
+
"Accept": "text/plain"
|
|
156928
|
+
};
|
|
156929
|
+
console.log("Bitbucket API request:", {
|
|
156930
|
+
url: apiUrl,
|
|
156931
|
+
authMethod: "Bearer",
|
|
156932
|
+
tokenLength: personal_access_token.length,
|
|
156933
|
+
headers: { ...headers, Authorization: "Bearer ***" }
|
|
156934
|
+
});
|
|
156935
|
+
const controller = new AbortController();
|
|
156936
|
+
const timeoutId = setTimeout(() => controller.abort(), BITBUCKET_FETCH_TIMEOUT_MS);
|
|
156937
|
+
let response;
|
|
156938
|
+
try {
|
|
156939
|
+
response = await fetch(apiUrl, {
|
|
156940
|
+
method: "GET",
|
|
156941
|
+
headers,
|
|
156942
|
+
signal: signal || controller.signal
|
|
156943
|
+
});
|
|
156944
|
+
} finally {
|
|
156945
|
+
clearTimeout(timeoutId);
|
|
156946
|
+
}
|
|
156947
|
+
if (response.status === 401) {
|
|
156948
|
+
return {
|
|
156949
|
+
llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
|
|
156950
|
+
returnDisplay: "Authentication failed (401)"
|
|
156951
|
+
};
|
|
156952
|
+
}
|
|
156953
|
+
if (response.status === 403) {
|
|
156954
|
+
return {
|
|
156955
|
+
llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
|
|
156956
|
+
returnDisplay: "Access denied (403)"
|
|
156957
|
+
};
|
|
156958
|
+
}
|
|
156959
|
+
if (response.status === 404) {
|
|
156960
|
+
return {
|
|
156961
|
+
llmContent: `Error: Pull Request not found (404). PR #${pr_id} in ${project_key}/${repo_slug} may not exist.`,
|
|
156962
|
+
returnDisplay: `PR not found (404): #${pr_id}`
|
|
156963
|
+
};
|
|
156964
|
+
}
|
|
156965
|
+
if (!response.ok) {
|
|
156966
|
+
const errorText = await response.text().catch(() => "Unknown error");
|
|
156967
|
+
console.error(`Bitbucket API error (${response.status}):`, errorText.substring(0, 500));
|
|
156968
|
+
return {
|
|
156969
|
+
llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
|
|
156970
|
+
returnDisplay: `API error (${response.status})`
|
|
156971
|
+
};
|
|
156972
|
+
}
|
|
156973
|
+
const diffText = await response.text();
|
|
156974
|
+
let resultText = `# Pull Request Diff: ${project_key}/${repo_slug}#${pr_id}
|
|
156975
|
+
|
|
156976
|
+
`;
|
|
156977
|
+
resultText += `\`\`\`diff
|
|
156978
|
+
${diffText}
|
|
156979
|
+
\`\`\``;
|
|
156980
|
+
return {
|
|
156981
|
+
llmContent: resultText,
|
|
156982
|
+
returnDisplay: `Retrieved diff for Bitbucket PR #${pr_id}`
|
|
156983
|
+
};
|
|
156984
|
+
} catch (error) {
|
|
156985
|
+
const errorMessage = `Error retrieving Bitbucket PR diff ${project_key}/${repo_slug}#${pr_id}: ${getErrorMessage(error)}`;
|
|
156986
|
+
console.error(errorMessage, error);
|
|
156987
|
+
return {
|
|
156988
|
+
llmContent: `Error: ${errorMessage}`,
|
|
156989
|
+
returnDisplay: `Error: ${errorMessage}`
|
|
156990
|
+
};
|
|
156991
|
+
}
|
|
156992
|
+
}
|
|
156993
|
+
};
|
|
156994
|
+
|
|
156995
|
+
// packages/core/dist/src/tools/bitbucket-add-pr-comment.js
|
|
156996
|
+
init_errors();
|
|
156997
|
+
import { Type as Type18 } from "@google/genai";
|
|
156998
|
+
var BITBUCKET_FETCH_TIMEOUT_MS2 = 3e4;
|
|
156999
|
+
var BITBUCKET_URL2 = "https://git.rakuten-it.com";
|
|
157000
|
+
var BitbucketAddPrCommentTool = class _BitbucketAddPrCommentTool extends BaseTool {
|
|
157001
|
+
config;
|
|
157002
|
+
static Name = "bitbucket_add_pr_comment";
|
|
157003
|
+
constructor(config2) {
|
|
157004
|
+
super(_BitbucketAddPrCommentTool.Name, "BitbucketAddPrComment", "Adds a general comment to a specified Bitbucket Pull Request. Uses Personal Access Token from keys.json for authentication.", {
|
|
157005
|
+
properties: {
|
|
157006
|
+
project_key: {
|
|
157007
|
+
description: "The unique identifier for the Bitbucket project that owns the PR",
|
|
157008
|
+
type: Type18.STRING
|
|
157009
|
+
},
|
|
157010
|
+
repo_slug: {
|
|
157011
|
+
description: "The repository slug name that owns the PR",
|
|
157012
|
+
type: Type18.STRING
|
|
157013
|
+
},
|
|
157014
|
+
pr_id: {
|
|
157015
|
+
description: "The Pull Request unique identifier",
|
|
157016
|
+
type: Type18.NUMBER
|
|
157017
|
+
},
|
|
157018
|
+
comment_text: {
|
|
157019
|
+
description: "The text content of the comment to add",
|
|
157020
|
+
type: Type18.STRING
|
|
157021
|
+
}
|
|
157022
|
+
},
|
|
157023
|
+
required: ["project_key", "repo_slug", "pr_id", "comment_text"],
|
|
157024
|
+
type: Type18.OBJECT
|
|
157025
|
+
});
|
|
157026
|
+
this.config = config2;
|
|
157027
|
+
}
|
|
157028
|
+
validateParams(params) {
|
|
157029
|
+
const errors = SchemaValidator.validate(this.schema.parameters, params);
|
|
157030
|
+
if (errors) {
|
|
157031
|
+
return errors;
|
|
157032
|
+
}
|
|
157033
|
+
if (!params.project_key || params.project_key.trim() === "") {
|
|
157034
|
+
return "The 'project_key' parameter cannot be empty.";
|
|
157035
|
+
}
|
|
157036
|
+
if (!params.repo_slug || params.repo_slug.trim() === "") {
|
|
157037
|
+
return "The 'repo_slug' parameter cannot be empty.";
|
|
157038
|
+
}
|
|
157039
|
+
if (params.pr_id <= 0) {
|
|
157040
|
+
return "The 'pr_id' must be a positive number.";
|
|
157041
|
+
}
|
|
157042
|
+
if (!params.comment_text || params.comment_text.trim() === "") {
|
|
157043
|
+
return "The 'comment_text' parameter cannot be empty.";
|
|
157044
|
+
}
|
|
157045
|
+
return null;
|
|
157046
|
+
}
|
|
157047
|
+
getDescription(params) {
|
|
157048
|
+
return `Adding comment to Bitbucket PR #${params.pr_id} in ${params.project_key}/${params.repo_slug}`;
|
|
157049
|
+
}
|
|
157050
|
+
async execute(params, signal) {
|
|
157051
|
+
const validationError = this.validateParams(params);
|
|
157052
|
+
if (validationError) {
|
|
157053
|
+
return {
|
|
157054
|
+
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
|
157055
|
+
returnDisplay: validationError
|
|
157056
|
+
};
|
|
157057
|
+
}
|
|
157058
|
+
const { project_key, repo_slug, pr_id, comment_text } = params;
|
|
157059
|
+
const personal_access_token = this.config.getBitbucketToken();
|
|
157060
|
+
if (!personal_access_token) {
|
|
157061
|
+
return {
|
|
157062
|
+
llmContent: "Error: Bitbucket Personal Access Token not found in keys.json. Please configure it first.",
|
|
157063
|
+
returnDisplay: "Bitbucket token not configured"
|
|
157064
|
+
};
|
|
157065
|
+
}
|
|
157066
|
+
try {
|
|
157067
|
+
const apiUrl = `${BITBUCKET_URL2}/rest/api/latest/projects/${project_key}/repos/${repo_slug}/pull-requests/${pr_id}/comments`;
|
|
157068
|
+
const headers = {
|
|
157069
|
+
"Authorization": `Bearer ${personal_access_token}`,
|
|
157070
|
+
"Content-Type": "application/json"
|
|
157071
|
+
};
|
|
157072
|
+
const payload = {
|
|
157073
|
+
text: comment_text
|
|
157074
|
+
};
|
|
157075
|
+
console.log("Bitbucket API request:", {
|
|
157076
|
+
url: apiUrl,
|
|
157077
|
+
method: "POST",
|
|
157078
|
+
authMethod: "Bearer",
|
|
157079
|
+
tokenLength: personal_access_token.length,
|
|
157080
|
+
headers: { ...headers, Authorization: "Bearer ***" }
|
|
157081
|
+
});
|
|
157082
|
+
const controller = new AbortController();
|
|
157083
|
+
const timeoutId = setTimeout(() => controller.abort(), BITBUCKET_FETCH_TIMEOUT_MS2);
|
|
157084
|
+
let response;
|
|
157085
|
+
try {
|
|
157086
|
+
response = await fetch(apiUrl, {
|
|
157087
|
+
method: "POST",
|
|
157088
|
+
headers,
|
|
157089
|
+
body: JSON.stringify(payload),
|
|
157090
|
+
signal: signal || controller.signal
|
|
157091
|
+
});
|
|
157092
|
+
} finally {
|
|
157093
|
+
clearTimeout(timeoutId);
|
|
157094
|
+
}
|
|
157095
|
+
if (response.status === 401) {
|
|
157096
|
+
return {
|
|
157097
|
+
llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
|
|
157098
|
+
returnDisplay: "Authentication failed (401)"
|
|
157099
|
+
};
|
|
157100
|
+
}
|
|
157101
|
+
if (response.status === 403) {
|
|
157102
|
+
return {
|
|
157103
|
+
llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
|
|
157104
|
+
returnDisplay: "Access denied (403)"
|
|
157105
|
+
};
|
|
157106
|
+
}
|
|
157107
|
+
if (response.status === 404) {
|
|
157108
|
+
return {
|
|
157109
|
+
llmContent: `Error: Pull Request not found (404). PR #${pr_id} in ${project_key}/${repo_slug} may not exist.`,
|
|
157110
|
+
returnDisplay: `PR not found (404): #${pr_id}`
|
|
157111
|
+
};
|
|
157112
|
+
}
|
|
157113
|
+
if (!response.ok) {
|
|
157114
|
+
const errorText = await response.text().catch(() => "Unknown error");
|
|
157115
|
+
console.error(`Bitbucket API error (${response.status}):`, errorText.substring(0, 500));
|
|
157116
|
+
return {
|
|
157117
|
+
llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
|
|
157118
|
+
returnDisplay: `API error (${response.status})`
|
|
157119
|
+
};
|
|
157120
|
+
}
|
|
157121
|
+
const responseData = await response.json();
|
|
157122
|
+
let resultText = `# Comment added to Pull Request: ${project_key}/${repo_slug}#${pr_id}
|
|
157123
|
+
|
|
157124
|
+
`;
|
|
157125
|
+
resultText += `**Comment ID**: ${responseData.id || "Unknown"}
|
|
157126
|
+
`;
|
|
157127
|
+
resultText += `**Text**: ${comment_text}
|
|
157128
|
+
`;
|
|
157129
|
+
return {
|
|
157130
|
+
llmContent: resultText,
|
|
157131
|
+
returnDisplay: `Added comment to Bitbucket PR #${pr_id}`
|
|
157132
|
+
};
|
|
157133
|
+
} catch (error) {
|
|
157134
|
+
const errorMessage = `Error adding comment to Bitbucket PR ${project_key}/${repo_slug}#${pr_id}: ${getErrorMessage(error)}`;
|
|
157135
|
+
console.error(errorMessage, error);
|
|
157136
|
+
return {
|
|
157137
|
+
llmContent: `Error: ${errorMessage}`,
|
|
157138
|
+
returnDisplay: `Error: ${errorMessage}`
|
|
157139
|
+
};
|
|
157140
|
+
}
|
|
157141
|
+
}
|
|
157142
|
+
};
|
|
157143
|
+
|
|
157144
|
+
// packages/core/dist/src/tools/bitbucket-add-pr-inline-comment.js
|
|
157145
|
+
init_errors();
|
|
157146
|
+
import { Type as Type19 } from "@google/genai";
|
|
157147
|
+
var BITBUCKET_FETCH_TIMEOUT_MS3 = 3e4;
|
|
157148
|
+
var BITBUCKET_URL3 = "https://git.rakuten-it.com";
|
|
157149
|
+
var BitbucketAddPrInlineCommentTool = class _BitbucketAddPrInlineCommentTool extends BaseTool {
|
|
157150
|
+
config;
|
|
157151
|
+
static Name = "bitbucket_add_pr_inline_comment";
|
|
157152
|
+
constructor(config2) {
|
|
157153
|
+
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.", {
|
|
157154
|
+
properties: {
|
|
157155
|
+
project_key: {
|
|
157156
|
+
description: "The unique identifier for the Bitbucket project that owns the PR",
|
|
157157
|
+
type: Type19.STRING
|
|
157158
|
+
},
|
|
157159
|
+
repo_slug: {
|
|
157160
|
+
description: "The repository slug name that owns the PR",
|
|
157161
|
+
type: Type19.STRING
|
|
157162
|
+
},
|
|
157163
|
+
pr_id: {
|
|
157164
|
+
description: "The Pull Request unique identifier",
|
|
157165
|
+
type: Type19.NUMBER
|
|
157166
|
+
},
|
|
157167
|
+
file_path: {
|
|
157168
|
+
description: "The file path relative to repository root to add comment to",
|
|
157169
|
+
type: Type19.STRING
|
|
157170
|
+
},
|
|
157171
|
+
line: {
|
|
157172
|
+
description: "The line number to add comment to",
|
|
157173
|
+
type: Type19.NUMBER
|
|
157174
|
+
},
|
|
157175
|
+
comment_text: {
|
|
157176
|
+
description: "The text content of the inline comment to add",
|
|
157177
|
+
type: Type19.STRING
|
|
157178
|
+
},
|
|
157179
|
+
line_type: {
|
|
157180
|
+
description: "The line type, default is ADDED, optional values: ADDED, REMOVED, CONTEXT",
|
|
157181
|
+
type: Type19.STRING
|
|
157182
|
+
},
|
|
157183
|
+
file_type: {
|
|
157184
|
+
description: "The file type, default is TO, optional values: TO, FROM",
|
|
157185
|
+
type: Type19.STRING
|
|
157186
|
+
}
|
|
157187
|
+
},
|
|
157188
|
+
required: ["project_key", "repo_slug", "pr_id", "file_path", "line", "comment_text"],
|
|
157189
|
+
type: Type19.OBJECT
|
|
157190
|
+
});
|
|
157191
|
+
this.config = config2;
|
|
157192
|
+
}
|
|
157193
|
+
validateParams(params) {
|
|
157194
|
+
const errors = SchemaValidator.validate(this.schema.parameters, params);
|
|
157195
|
+
if (errors) {
|
|
157196
|
+
return errors;
|
|
157197
|
+
}
|
|
157198
|
+
if (!params.project_key || params.project_key.trim() === "") {
|
|
157199
|
+
return "The 'project_key' parameter cannot be empty.";
|
|
157200
|
+
}
|
|
157201
|
+
if (!params.repo_slug || params.repo_slug.trim() === "") {
|
|
157202
|
+
return "The 'repo_slug' parameter cannot be empty.";
|
|
157203
|
+
}
|
|
157204
|
+
if (params.pr_id <= 0) {
|
|
157205
|
+
return "The 'pr_id' must be a positive number.";
|
|
157206
|
+
}
|
|
157207
|
+
if (!params.file_path || params.file_path.trim() === "") {
|
|
157208
|
+
return "The 'file_path' parameter cannot be empty.";
|
|
157209
|
+
}
|
|
157210
|
+
if (params.line <= 0) {
|
|
157211
|
+
return "The 'line' must be a positive number.";
|
|
157212
|
+
}
|
|
157213
|
+
if (!params.comment_text || params.comment_text.trim() === "") {
|
|
157214
|
+
return "The 'comment_text' parameter cannot be empty.";
|
|
157215
|
+
}
|
|
157216
|
+
if (params.line_type && !["ADDED", "REMOVED", "CONTEXT"].includes(params.line_type)) {
|
|
157217
|
+
return "The 'line_type' must be one of: ADDED, REMOVED, CONTEXT";
|
|
157218
|
+
}
|
|
157219
|
+
if (params.file_type && !["TO", "FROM"].includes(params.file_type)) {
|
|
157220
|
+
return "The 'file_type' must be one of: TO, FROM";
|
|
157221
|
+
}
|
|
157222
|
+
return null;
|
|
157223
|
+
}
|
|
157224
|
+
getDescription(params) {
|
|
157225
|
+
return `Adding inline comment to Bitbucket PR #${params.pr_id} in ${params.project_key}/${params.repo_slug} at ${params.file_path}:${params.line}`;
|
|
157226
|
+
}
|
|
157227
|
+
async execute(params, signal) {
|
|
157228
|
+
const validationError = this.validateParams(params);
|
|
157229
|
+
if (validationError) {
|
|
157230
|
+
return {
|
|
157231
|
+
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
|
157232
|
+
returnDisplay: validationError
|
|
157233
|
+
};
|
|
157234
|
+
}
|
|
157235
|
+
const { project_key, repo_slug, pr_id, file_path, line, comment_text, line_type, file_type } = params;
|
|
157236
|
+
const personal_access_token = this.config.getBitbucketToken();
|
|
157237
|
+
if (!personal_access_token) {
|
|
157238
|
+
return {
|
|
157239
|
+
llmContent: "Error: Bitbucket Personal Access Token not found in keys.json. Please configure it first.",
|
|
157240
|
+
returnDisplay: "Bitbucket token not configured"
|
|
157241
|
+
};
|
|
157242
|
+
}
|
|
157243
|
+
try {
|
|
157244
|
+
const apiUrl = `${BITBUCKET_URL3}/rest/api/latest/projects/${project_key}/repos/${repo_slug}/pull-requests/${pr_id}/comments`;
|
|
157245
|
+
const headers = {
|
|
157246
|
+
"Authorization": `Bearer ${personal_access_token}`,
|
|
157247
|
+
"Content-Type": "application/json"
|
|
157248
|
+
};
|
|
157249
|
+
const payload = {
|
|
157250
|
+
text: comment_text,
|
|
157251
|
+
anchor: {
|
|
157252
|
+
path: file_path,
|
|
157253
|
+
line,
|
|
157254
|
+
lineType: line_type || "ADDED",
|
|
157255
|
+
fileType: file_type || "TO"
|
|
157256
|
+
}
|
|
157257
|
+
};
|
|
157258
|
+
console.log("Bitbucket API request:", {
|
|
157259
|
+
url: apiUrl,
|
|
157260
|
+
method: "POST",
|
|
157261
|
+
authMethod: "Bearer",
|
|
157262
|
+
tokenLength: personal_access_token.length,
|
|
157263
|
+
headers: { ...headers, Authorization: "Bearer ***" }
|
|
157264
|
+
});
|
|
157265
|
+
const controller = new AbortController();
|
|
157266
|
+
const timeoutId = setTimeout(() => controller.abort(), BITBUCKET_FETCH_TIMEOUT_MS3);
|
|
157267
|
+
let response;
|
|
157268
|
+
try {
|
|
157269
|
+
response = await fetch(apiUrl, {
|
|
157270
|
+
method: "POST",
|
|
157271
|
+
headers,
|
|
157272
|
+
body: JSON.stringify(payload),
|
|
157273
|
+
signal: signal || controller.signal
|
|
157274
|
+
});
|
|
157275
|
+
} finally {
|
|
157276
|
+
clearTimeout(timeoutId);
|
|
157277
|
+
}
|
|
157278
|
+
if (response.status === 401) {
|
|
157279
|
+
return {
|
|
157280
|
+
llmContent: "Error: Authentication failed (401). Personal Access Token may be invalid or expired.",
|
|
157281
|
+
returnDisplay: "Authentication failed (401)"
|
|
157282
|
+
};
|
|
157283
|
+
}
|
|
157284
|
+
if (response.status === 403) {
|
|
157285
|
+
return {
|
|
157286
|
+
llmContent: "Error: Access denied (403). Token may not have sufficient permissions.",
|
|
157287
|
+
returnDisplay: "Access denied (403)"
|
|
157288
|
+
};
|
|
157289
|
+
}
|
|
157290
|
+
if (response.status === 404) {
|
|
157291
|
+
return {
|
|
157292
|
+
llmContent: `Error: Pull Request not found (404). PR #${pr_id} in ${project_key}/${repo_slug} may not exist.`,
|
|
157293
|
+
returnDisplay: `PR not found (404): #${pr_id}`
|
|
157294
|
+
};
|
|
157295
|
+
}
|
|
157296
|
+
if (!response.ok) {
|
|
157297
|
+
const errorText = await response.text().catch(() => "Unknown error");
|
|
157298
|
+
console.error(`Bitbucket API error (${response.status}):`, errorText.substring(0, 500));
|
|
157299
|
+
return {
|
|
157300
|
+
llmContent: `Error: API call failed with status ${response.status}: ${errorText.substring(0, 200)}`,
|
|
157301
|
+
returnDisplay: `API error (${response.status})`
|
|
157302
|
+
};
|
|
157303
|
+
}
|
|
157304
|
+
const responseData = await response.json();
|
|
157305
|
+
let resultText = `# Inline comment added to Pull Request: ${project_key}/${repo_slug}#${pr_id}
|
|
157306
|
+
|
|
157307
|
+
`;
|
|
157308
|
+
resultText += `**File**: ${file_path}
|
|
157309
|
+
`;
|
|
157310
|
+
resultText += `**Line**: ${line}
|
|
157311
|
+
`;
|
|
157312
|
+
resultText += `**Line Type**: ${line_type || "ADDED"}
|
|
157313
|
+
`;
|
|
157314
|
+
resultText += `**File Type**: ${file_type || "TO"}
|
|
157315
|
+
`;
|
|
157316
|
+
resultText += `**Comment ID**: ${responseData.id || "Unknown"}
|
|
157317
|
+
`;
|
|
157318
|
+
resultText += `**Text**: ${comment_text}
|
|
157319
|
+
`;
|
|
157320
|
+
return {
|
|
157321
|
+
llmContent: resultText,
|
|
157322
|
+
returnDisplay: `Added inline comment to Bitbucket PR #${pr_id} at ${file_path}:${line}`
|
|
157323
|
+
};
|
|
157324
|
+
} catch (error) {
|
|
157325
|
+
const errorMessage = `Error adding inline comment to Bitbucket PR ${project_key}/${repo_slug}#${pr_id}: ${getErrorMessage(error)}`;
|
|
157326
|
+
console.error(errorMessage, error);
|
|
157327
|
+
return {
|
|
157328
|
+
llmContent: `Error: ${errorMessage}`,
|
|
157329
|
+
returnDisplay: `Error: ${errorMessage}`
|
|
157330
|
+
};
|
|
157331
|
+
}
|
|
157332
|
+
}
|
|
157333
|
+
};
|
|
157334
|
+
|
|
156387
157335
|
// packages/core/dist/src/utils/getFolderStructure.js
|
|
156388
157336
|
init_errors();
|
|
156389
157337
|
import * as fs16 from "fs/promises";
|
|
@@ -156747,7 +157695,7 @@ import fs18 from "node:fs";
|
|
|
156747
157695
|
import process9 from "node:process";
|
|
156748
157696
|
function getCoreSystemPrompt(userMemory) {
|
|
156749
157697
|
let systemMdEnabled = false;
|
|
156750
|
-
let systemMdPath = path19.join(
|
|
157698
|
+
let systemMdPath = path19.join(MPDAI_CONFIG_DIR, "system.md");
|
|
156751
157699
|
const systemMdVar = process9.env.GEMINI_SYSTEM_MD?.toLowerCase();
|
|
156752
157700
|
if (systemMdVar && !["0", "false"].includes(systemMdVar)) {
|
|
156753
157701
|
systemMdEnabled = true;
|
|
@@ -157052,7 +158000,7 @@ The structure MUST be as follows:
|
|
|
157052
158000
|
}
|
|
157053
158001
|
|
|
157054
158002
|
// packages/core/dist/src/utils/nextSpeakerChecker.js
|
|
157055
|
-
import { Type as
|
|
158003
|
+
import { Type as Type20 } from "@google/genai";
|
|
157056
158004
|
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
158005
|
**Decision Rules (apply in order):**
|
|
157058
158006
|
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 +158027,14 @@ Respond *only* in JSON format according to the following schema. Do not include
|
|
|
157079
158027
|
\`\`\`
|
|
157080
158028
|
`;
|
|
157081
158029
|
var RESPONSE_SCHEMA = {
|
|
157082
|
-
type:
|
|
158030
|
+
type: Type20.OBJECT,
|
|
157083
158031
|
properties: {
|
|
157084
158032
|
reasoning: {
|
|
157085
|
-
type:
|
|
158033
|
+
type: Type20.STRING,
|
|
157086
158034
|
description: "Brief explanation justifying the 'next_speaker' choice based *strictly* on the applicable rule and the content/structure of the preceding turn."
|
|
157087
158035
|
},
|
|
157088
158036
|
next_speaker: {
|
|
157089
|
-
type:
|
|
158037
|
+
type: Type20.STRING,
|
|
157090
158038
|
enum: ["user", "model"],
|
|
157091
158039
|
description: "Who should speak next based *only* on the preceding turn and the decision rules"
|
|
157092
158040
|
}
|
|
@@ -157551,7 +158499,7 @@ import * as fs19 from "fs";
|
|
|
157551
158499
|
import * as path20 from "path";
|
|
157552
158500
|
import { randomUUID } from "crypto";
|
|
157553
158501
|
var homeDir = os6.homedir() ?? "";
|
|
157554
|
-
var geminiDir = path20.join(homeDir,
|
|
158502
|
+
var geminiDir = path20.join(homeDir, MPDAI_DIR2);
|
|
157555
158503
|
var installationIdFile = path20.join(geminiDir, "installation_id");
|
|
157556
158504
|
function ensureGeminiDirExists() {
|
|
157557
158505
|
if (!fs19.existsSync(geminiDir)) {
|
|
@@ -159110,7 +160058,7 @@ var GitIgnoreParser = class {
|
|
|
159110
160058
|
|
|
159111
160059
|
// packages/core/dist/src/services/fileDiscoveryService.js
|
|
159112
160060
|
import * as path22 from "path";
|
|
159113
|
-
var GEMINI_IGNORE_FILE_NAME = ".
|
|
160061
|
+
var GEMINI_IGNORE_FILE_NAME = ".mpdaiignore";
|
|
159114
160062
|
var FileDiscoveryService = class {
|
|
159115
160063
|
gitIgnoreFilter = null;
|
|
159116
160064
|
geminiIgnoreFilter = null;
|
|
@@ -159181,7 +160129,7 @@ var FileDiscoveryService = class {
|
|
|
159181
160129
|
return false;
|
|
159182
160130
|
}
|
|
159183
160131
|
/**
|
|
159184
|
-
* Returns loaded patterns from .
|
|
160132
|
+
* Returns loaded patterns from .mpdaiignore
|
|
159185
160133
|
*/
|
|
159186
160134
|
getGeminiIgnorePatterns() {
|
|
159187
160135
|
return this.geminiIgnoreFilter?.getPatterns() ?? [];
|
|
@@ -163724,7 +164672,7 @@ var GitService = class {
|
|
|
163724
164672
|
}
|
|
163725
164673
|
getHistoryDir() {
|
|
163726
164674
|
const hash = getProjectHash(this.projectRoot);
|
|
163727
|
-
return path23.join(os7.homedir(),
|
|
164675
|
+
return path23.join(os7.homedir(), MPDAI_DIR2, "history", hash);
|
|
163728
164676
|
}
|
|
163729
164677
|
async initialize() {
|
|
163730
164678
|
if (!isGitRepository(this.projectRoot)) {
|
|
@@ -164002,7 +164950,7 @@ async function getGeminiMdFilePathsInternal(currentWorkingDirectory, userHomePat
|
|
|
164002
164950
|
for (const geminiMdFilename of geminiMdFilenames) {
|
|
164003
164951
|
const resolvedCwd = path26.resolve(currentWorkingDirectory);
|
|
164004
164952
|
const resolvedHome = path26.resolve(userHomePath);
|
|
164005
|
-
const globalMemoryPath = path26.join(resolvedHome,
|
|
164953
|
+
const globalMemoryPath = path26.join(resolvedHome, MPDAI_CONFIG_DIR, geminiMdFilename);
|
|
164006
164954
|
if (debugMode)
|
|
164007
164955
|
logger3.debug(`Searching for ${geminiMdFilename} starting from CWD: ${resolvedCwd}`);
|
|
164008
164956
|
if (debugMode)
|
|
@@ -164026,7 +164974,7 @@ async function getGeminiMdFilePathsInternal(currentWorkingDirectory, userHomePat
|
|
|
164026
164974
|
if (debugMode) {
|
|
164027
164975
|
logger3.debug(`Checking for ${geminiMdFilename} in (upward scan): ${currentDir}`);
|
|
164028
164976
|
}
|
|
164029
|
-
if (currentDir === path26.join(resolvedHome,
|
|
164977
|
+
if (currentDir === path26.join(resolvedHome, MPDAI_CONFIG_DIR)) {
|
|
164030
164978
|
if (debugMode) {
|
|
164031
164979
|
logger3.debug(`Upward scan reached global config dir path, stopping upward search here: ${currentDir}`);
|
|
164032
164980
|
}
|
|
@@ -164370,7 +165318,7 @@ var Config = class {
|
|
|
164370
165318
|
return this.geminiClient;
|
|
164371
165319
|
}
|
|
164372
165320
|
getGeminiDir() {
|
|
164373
|
-
return path27.join(this.targetDir,
|
|
165321
|
+
return path27.join(this.targetDir, MPDAI_CONFIG_DIR);
|
|
164374
165322
|
}
|
|
164375
165323
|
getProjectTempDir() {
|
|
164376
165324
|
return getProjectTempDir(this.getProjectRoot());
|
|
@@ -164424,6 +165372,72 @@ var Config = class {
|
|
|
164424
165372
|
this.setGeminiMdFileCount(fileCount);
|
|
164425
165373
|
return { memoryContent, fileCount };
|
|
164426
165374
|
}
|
|
165375
|
+
/**
|
|
165376
|
+
* Get Confluence Advanced Access Token from keys.json
|
|
165377
|
+
* @returns The Personal Access Token or null if not found
|
|
165378
|
+
*/
|
|
165379
|
+
getConfluenceToken() {
|
|
165380
|
+
try {
|
|
165381
|
+
const keysJsonPath = join11(homedir6(), ".mpdai", "keys.json");
|
|
165382
|
+
if (!existsSync5(keysJsonPath)) {
|
|
165383
|
+
return null;
|
|
165384
|
+
}
|
|
165385
|
+
const content = readFileSync8(keysJsonPath, "utf-8");
|
|
165386
|
+
const keys = JSON.parse(content);
|
|
165387
|
+
const confluenceKey = keys.find((key) => key.name === "confluence");
|
|
165388
|
+
if (confluenceKey && confluenceKey.value1) {
|
|
165389
|
+
return confluenceKey.value1;
|
|
165390
|
+
}
|
|
165391
|
+
return null;
|
|
165392
|
+
} catch (error) {
|
|
165393
|
+
console.error("Failed to read Confluence token from keys.json:", error);
|
|
165394
|
+
return null;
|
|
165395
|
+
}
|
|
165396
|
+
}
|
|
165397
|
+
/**
|
|
165398
|
+
* Get Jira Personal Access Token from keys.json
|
|
165399
|
+
* @returns The Personal Access Token or null if not found
|
|
165400
|
+
*/
|
|
165401
|
+
getJiraToken() {
|
|
165402
|
+
try {
|
|
165403
|
+
const keysJsonPath = join11(homedir6(), ".mpdai", "keys.json");
|
|
165404
|
+
if (!existsSync5(keysJsonPath)) {
|
|
165405
|
+
return null;
|
|
165406
|
+
}
|
|
165407
|
+
const content = readFileSync8(keysJsonPath, "utf-8");
|
|
165408
|
+
const keys = JSON.parse(content);
|
|
165409
|
+
const jiraKey = keys.find((key) => key.name === "jira");
|
|
165410
|
+
if (jiraKey && jiraKey.value1) {
|
|
165411
|
+
return jiraKey.value1;
|
|
165412
|
+
}
|
|
165413
|
+
return null;
|
|
165414
|
+
} catch (error) {
|
|
165415
|
+
console.error("Failed to read Jira token from keys.json:", error);
|
|
165416
|
+
return null;
|
|
165417
|
+
}
|
|
165418
|
+
}
|
|
165419
|
+
/**
|
|
165420
|
+
* Get Bitbucket Personal Access Token from keys.json
|
|
165421
|
+
* @returns The Personal Access Token or null if not found
|
|
165422
|
+
*/
|
|
165423
|
+
getBitbucketToken() {
|
|
165424
|
+
try {
|
|
165425
|
+
const keysJsonPath = join11(homedir6(), ".mpdai", "keys.json");
|
|
165426
|
+
if (!existsSync5(keysJsonPath)) {
|
|
165427
|
+
return null;
|
|
165428
|
+
}
|
|
165429
|
+
const content = readFileSync8(keysJsonPath, "utf-8");
|
|
165430
|
+
const keys = JSON.parse(content);
|
|
165431
|
+
const bitbucketKey = keys.find((key) => key.name === "bitbucket");
|
|
165432
|
+
if (bitbucketKey && bitbucketKey.value1) {
|
|
165433
|
+
return bitbucketKey.value1;
|
|
165434
|
+
}
|
|
165435
|
+
return null;
|
|
165436
|
+
} catch (error) {
|
|
165437
|
+
console.error("Failed to read Bitbucket token from keys.json:", error);
|
|
165438
|
+
return null;
|
|
165439
|
+
}
|
|
165440
|
+
}
|
|
164427
165441
|
async createToolRegistry() {
|
|
164428
165442
|
const registry = new ToolRegistry(this);
|
|
164429
165443
|
const targetDir = this.getTargetDir();
|
|
@@ -164456,9 +165470,24 @@ var Config = class {
|
|
|
164456
165470
|
registerCoreTool(EditTool, this);
|
|
164457
165471
|
registerCoreTool(WriteFileTool, this);
|
|
164458
165472
|
}
|
|
164459
|
-
|
|
165473
|
+
const useMpdaiTool = process10.env.USE_MPDAI_TOOL !== "false";
|
|
165474
|
+
if (useMpdaiTool) {
|
|
164460
165475
|
registerCoreTool(WebFetchTool, this);
|
|
164461
165476
|
registerCoreTool(WebSearchTool, this);
|
|
165477
|
+
const confluenceToken = this.getConfluenceToken();
|
|
165478
|
+
if (confluenceToken) {
|
|
165479
|
+
registerCoreTool(ConfluenceGetPageTool, this);
|
|
165480
|
+
}
|
|
165481
|
+
const jiraToken = this.getJiraToken();
|
|
165482
|
+
if (jiraToken) {
|
|
165483
|
+
registerCoreTool(JiraGetIssueTool, this);
|
|
165484
|
+
}
|
|
165485
|
+
const bitbucketToken = this.getBitbucketToken();
|
|
165486
|
+
if (bitbucketToken) {
|
|
165487
|
+
registerCoreTool(BitbucketGetPrDiffTool, this);
|
|
165488
|
+
registerCoreTool(BitbucketAddPrCommentTool, this);
|
|
165489
|
+
registerCoreTool(BitbucketAddPrInlineCommentTool, this);
|
|
165490
|
+
}
|
|
164462
165491
|
}
|
|
164463
165492
|
await registry.discoverTools();
|
|
164464
165493
|
return registry;
|
|
@@ -165050,7 +166079,7 @@ init_models();
|
|
|
165050
166079
|
import * as fs26 from "fs";
|
|
165051
166080
|
import * as path29 from "path";
|
|
165052
166081
|
import * as os9 from "os";
|
|
165053
|
-
var EXTENSIONS_DIRECTORY_NAME = path29.join(".
|
|
166082
|
+
var EXTENSIONS_DIRECTORY_NAME = path29.join(".mpdai", "extensions");
|
|
165054
166083
|
var EXTENSIONS_CONFIG_FILENAME = "gemini-extension.json";
|
|
165055
166084
|
function loadExtensions(workspaceDir) {
|
|
165056
166085
|
const allExtensions = [
|
|
@@ -165370,7 +166399,7 @@ async function getPackageJson() {
|
|
|
165370
166399
|
// packages/cli/src/utils/version.ts
|
|
165371
166400
|
async function getCliVersion() {
|
|
165372
166401
|
const pkgJson = await getPackageJson();
|
|
165373
|
-
return "0.1.
|
|
166402
|
+
return "0.1.28";
|
|
165374
166403
|
}
|
|
165375
166404
|
|
|
165376
166405
|
// packages/cli/src/config/sandboxConfig.ts
|
|
@@ -165661,7 +166690,7 @@ function mergeExcludeTools(settings, extensions) {
|
|
|
165661
166690
|
var dotenv = __toESM(require_main(), 1);
|
|
165662
166691
|
import * as fs27 from "fs";
|
|
165663
166692
|
import * as path34 from "path";
|
|
165664
|
-
import { homedir as
|
|
166693
|
+
import { homedir as homedir8 } from "os";
|
|
165665
166694
|
var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
|
|
165666
166695
|
|
|
165667
166696
|
// packages/cli/src/ui/themes/theme.ts
|
|
@@ -166178,8 +167207,8 @@ var DefaultDark = new Theme(
|
|
|
166178
167207
|
);
|
|
166179
167208
|
|
|
166180
167209
|
// packages/cli/src/config/settings.ts
|
|
166181
|
-
var SETTINGS_DIRECTORY_NAME = ".
|
|
166182
|
-
var USER_SETTINGS_DIR = path34.join(
|
|
167210
|
+
var SETTINGS_DIRECTORY_NAME = ".mpdai";
|
|
167211
|
+
var USER_SETTINGS_DIR = path34.join(homedir8(), SETTINGS_DIRECTORY_NAME);
|
|
166183
167212
|
var USER_SETTINGS_PATH = path34.join(USER_SETTINGS_DIR, "settings.json");
|
|
166184
167213
|
var LoadedSettings = class {
|
|
166185
167214
|
constructor(user, workspace, errors) {
|
|
@@ -166252,7 +167281,7 @@ function resolveEnvVarsInObject(obj) {
|
|
|
166252
167281
|
function findEnvFile(startDir) {
|
|
166253
167282
|
let currentDir = path34.resolve(startDir);
|
|
166254
167283
|
while (true) {
|
|
166255
|
-
const geminiEnvPath = path34.join(currentDir,
|
|
167284
|
+
const geminiEnvPath = path34.join(currentDir, MPDAI_CONFIG_DIR, ".env");
|
|
166256
167285
|
if (fs27.existsSync(geminiEnvPath)) {
|
|
166257
167286
|
return geminiEnvPath;
|
|
166258
167287
|
}
|
|
@@ -166262,11 +167291,11 @@ function findEnvFile(startDir) {
|
|
|
166262
167291
|
}
|
|
166263
167292
|
const parentDir = path34.dirname(currentDir);
|
|
166264
167293
|
if (parentDir === currentDir || !parentDir) {
|
|
166265
|
-
const homeGeminiEnvPath = path34.join(
|
|
167294
|
+
const homeGeminiEnvPath = path34.join(homedir8(), MPDAI_CONFIG_DIR, ".env");
|
|
166266
167295
|
if (fs27.existsSync(homeGeminiEnvPath)) {
|
|
166267
167296
|
return homeGeminiEnvPath;
|
|
166268
167297
|
}
|
|
166269
|
-
const homeEnvPath = path34.join(
|
|
167298
|
+
const homeEnvPath = path34.join(homedir8(), ".env");
|
|
166270
167299
|
if (fs27.existsSync(homeEnvPath)) {
|
|
166271
167300
|
return homeEnvPath;
|
|
166272
167301
|
}
|
|
@@ -166375,10 +167404,10 @@ function saveSettings(settingsFile) {
|
|
|
166375
167404
|
|
|
166376
167405
|
// packages/cli/src/utils/cleanup.ts
|
|
166377
167406
|
import { promises as fs28 } from "fs";
|
|
166378
|
-
import { join as
|
|
167407
|
+
import { join as join14 } from "path";
|
|
166379
167408
|
async function cleanupCheckpoints() {
|
|
166380
167409
|
const tempDir = getProjectTempDir(process.cwd());
|
|
166381
|
-
const checkpointsDir =
|
|
167410
|
+
const checkpointsDir = join14(tempDir, "checkpoints");
|
|
166382
167411
|
try {
|
|
166383
167412
|
await fs28.rm(checkpointsDir, { recursive: true, force: true });
|
|
166384
167413
|
} catch {
|