agentinit 1.24.0 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -0
- package/dist/cli.js +182 -250
- package/dist/cli.js.map +1 -1
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +25 -8
- package/dist/commands/agent.js.map +1 -1
- package/dist/constants/mcp.d.ts.map +1 -1
- package/dist/constants/mcp.js +2 -17
- package/dist/constants/mcp.js.map +1 -1
- package/dist/core/agentSettings/settingsManager.d.ts +2 -1
- package/dist/core/agentSettings/settingsManager.d.ts.map +1 -1
- package/dist/core/agentSettings/settingsManager.js +56 -0
- package/dist/core/agentSettings/settingsManager.js.map +1 -1
- package/dist/core/agentSettings/types.d.ts +11 -0
- package/dist/core/agentSettings/types.d.ts.map +1 -1
- package/dist/utils/ownPackageVersion.d.ts +2 -0
- package/dist/utils/ownPackageVersion.d.ts.map +1 -0
- package/dist/utils/ownPackageVersion.js +24 -0
- package/dist/utils/ownPackageVersion.js.map +1 -0
- package/package.json +6 -3
package/dist/cli.js
CHANGED
|
@@ -21405,7 +21405,7 @@ var require_uri_all = __commonJS((exports, module) => {
|
|
|
21405
21405
|
target.fragment = relative7.fragment;
|
|
21406
21406
|
return target;
|
|
21407
21407
|
}
|
|
21408
|
-
function
|
|
21408
|
+
function resolve14(baseURI, relativeURI, options2) {
|
|
21409
21409
|
var schemelessOptions = assign({ scheme: "null" }, options2);
|
|
21410
21410
|
return serialize(resolveComponents(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
|
|
21411
21411
|
}
|
|
@@ -21673,7 +21673,7 @@ var require_uri_all = __commonJS((exports, module) => {
|
|
|
21673
21673
|
exports2.removeDotSegments = removeDotSegments;
|
|
21674
21674
|
exports2.serialize = serialize;
|
|
21675
21675
|
exports2.resolveComponents = resolveComponents;
|
|
21676
|
-
exports2.resolve =
|
|
21676
|
+
exports2.resolve = resolve14;
|
|
21677
21677
|
exports2.normalize = normalize;
|
|
21678
21678
|
exports2.equal = equal;
|
|
21679
21679
|
exports2.escapeComponent = escapeComponent;
|
|
@@ -22036,13 +22036,13 @@ var require_json_schema_traverse = __commonJS((exports, module) => {
|
|
|
22036
22036
|
|
|
22037
22037
|
// node_modules/ajv/lib/compile/resolve.js
|
|
22038
22038
|
var require_resolve = __commonJS((exports, module) => {
|
|
22039
|
-
var
|
|
22039
|
+
var resolve14 = function(compile, root, ref) {
|
|
22040
22040
|
var refVal = this._refs[ref];
|
|
22041
22041
|
if (typeof refVal == "string") {
|
|
22042
22042
|
if (this._refs[refVal])
|
|
22043
22043
|
refVal = this._refs[refVal];
|
|
22044
22044
|
else
|
|
22045
|
-
return
|
|
22045
|
+
return resolve14.call(this, compile, root, refVal);
|
|
22046
22046
|
}
|
|
22047
22047
|
refVal = refVal || this._schemas[ref];
|
|
22048
22048
|
if (refVal instanceof SchemaObject) {
|
|
@@ -22247,13 +22247,13 @@ var require_resolve = __commonJS((exports, module) => {
|
|
|
22247
22247
|
var util6 = require_util3();
|
|
22248
22248
|
var SchemaObject = require_schema_obj();
|
|
22249
22249
|
var traverse = require_json_schema_traverse();
|
|
22250
|
-
module.exports =
|
|
22251
|
-
|
|
22252
|
-
|
|
22253
|
-
|
|
22254
|
-
|
|
22255
|
-
|
|
22256
|
-
|
|
22250
|
+
module.exports = resolve14;
|
|
22251
|
+
resolve14.normalizeId = normalizeId;
|
|
22252
|
+
resolve14.fullPath = getFullPath;
|
|
22253
|
+
resolve14.url = resolveUrl;
|
|
22254
|
+
resolve14.ids = resolveIds;
|
|
22255
|
+
resolve14.inlineRef = inlineRef;
|
|
22256
|
+
resolve14.schema = resolveSchema;
|
|
22257
22257
|
var PREVENT_SCOPE_CHANGE = util6.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]);
|
|
22258
22258
|
var SIMPLE_INLINED = util6.toHash([
|
|
22259
22259
|
"type",
|
|
@@ -22284,15 +22284,15 @@ var require_error_classes = __commonJS((exports, module) => {
|
|
|
22284
22284
|
};
|
|
22285
22285
|
var MissingRefError = function(baseId, ref, message) {
|
|
22286
22286
|
this.message = message || MissingRefError.message(baseId, ref);
|
|
22287
|
-
this.missingRef =
|
|
22288
|
-
this.missingSchema =
|
|
22287
|
+
this.missingRef = resolve14.url(baseId, ref);
|
|
22288
|
+
this.missingSchema = resolve14.normalizeId(resolve14.fullPath(this.missingRef));
|
|
22289
22289
|
};
|
|
22290
22290
|
var errorSubclass = function(Subclass) {
|
|
22291
22291
|
Subclass.prototype = Object.create(Error.prototype);
|
|
22292
22292
|
Subclass.prototype.constructor = Subclass;
|
|
22293
22293
|
return Subclass;
|
|
22294
22294
|
};
|
|
22295
|
-
var
|
|
22295
|
+
var resolve14 = require_resolve();
|
|
22296
22296
|
module.exports = {
|
|
22297
22297
|
Validation: errorSubclass(ValidationError),
|
|
22298
22298
|
MissingRef: errorSubclass(MissingRefError)
|
|
@@ -22886,7 +22886,7 @@ var require_compile = __commonJS((exports, module) => {
|
|
|
22886
22886
|
RULES,
|
|
22887
22887
|
validate: validateGenerator,
|
|
22888
22888
|
util: util6,
|
|
22889
|
-
resolve:
|
|
22889
|
+
resolve: resolve14,
|
|
22890
22890
|
resolveRef,
|
|
22891
22891
|
usePattern,
|
|
22892
22892
|
useDefault,
|
|
@@ -22925,7 +22925,7 @@ var require_compile = __commonJS((exports, module) => {
|
|
|
22925
22925
|
return validate2;
|
|
22926
22926
|
}
|
|
22927
22927
|
function resolveRef(baseId2, ref, isRoot) {
|
|
22928
|
-
ref =
|
|
22928
|
+
ref = resolve14.url(baseId2, ref);
|
|
22929
22929
|
var refIndex = refs[ref];
|
|
22930
22930
|
var _refVal, refCode;
|
|
22931
22931
|
if (refIndex !== undefined) {
|
|
@@ -22942,11 +22942,11 @@ var require_compile = __commonJS((exports, module) => {
|
|
|
22942
22942
|
}
|
|
22943
22943
|
}
|
|
22944
22944
|
refCode = addLocalRef(ref);
|
|
22945
|
-
var v2 =
|
|
22945
|
+
var v2 = resolve14.call(self, localCompile, root, ref);
|
|
22946
22946
|
if (v2 === undefined) {
|
|
22947
22947
|
var localSchema = localRefs && localRefs[ref];
|
|
22948
22948
|
if (localSchema) {
|
|
22949
|
-
v2 =
|
|
22949
|
+
v2 = resolve14.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId2);
|
|
22950
22950
|
}
|
|
22951
22951
|
}
|
|
22952
22952
|
if (v2 === undefined) {
|
|
@@ -23088,7 +23088,7 @@ var require_compile = __commonJS((exports, module) => {
|
|
|
23088
23088
|
code += statement(i, arr);
|
|
23089
23089
|
return code;
|
|
23090
23090
|
};
|
|
23091
|
-
var
|
|
23091
|
+
var resolve14 = require_resolve();
|
|
23092
23092
|
var util6 = require_util3();
|
|
23093
23093
|
var errorClasses = require_error_classes();
|
|
23094
23094
|
var stableStringify = require_fast_json_stable_stringify();
|
|
@@ -26337,7 +26337,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
26337
26337
|
var id = this._getId(schema2);
|
|
26338
26338
|
if (id !== undefined && typeof id != "string")
|
|
26339
26339
|
throw new Error("schema id must be string");
|
|
26340
|
-
key =
|
|
26340
|
+
key = resolve14.normalizeId(key || id);
|
|
26341
26341
|
checkUnique(this, key);
|
|
26342
26342
|
this._schemas[key] = this._addSchema(schema2, _skipValidation, _meta, true);
|
|
26343
26343
|
return this;
|
|
@@ -26383,7 +26383,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
26383
26383
|
}
|
|
26384
26384
|
};
|
|
26385
26385
|
var _getSchemaFragment = function(self, ref) {
|
|
26386
|
-
var res =
|
|
26386
|
+
var res = resolve14.schema.call(self, { schema: {} }, ref);
|
|
26387
26387
|
if (res) {
|
|
26388
26388
|
var { schema: schema2, root, baseId } = res;
|
|
26389
26389
|
var v = compileSchema.call(self, schema2, root, undefined, baseId);
|
|
@@ -26399,7 +26399,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
26399
26399
|
}
|
|
26400
26400
|
};
|
|
26401
26401
|
var _getSchemaObj = function(self, keyRef) {
|
|
26402
|
-
keyRef =
|
|
26402
|
+
keyRef = resolve14.normalizeId(keyRef);
|
|
26403
26403
|
return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
|
|
26404
26404
|
};
|
|
26405
26405
|
var removeSchema = function(schemaKeyRef) {
|
|
@@ -26427,7 +26427,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
26427
26427
|
this._cache.del(cacheKey);
|
|
26428
26428
|
var id = this._getId(schemaKeyRef);
|
|
26429
26429
|
if (id) {
|
|
26430
|
-
id =
|
|
26430
|
+
id = resolve14.normalizeId(id);
|
|
26431
26431
|
delete this._schemas[id];
|
|
26432
26432
|
delete this._refs[id];
|
|
26433
26433
|
}
|
|
@@ -26452,14 +26452,14 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
26452
26452
|
if (cached)
|
|
26453
26453
|
return cached;
|
|
26454
26454
|
shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
|
|
26455
|
-
var id =
|
|
26455
|
+
var id = resolve14.normalizeId(this._getId(schema2));
|
|
26456
26456
|
if (id && shouldAddSchema)
|
|
26457
26457
|
checkUnique(this, id);
|
|
26458
26458
|
var willValidate = this._opts.validateSchema !== false && !skipValidation;
|
|
26459
26459
|
var recursiveMeta;
|
|
26460
|
-
if (willValidate && !(recursiveMeta = id && id ==
|
|
26460
|
+
if (willValidate && !(recursiveMeta = id && id == resolve14.normalizeId(schema2.$schema)))
|
|
26461
26461
|
this.validateSchema(schema2, true);
|
|
26462
|
-
var localRefs =
|
|
26462
|
+
var localRefs = resolve14.ids.call(this, schema2);
|
|
26463
26463
|
var schemaObj = new SchemaObject({
|
|
26464
26464
|
id,
|
|
26465
26465
|
schema: schema2,
|
|
@@ -26620,7 +26620,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
26620
26620
|
var noop = function() {
|
|
26621
26621
|
};
|
|
26622
26622
|
var compileSchema = require_compile();
|
|
26623
|
-
var
|
|
26623
|
+
var resolve14 = require_resolve();
|
|
26624
26624
|
var Cache = require_cache();
|
|
26625
26625
|
var SchemaObject = require_schema_obj();
|
|
26626
26626
|
var stableStringify = require_fast_json_stable_stringify();
|
|
@@ -26735,12 +26735,12 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
26735
26735
|
if (typeof Promise !== "function") {
|
|
26736
26736
|
throw new TypeError("callback not provided");
|
|
26737
26737
|
}
|
|
26738
|
-
return new Promise(function(
|
|
26738
|
+
return new Promise(function(resolve14, reject) {
|
|
26739
26739
|
isexe(path, options2 || {}, function(er, is) {
|
|
26740
26740
|
if (er) {
|
|
26741
26741
|
reject(er);
|
|
26742
26742
|
} else {
|
|
26743
|
-
|
|
26743
|
+
resolve14(is);
|
|
26744
26744
|
}
|
|
26745
26745
|
});
|
|
26746
26746
|
});
|
|
@@ -26811,27 +26811,27 @@ var require_which = __commonJS((exports, module) => {
|
|
|
26811
26811
|
opt = {};
|
|
26812
26812
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
26813
26813
|
const found = [];
|
|
26814
|
-
const step = (i) => new Promise((
|
|
26814
|
+
const step = (i) => new Promise((resolve14, reject) => {
|
|
26815
26815
|
if (i === pathEnv.length)
|
|
26816
|
-
return opt.all && found.length ?
|
|
26816
|
+
return opt.all && found.length ? resolve14(found) : reject(getNotFoundError(cmd));
|
|
26817
26817
|
const ppRaw = pathEnv[i];
|
|
26818
26818
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
26819
26819
|
const pCmd = path.join(pathPart, cmd);
|
|
26820
26820
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
26821
|
-
|
|
26821
|
+
resolve14(subStep(p, i, 0));
|
|
26822
26822
|
});
|
|
26823
|
-
const subStep = (p, i, ii) => new Promise((
|
|
26823
|
+
const subStep = (p, i, ii) => new Promise((resolve14, reject) => {
|
|
26824
26824
|
if (ii === pathExt.length)
|
|
26825
|
-
return
|
|
26825
|
+
return resolve14(step(i + 1));
|
|
26826
26826
|
const ext = pathExt[ii];
|
|
26827
26827
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
26828
26828
|
if (!er && is) {
|
|
26829
26829
|
if (opt.all)
|
|
26830
26830
|
found.push(p + ext);
|
|
26831
26831
|
else
|
|
26832
|
-
return
|
|
26832
|
+
return resolve14(p + ext);
|
|
26833
26833
|
}
|
|
26834
|
-
return
|
|
26834
|
+
return resolve14(subStep(p, i, ii + 1));
|
|
26835
26835
|
});
|
|
26836
26836
|
});
|
|
26837
26837
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -27115,152 +27115,6 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
27115
27115
|
module.exports._enoent = enoent;
|
|
27116
27116
|
});
|
|
27117
27117
|
|
|
27118
|
-
// node_modules/jsonc-parser/lib/umd/main.js
|
|
27119
|
-
var require_main = __commonJS((exports, module) => {
|
|
27120
|
-
(function(factory) {
|
|
27121
|
-
if (typeof module === "object" && typeof exports === "object") {
|
|
27122
|
-
var v = factory(__require, exports);
|
|
27123
|
-
if (v !== undefined)
|
|
27124
|
-
module.exports = v;
|
|
27125
|
-
} else if (typeof define === "function" && define.amd) {
|
|
27126
|
-
define(["require", "exports", "./impl/format", "./impl/edit", "./impl/scanner", "./impl/parser"], factory);
|
|
27127
|
-
}
|
|
27128
|
-
})(function(require2, exports2) {
|
|
27129
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
27130
|
-
exports2.applyEdits = exports2.modify = exports2.format = exports2.printParseErrorCode = exports2.ParseErrorCode = exports2.stripComments = exports2.visit = exports2.getNodeValue = exports2.getNodePath = exports2.findNodeAtOffset = exports2.findNodeAtLocation = exports2.parseTree = exports2.parse = exports2.getLocation = exports2.SyntaxKind = exports2.ScanError = exports2.createScanner = undefined;
|
|
27131
|
-
const formatter = require2("./impl/format");
|
|
27132
|
-
const edit = require2("./impl/edit");
|
|
27133
|
-
const scanner = require2("./impl/scanner");
|
|
27134
|
-
const parser = require2("./impl/parser");
|
|
27135
|
-
exports2.createScanner = scanner.createScanner;
|
|
27136
|
-
var ScanError;
|
|
27137
|
-
(function(ScanError2) {
|
|
27138
|
-
ScanError2[ScanError2["None"] = 0] = "None";
|
|
27139
|
-
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
27140
|
-
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
27141
|
-
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
27142
|
-
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
27143
|
-
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
27144
|
-
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
27145
|
-
})(ScanError || (exports2.ScanError = ScanError = {}));
|
|
27146
|
-
var SyntaxKind;
|
|
27147
|
-
(function(SyntaxKind2) {
|
|
27148
|
-
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
27149
|
-
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
27150
|
-
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
27151
|
-
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
27152
|
-
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
27153
|
-
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
27154
|
-
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
27155
|
-
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
27156
|
-
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
27157
|
-
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
27158
|
-
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
27159
|
-
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
27160
|
-
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
27161
|
-
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
27162
|
-
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
27163
|
-
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
27164
|
-
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
27165
|
-
})(SyntaxKind || (exports2.SyntaxKind = SyntaxKind = {}));
|
|
27166
|
-
exports2.getLocation = parser.getLocation;
|
|
27167
|
-
exports2.parse = parser.parse;
|
|
27168
|
-
exports2.parseTree = parser.parseTree;
|
|
27169
|
-
exports2.findNodeAtLocation = parser.findNodeAtLocation;
|
|
27170
|
-
exports2.findNodeAtOffset = parser.findNodeAtOffset;
|
|
27171
|
-
exports2.getNodePath = parser.getNodePath;
|
|
27172
|
-
exports2.getNodeValue = parser.getNodeValue;
|
|
27173
|
-
exports2.visit = parser.visit;
|
|
27174
|
-
exports2.stripComments = parser.stripComments;
|
|
27175
|
-
var ParseErrorCode;
|
|
27176
|
-
(function(ParseErrorCode2) {
|
|
27177
|
-
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
27178
|
-
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
27179
|
-
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
27180
|
-
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
27181
|
-
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
27182
|
-
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
27183
|
-
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
27184
|
-
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
27185
|
-
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
27186
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
27187
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
27188
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
27189
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
27190
|
-
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
27191
|
-
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
27192
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
27193
|
-
})(ParseErrorCode || (exports2.ParseErrorCode = ParseErrorCode = {}));
|
|
27194
|
-
function printParseErrorCode(code) {
|
|
27195
|
-
switch (code) {
|
|
27196
|
-
case 1:
|
|
27197
|
-
return "InvalidSymbol";
|
|
27198
|
-
case 2:
|
|
27199
|
-
return "InvalidNumberFormat";
|
|
27200
|
-
case 3:
|
|
27201
|
-
return "PropertyNameExpected";
|
|
27202
|
-
case 4:
|
|
27203
|
-
return "ValueExpected";
|
|
27204
|
-
case 5:
|
|
27205
|
-
return "ColonExpected";
|
|
27206
|
-
case 6:
|
|
27207
|
-
return "CommaExpected";
|
|
27208
|
-
case 7:
|
|
27209
|
-
return "CloseBraceExpected";
|
|
27210
|
-
case 8:
|
|
27211
|
-
return "CloseBracketExpected";
|
|
27212
|
-
case 9:
|
|
27213
|
-
return "EndOfFileExpected";
|
|
27214
|
-
case 10:
|
|
27215
|
-
return "InvalidCommentToken";
|
|
27216
|
-
case 11:
|
|
27217
|
-
return "UnexpectedEndOfComment";
|
|
27218
|
-
case 12:
|
|
27219
|
-
return "UnexpectedEndOfString";
|
|
27220
|
-
case 13:
|
|
27221
|
-
return "UnexpectedEndOfNumber";
|
|
27222
|
-
case 14:
|
|
27223
|
-
return "InvalidUnicode";
|
|
27224
|
-
case 15:
|
|
27225
|
-
return "InvalidEscapeCharacter";
|
|
27226
|
-
case 16:
|
|
27227
|
-
return "InvalidCharacter";
|
|
27228
|
-
}
|
|
27229
|
-
return "<unknown ParseErrorCode>";
|
|
27230
|
-
}
|
|
27231
|
-
exports2.printParseErrorCode = printParseErrorCode;
|
|
27232
|
-
function format(documentText, range, options2) {
|
|
27233
|
-
return formatter.format(documentText, range, options2);
|
|
27234
|
-
}
|
|
27235
|
-
exports2.format = format;
|
|
27236
|
-
function modify(text, path, value, options2) {
|
|
27237
|
-
return edit.setProperty(text, path, value, options2);
|
|
27238
|
-
}
|
|
27239
|
-
exports2.modify = modify;
|
|
27240
|
-
function applyEdits(text, edits) {
|
|
27241
|
-
let sortedEdits = edits.slice(0).sort((a, b) => {
|
|
27242
|
-
const diff = a.offset - b.offset;
|
|
27243
|
-
if (diff === 0) {
|
|
27244
|
-
return a.length - b.length;
|
|
27245
|
-
}
|
|
27246
|
-
return diff;
|
|
27247
|
-
});
|
|
27248
|
-
let lastModifiedOffset = text.length;
|
|
27249
|
-
for (let i = sortedEdits.length - 1;i >= 0; i--) {
|
|
27250
|
-
let e = sortedEdits[i];
|
|
27251
|
-
if (e.offset + e.length <= lastModifiedOffset) {
|
|
27252
|
-
text = edit.applyEdit(text, e);
|
|
27253
|
-
} else {
|
|
27254
|
-
throw new Error("Overlapping edit");
|
|
27255
|
-
}
|
|
27256
|
-
lastModifiedOffset = e.offset;
|
|
27257
|
-
}
|
|
27258
|
-
return text;
|
|
27259
|
-
}
|
|
27260
|
-
exports2.applyEdits = applyEdits;
|
|
27261
|
-
});
|
|
27262
|
-
});
|
|
27263
|
-
|
|
27264
27118
|
// node_modules/commander/esm.mjs
|
|
27265
27119
|
var import_ = __toESM(require_commander(), 1);
|
|
27266
27120
|
var {
|
|
@@ -32846,26 +32700,35 @@ class MCPParser {
|
|
|
32846
32700
|
}
|
|
32847
32701
|
}
|
|
32848
32702
|
|
|
32849
|
-
// dist/
|
|
32850
|
-
import {readFileSync as readFileSync2} from "fs";
|
|
32851
|
-
import {
|
|
32852
|
-
import {
|
|
32853
|
-
|
|
32854
|
-
|
|
32855
|
-
|
|
32856
|
-
|
|
32857
|
-
|
|
32858
|
-
|
|
32859
|
-
|
|
32860
|
-
|
|
32861
|
-
|
|
32703
|
+
// dist/utils/ownPackageVersion.js
|
|
32704
|
+
import {readFileSync as readFileSync2} from "node:fs";
|
|
32705
|
+
import {dirname as dirname6, resolve as resolve12} from "node:path";
|
|
32706
|
+
import {fileURLToPath} from "node:url";
|
|
32707
|
+
function getOwnPackageVersion(fallback2 = "0.0.0") {
|
|
32708
|
+
const moduleDir = dirname6(fileURLToPath(import.meta.url));
|
|
32709
|
+
const candidates = [
|
|
32710
|
+
resolve12(moduleDir, "../package.json"),
|
|
32711
|
+
resolve12(moduleDir, "../../package.json"),
|
|
32712
|
+
resolve12(process.cwd(), "package.json")
|
|
32713
|
+
];
|
|
32714
|
+
for (const packageJsonPath of candidates) {
|
|
32715
|
+
try {
|
|
32716
|
+
const packageJson = JSON.parse(readFileSync2(packageJsonPath, "utf8"));
|
|
32717
|
+
if (packageJson.name === "agentinit" && typeof packageJson.version === "string") {
|
|
32718
|
+
return packageJson.version;
|
|
32719
|
+
}
|
|
32720
|
+
} catch {
|
|
32721
|
+
}
|
|
32862
32722
|
}
|
|
32863
|
-
|
|
32723
|
+
return fallback2;
|
|
32724
|
+
}
|
|
32725
|
+
|
|
32726
|
+
// dist/constants/mcp.js
|
|
32864
32727
|
var DEFAULT_CONNECTION_TIMEOUT_MS = 30000;
|
|
32865
32728
|
var MAX_RESOURCE_CONTENT_SIZE = 10 * 1024 * 1024;
|
|
32866
32729
|
var MCP_VERIFIER_CONFIG = {
|
|
32867
32730
|
name: "agentinit-verifier",
|
|
32868
|
-
version:
|
|
32731
|
+
version: getOwnPackageVersion()
|
|
32869
32732
|
};
|
|
32870
32733
|
|
|
32871
32734
|
class TimeoutError extends Error {
|
|
@@ -32885,7 +32748,7 @@ import {readFileSync as readFileSync4} from "fs";
|
|
|
32885
32748
|
|
|
32886
32749
|
// dist/core/rulesTemplateLoader.js
|
|
32887
32750
|
var toml = __toESM(require_toml(), 1);
|
|
32888
|
-
import {resolve as
|
|
32751
|
+
import {resolve as resolve13, dirname as dirname7} from "path";
|
|
32889
32752
|
import {fileURLToPath as fileURLToPath2} from "url";
|
|
32890
32753
|
import {readFileSync as readFileSync3, readdirSync, existsSync as existsSync2} from "fs";
|
|
32891
32754
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
@@ -32895,7 +32758,7 @@ class RulesTemplateLoader {
|
|
|
32895
32758
|
templatesPath;
|
|
32896
32759
|
templates = new Map;
|
|
32897
32760
|
constructor() {
|
|
32898
|
-
this.templatesPath =
|
|
32761
|
+
this.templatesPath = resolve13(__dirname2, "../templates/rules");
|
|
32899
32762
|
this.loadTemplates();
|
|
32900
32763
|
}
|
|
32901
32764
|
loadTemplates() {
|
|
@@ -32905,7 +32768,7 @@ class RulesTemplateLoader {
|
|
|
32905
32768
|
const files = readdirSync(this.templatesPath).filter((file) => file.endsWith(".toml"));
|
|
32906
32769
|
for (const file of files) {
|
|
32907
32770
|
try {
|
|
32908
|
-
const filePath =
|
|
32771
|
+
const filePath = resolve13(this.templatesPath, file);
|
|
32909
32772
|
const content = readFileSync3(filePath, "utf-8");
|
|
32910
32773
|
const parsed = toml.default.parse(content);
|
|
32911
32774
|
const template = {
|
|
@@ -38477,7 +38340,7 @@ class Protocol {
|
|
|
38477
38340
|
}
|
|
38478
38341
|
request(request, resultSchema, options2) {
|
|
38479
38342
|
const { relatedRequestId, resumptionToken, onresumptiontoken } = options2 !== null && options2 !== undefined ? options2 : {};
|
|
38480
|
-
return new Promise((
|
|
38343
|
+
return new Promise((resolve14, reject) => {
|
|
38481
38344
|
var _a, _b, _c, _d, _e, _f;
|
|
38482
38345
|
if (!this._transport) {
|
|
38483
38346
|
reject(new Error("Not connected"));
|
|
@@ -38528,7 +38391,7 @@ class Protocol {
|
|
|
38528
38391
|
}
|
|
38529
38392
|
try {
|
|
38530
38393
|
const result = resultSchema.parse(response.result);
|
|
38531
|
-
|
|
38394
|
+
resolve14(result);
|
|
38532
38395
|
} catch (error) {
|
|
38533
38396
|
reject(error);
|
|
38534
38397
|
}
|
|
@@ -38908,7 +38771,7 @@ class StdioClientTransport {
|
|
|
38908
38771
|
if (this._process) {
|
|
38909
38772
|
throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");
|
|
38910
38773
|
}
|
|
38911
|
-
return new Promise((
|
|
38774
|
+
return new Promise((resolve14, reject) => {
|
|
38912
38775
|
var _a, _b, _c, _d, _e;
|
|
38913
38776
|
this._process = import_cross_spawn.default(this._serverParams.command, (_a = this._serverParams.args) !== null && _a !== undefined ? _a : [], {
|
|
38914
38777
|
env: {
|
|
@@ -38931,7 +38794,7 @@ class StdioClientTransport {
|
|
|
38931
38794
|
(_b2 = this.onerror) === null || _b2 === undefined || _b2.call(this, error);
|
|
38932
38795
|
});
|
|
38933
38796
|
this._process.on("spawn", () => {
|
|
38934
|
-
|
|
38797
|
+
resolve14();
|
|
38935
38798
|
});
|
|
38936
38799
|
this._process.on("close", (_code) => {
|
|
38937
38800
|
var _a2;
|
|
@@ -38986,16 +38849,16 @@ class StdioClientTransport {
|
|
|
38986
38849
|
this._readBuffer.clear();
|
|
38987
38850
|
}
|
|
38988
38851
|
send(message) {
|
|
38989
|
-
return new Promise((
|
|
38852
|
+
return new Promise((resolve14) => {
|
|
38990
38853
|
var _a;
|
|
38991
38854
|
if (!((_a = this._process) === null || _a === undefined ? undefined : _a.stdin)) {
|
|
38992
38855
|
throw new Error("Not connected");
|
|
38993
38856
|
}
|
|
38994
38857
|
const json2 = serializeMessage(message);
|
|
38995
38858
|
if (this._process.stdin.write(json2)) {
|
|
38996
|
-
|
|
38859
|
+
resolve14();
|
|
38997
38860
|
} else {
|
|
38998
|
-
this._process.stdin.once("drain",
|
|
38861
|
+
this._process.stdin.once("drain", resolve14);
|
|
38999
38862
|
}
|
|
39000
38863
|
});
|
|
39001
38864
|
}
|
|
@@ -40417,7 +40280,7 @@ class SSEClientTransport {
|
|
|
40417
40280
|
_startOrAuth() {
|
|
40418
40281
|
var _a, _b, _c;
|
|
40419
40282
|
const fetchImpl = (_c = (_b = (_a = this === null || this === undefined ? undefined : this._eventSourceInit) === null || _a === undefined ? undefined : _a.fetch) !== null && _b !== undefined ? _b : this._fetch) !== null && _c !== undefined ? _c : fetch;
|
|
40420
|
-
return new Promise((
|
|
40283
|
+
return new Promise((resolve14, reject) => {
|
|
40421
40284
|
this._eventSource = new EventSource(this._url.href, {
|
|
40422
40285
|
...this._eventSourceInit,
|
|
40423
40286
|
fetch: async (url, init2) => {
|
|
@@ -40437,7 +40300,7 @@ class SSEClientTransport {
|
|
|
40437
40300
|
this._eventSource.onerror = (event) => {
|
|
40438
40301
|
var _a2;
|
|
40439
40302
|
if (event.code === 401 && this._authProvider) {
|
|
40440
|
-
this._authThenStart().then(
|
|
40303
|
+
this._authThenStart().then(resolve14, reject);
|
|
40441
40304
|
return;
|
|
40442
40305
|
}
|
|
40443
40306
|
const error = new SseError(event.code, event.message, event);
|
|
@@ -40460,7 +40323,7 @@ class SSEClientTransport {
|
|
|
40460
40323
|
this.close();
|
|
40461
40324
|
return;
|
|
40462
40325
|
}
|
|
40463
|
-
|
|
40326
|
+
resolve14();
|
|
40464
40327
|
});
|
|
40465
40328
|
this._eventSource.onmessage = (event) => {
|
|
40466
40329
|
var _a2, _b2;
|
|
@@ -41128,7 +40991,7 @@ class MCPVerifier {
|
|
|
41128
40991
|
|
|
41129
40992
|
// dist/core/gitignoreManager.js
|
|
41130
40993
|
import {promises as fs34} from "fs";
|
|
41131
|
-
import {dirname as dirname8, join as
|
|
40994
|
+
import {dirname as dirname8, join as join9} from "path";
|
|
41132
40995
|
var normalizeIgnorePath = function(projectPath, value) {
|
|
41133
40996
|
const relative7 = value.startsWith(projectPath) ? value.slice(projectPath.length + 1) : value;
|
|
41134
40997
|
const normalized = relative7.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
@@ -41175,10 +41038,10 @@ var updateManagedBlock = function(existingContent, entries) {
|
|
|
41175
41038
|
return content;
|
|
41176
41039
|
};
|
|
41177
41040
|
async function updateManagedIgnoreFile(projectPath, paths6, options2 = {}) {
|
|
41178
|
-
const ignoreFile = options2.local ?
|
|
41179
|
-
const ignoreFilePath =
|
|
41041
|
+
const ignoreFile = options2.local ? join9(".git", "info", "exclude") : ".gitignore";
|
|
41042
|
+
const ignoreFilePath = join9(projectPath, ignoreFile);
|
|
41180
41043
|
if (options2.local) {
|
|
41181
|
-
const gitDir =
|
|
41044
|
+
const gitDir = join9(projectPath, ".git");
|
|
41182
41045
|
try {
|
|
41183
41046
|
const stat = await fs34.stat(gitDir);
|
|
41184
41047
|
if (!stat.isDirectory()) {
|
|
@@ -41201,8 +41064,8 @@ async function updateManagedIgnoreFile(projectPath, paths6, options2 = {}) {
|
|
|
41201
41064
|
return ignoreFilePath;
|
|
41202
41065
|
}
|
|
41203
41066
|
async function removeManagedIgnoreBlock(projectPath, options2 = {}) {
|
|
41204
|
-
const ignoreFile = options2.local ?
|
|
41205
|
-
const ignoreFilePath =
|
|
41067
|
+
const ignoreFile = options2.local ? join9(".git", "info", "exclude") : ".gitignore";
|
|
41068
|
+
const ignoreFilePath = join9(projectPath, ignoreFile);
|
|
41206
41069
|
let content;
|
|
41207
41070
|
try {
|
|
41208
41071
|
content = await fs34.readFile(ignoreFilePath, "utf8");
|
|
@@ -41238,12 +41101,12 @@ var END_MARKER = "# END AgentInit Generated Files";
|
|
|
41238
41101
|
init_agentManager();
|
|
41239
41102
|
init_skillsManager();
|
|
41240
41103
|
init_fs();
|
|
41241
|
-
import {dirname as dirname9, join as
|
|
41104
|
+
import {dirname as dirname9, join as join10} from "path";
|
|
41242
41105
|
async function discoverProjectSkills(projectPath, skillsManager4) {
|
|
41243
41106
|
const sources = [];
|
|
41244
41107
|
const skills2 = new Map;
|
|
41245
41108
|
for (const sourceDir of PROJECT_SKILL_SOURCE_DIRS) {
|
|
41246
|
-
const absoluteSourceDir =
|
|
41109
|
+
const absoluteSourceDir = join10(projectPath, sourceDir);
|
|
41247
41110
|
if (!await fileExists(absoluteSourceDir)) {
|
|
41248
41111
|
continue;
|
|
41249
41112
|
}
|
|
@@ -42375,7 +42238,7 @@ var import_prompts3 = __toESM(require_prompts3(), 1);
|
|
|
42375
42238
|
init_colors();
|
|
42376
42239
|
init_logger();
|
|
42377
42240
|
import {homedir as homedir7} from "os";
|
|
42378
|
-
import {relative as relative8, resolve as
|
|
42241
|
+
import {relative as relative8, resolve as resolve14} from "path";
|
|
42379
42242
|
|
|
42380
42243
|
// dist/utils/promptUtils.js
|
|
42381
42244
|
var import_prompts2 = __toESM(require_prompts3(), 1);
|
|
@@ -43012,7 +42875,7 @@ Dry run \u2014 no changes made.`));
|
|
|
43012
42875
|
const entries = await installLock3.getCurrentState({
|
|
43013
42876
|
kind: "skill",
|
|
43014
42877
|
name,
|
|
43015
|
-
projectPath:
|
|
42878
|
+
projectPath: resolve14(cwd),
|
|
43016
42879
|
scope: "project"
|
|
43017
42880
|
});
|
|
43018
42881
|
if (entries.length === 0) {
|
|
@@ -43068,7 +42931,7 @@ Dry run \u2014 no changes made.`));
|
|
|
43068
42931
|
} else {
|
|
43069
42932
|
const entries = await installLock3.getCurrentState({
|
|
43070
42933
|
kind: "skill",
|
|
43071
|
-
projectPath:
|
|
42934
|
+
projectPath: resolve14(cwd),
|
|
43072
42935
|
scope: "project"
|
|
43073
42936
|
});
|
|
43074
42937
|
if (entries.length === 0) {
|
|
@@ -43273,7 +43136,7 @@ var buildSkillGroups = function(agents, projectPath, global3) {
|
|
|
43273
43136
|
dirToAgents.set(skillsDir, existing);
|
|
43274
43137
|
}
|
|
43275
43138
|
return Array.from(dirToAgents.entries()).map(([dir, groupedAgents]) => {
|
|
43276
|
-
const canonicalShared =
|
|
43139
|
+
const canonicalShared = resolve14(dir) === getCanonicalSkillsDirForScope(projectPath, !!global3) && groupedAgents.every((agent) => agent.getProjectSkillsStandard() === "agents");
|
|
43277
43140
|
return {
|
|
43278
43141
|
dir,
|
|
43279
43142
|
displayDir: formatSkillsDir(projectPath, dir),
|
|
@@ -43296,7 +43159,7 @@ var prependCanonicalGlobalGroup = function(agentManager9, projectPath, groups) {
|
|
|
43296
43159
|
if (sharedAgents.length === 0) {
|
|
43297
43160
|
return groups;
|
|
43298
43161
|
}
|
|
43299
|
-
const existingCanonicalIndex = groups.findIndex((group) =>
|
|
43162
|
+
const existingCanonicalIndex = groups.findIndex((group) => resolve14(group.dir) === canonicalDir);
|
|
43300
43163
|
if (existingCanonicalIndex >= 0) {
|
|
43301
43164
|
const existingCanonical = groups[existingCanonicalIndex];
|
|
43302
43165
|
const remaining = groups.filter((_, index) => index !== existingCanonicalIndex);
|
|
@@ -43353,10 +43216,10 @@ var formatPromptPath = function(path) {
|
|
|
43353
43216
|
return normalizedPath;
|
|
43354
43217
|
};
|
|
43355
43218
|
var getCanonicalGlobalSkillsDir = function() {
|
|
43356
|
-
return
|
|
43219
|
+
return resolve14(homedir7(), ".agents/skills");
|
|
43357
43220
|
};
|
|
43358
43221
|
var getCanonicalSkillsDirForScope = function(projectPath, global3) {
|
|
43359
|
-
return global3 ? getCanonicalGlobalSkillsDir() :
|
|
43222
|
+
return global3 ? getCanonicalGlobalSkillsDir() : resolve14(projectPath, ".agents/skills");
|
|
43360
43223
|
};
|
|
43361
43224
|
var getCanonicalGlobalSkillsDisplayPath = function() {
|
|
43362
43225
|
return formatPromptPath(getCanonicalGlobalSkillsDir());
|
|
@@ -44485,7 +44348,7 @@ function registerRulesCommand(program2) {
|
|
|
44485
44348
|
// dist/commands/plugins.js
|
|
44486
44349
|
var import_prompts4 = __toESM(require_prompts3(), 1);
|
|
44487
44350
|
import {homedir as homedir8} from "os";
|
|
44488
|
-
import {dirname as dirname10, relative as relative9, resolve as
|
|
44351
|
+
import {dirname as dirname10, relative as relative9, resolve as resolve15} from "path";
|
|
44489
44352
|
init_logger();
|
|
44490
44353
|
init_pluginManager();
|
|
44491
44354
|
init_agentManager();
|
|
@@ -45106,7 +44969,7 @@ var buildGlobalPluginGroups = function(agentManager12, projectPath) {
|
|
|
45106
44969
|
compatibleAgentNames: [],
|
|
45107
44970
|
kind: "native"
|
|
45108
44971
|
}));
|
|
45109
|
-
const canonicalDir =
|
|
44972
|
+
const canonicalDir = resolve15(homedir8(), ".agents/skills");
|
|
45110
44973
|
const sharedAgents = agentManager12.getAllAgents().filter((agent) => agent.supportsSkills() && agent.getProjectSkillsStandard() === "agents" && !!agent.getSkillsDir(projectPath, true));
|
|
45111
44974
|
const claudeGroups = nativeGroups.filter((group) => group.agents.some((agent) => agent.id === "claude"));
|
|
45112
44975
|
const otherGroups = nativeGroups.filter((group) => !group.agents.some((agent) => agent.id === "claude"));
|
|
@@ -45220,7 +45083,7 @@ async function interactiveAgentSelect(pluginManager3, agentManager12, projectPat
|
|
|
45220
45083
|
init_colors();
|
|
45221
45084
|
init_logger();
|
|
45222
45085
|
init_installLock();
|
|
45223
|
-
import {resolve as
|
|
45086
|
+
import {resolve as resolve16} from "path";
|
|
45224
45087
|
var formatTimestamp = function(iso) {
|
|
45225
45088
|
const date = new Date(iso);
|
|
45226
45089
|
return date.toLocaleDateString("en-US", {
|
|
@@ -45250,7 +45113,7 @@ function registerLockCommand(program2) {
|
|
|
45250
45113
|
if (options2.kind)
|
|
45251
45114
|
queryOptions.kind = options2.kind;
|
|
45252
45115
|
if (options2.project)
|
|
45253
|
-
queryOptions.projectPath =
|
|
45116
|
+
queryOptions.projectPath = resolve16(options2.project);
|
|
45254
45117
|
if (options2.agent)
|
|
45255
45118
|
queryOptions.agent = options2.agent;
|
|
45256
45119
|
if (options2.scope)
|
|
@@ -45358,9 +45221,9 @@ Dry run \u2014 no changes made.`));
|
|
|
45358
45221
|
|
|
45359
45222
|
// dist/core/agentSettings/settingsManager.js
|
|
45360
45223
|
var TOML4 = __toESM(require_toml(), 1);
|
|
45361
|
-
var import_jsonc_parser = __toESM(require_main(), 1);
|
|
45362
45224
|
init_fs();
|
|
45363
45225
|
init_userConfig();
|
|
45226
|
+
import {parse as parseJsonc} from "jsonc-parser";
|
|
45364
45227
|
|
|
45365
45228
|
// dist/core/agentSettings/valueParser.js
|
|
45366
45229
|
var parseJsonValue = function(raw, key) {
|
|
@@ -45444,7 +45307,7 @@ var FALSE_VALUES = new Set(["false", "off", "no", "0"]);
|
|
|
45444
45307
|
|
|
45445
45308
|
// dist/core/agentSettings/adapters/claude.js
|
|
45446
45309
|
init_paths();
|
|
45447
|
-
import {join as
|
|
45310
|
+
import {join as join11} from "path";
|
|
45448
45311
|
var setting = function(key, valueType, title, description, options2 = {}) {
|
|
45449
45312
|
const definition = {
|
|
45450
45313
|
agent: "claude",
|
|
@@ -45721,16 +45584,16 @@ var claudeSettingsAdapter = {
|
|
|
45721
45584
|
case "global":
|
|
45722
45585
|
return expandTilde("~/.claude/settings.json");
|
|
45723
45586
|
case "project":
|
|
45724
|
-
return
|
|
45587
|
+
return join11(projectPath, ".claude", "settings.json");
|
|
45725
45588
|
case "local":
|
|
45726
|
-
return
|
|
45589
|
+
return join11(projectPath, ".claude", "settings.local.json");
|
|
45727
45590
|
}
|
|
45728
45591
|
}
|
|
45729
45592
|
};
|
|
45730
45593
|
|
|
45731
45594
|
// dist/core/agentSettings/adapters/codex.js
|
|
45732
45595
|
init_paths();
|
|
45733
|
-
import {join as
|
|
45596
|
+
import {join as join12} from "path";
|
|
45734
45597
|
var setting2 = function(key, valueType, title, description, options2 = {}) {
|
|
45735
45598
|
const definition = {
|
|
45736
45599
|
agent: "codex",
|
|
@@ -45843,9 +45706,9 @@ var codexSettingsAdapter = {
|
|
|
45843
45706
|
case "global":
|
|
45844
45707
|
return expandTilde("~/.codex/config.toml");
|
|
45845
45708
|
case "project":
|
|
45846
|
-
return
|
|
45709
|
+
return join12(projectPath, ".codex", "config.toml");
|
|
45847
45710
|
case "local":
|
|
45848
|
-
return
|
|
45711
|
+
return join12(projectPath, ".codex", "config.toml");
|
|
45849
45712
|
}
|
|
45850
45713
|
}
|
|
45851
45714
|
};
|
|
@@ -45853,7 +45716,7 @@ var codexSettingsAdapter = {
|
|
|
45853
45716
|
// dist/core/agentSettings/adapters/opencode.js
|
|
45854
45717
|
init_paths();
|
|
45855
45718
|
import {existsSync as existsSync3} from "fs";
|
|
45856
|
-
import {join as
|
|
45719
|
+
import {join as join13} from "path";
|
|
45857
45720
|
var firstExistingPath = function(paths9, fallback2) {
|
|
45858
45721
|
return paths9.find((candidate) => existsSync3(candidate)) ?? fallback2;
|
|
45859
45722
|
};
|
|
@@ -45976,9 +45839,9 @@ var opencodeSettingsAdapter = {
|
|
|
45976
45839
|
], expandTilde("~/.config/opencode/opencode.json"));
|
|
45977
45840
|
case "project":
|
|
45978
45841
|
return firstExistingPath([
|
|
45979
|
-
|
|
45980
|
-
|
|
45981
|
-
],
|
|
45842
|
+
join13(projectPath, ".opencode", "opencode.jsonc"),
|
|
45843
|
+
join13(projectPath, ".opencode", "opencode.json")
|
|
45844
|
+
], join13(projectPath, ".opencode", "opencode.json"));
|
|
45982
45845
|
case "local":
|
|
45983
45846
|
throw new Error("OpenCode settings do not support local scope. Use --global or --project.");
|
|
45984
45847
|
}
|
|
@@ -46246,7 +46109,7 @@ async function readConfigObject(adapter, path) {
|
|
|
46246
46109
|
}
|
|
46247
46110
|
try {
|
|
46248
46111
|
const errors5 = [];
|
|
46249
|
-
const value = adapter.format === "jsonc" ?
|
|
46112
|
+
const value = adapter.format === "jsonc" ? parseJsonc(content, errors5, { allowTrailingComma: true }) : JSON.parse(content);
|
|
46250
46113
|
if (errors5.length > 0) {
|
|
46251
46114
|
throw new SyntaxError("Invalid JSONC");
|
|
46252
46115
|
}
|
|
@@ -46264,6 +46127,18 @@ var stringifyConfigObject = function(adapter, config) {
|
|
|
46264
46127
|
}
|
|
46265
46128
|
return `${JSON.stringify(config, null, 2)}\n`;
|
|
46266
46129
|
};
|
|
46130
|
+
var summarizeSettingValue = function(value) {
|
|
46131
|
+
if (value === undefined) {
|
|
46132
|
+
return "not set";
|
|
46133
|
+
}
|
|
46134
|
+
if (Array.isArray(value)) {
|
|
46135
|
+
return `set (array, ${value.length} item${value.length === 1 ? "" : "s"})`;
|
|
46136
|
+
}
|
|
46137
|
+
if (value && typeof value === "object") {
|
|
46138
|
+
return "set (object)";
|
|
46139
|
+
}
|
|
46140
|
+
return JSON.stringify(value);
|
|
46141
|
+
};
|
|
46267
46142
|
async function writeConfigObject(adapter, path, config) {
|
|
46268
46143
|
await writeFile(path, stringifyConfigObject(adapter, config));
|
|
46269
46144
|
}
|
|
@@ -46324,6 +46199,50 @@ class AgentSettingsManager {
|
|
|
46324
46199
|
settings: adapter.definitions.map(toSchemaEntry)
|
|
46325
46200
|
};
|
|
46326
46201
|
}
|
|
46202
|
+
async listSettings(agent, options2 = {}) {
|
|
46203
|
+
const adapter = getAgentSettingsAdapter(agent);
|
|
46204
|
+
if (!adapter) {
|
|
46205
|
+
throw new Error(`Unsupported agent settings adapter: ${agent}. Supported: ${this.getSupportedAgents().join(", ")}`);
|
|
46206
|
+
}
|
|
46207
|
+
const scope = resolveFullReadScope(adapter, options2.scope);
|
|
46208
|
+
const projectPath = resolveProjectPath(options2.projectPath);
|
|
46209
|
+
const configByPath = new Map;
|
|
46210
|
+
const readConfigForDefinition = async (definition) => {
|
|
46211
|
+
const path = adapter.getSettingsPath(scope, projectPath, definition);
|
|
46212
|
+
const cached = configByPath.get(path);
|
|
46213
|
+
if (cached) {
|
|
46214
|
+
return cached;
|
|
46215
|
+
}
|
|
46216
|
+
const config = await readConfigObject(adapter, path);
|
|
46217
|
+
configByPath.set(path, config);
|
|
46218
|
+
return config;
|
|
46219
|
+
};
|
|
46220
|
+
const settings = [];
|
|
46221
|
+
for (const definition of adapter.definitions) {
|
|
46222
|
+
const schemaEntry = toSchemaEntry(definition);
|
|
46223
|
+
if (!definition.scopes.includes(scope)) {
|
|
46224
|
+
settings.push({
|
|
46225
|
+
...schemaEntry,
|
|
46226
|
+
currentStatus: "not-applicable",
|
|
46227
|
+
currentSummary: "n/a"
|
|
46228
|
+
});
|
|
46229
|
+
continue;
|
|
46230
|
+
}
|
|
46231
|
+
const config = await readConfigForDefinition(definition);
|
|
46232
|
+
const value = getNestedValue(config, definition.nativePath);
|
|
46233
|
+
settings.push({
|
|
46234
|
+
...schemaEntry,
|
|
46235
|
+
currentStatus: value === undefined ? "not-set" : "set",
|
|
46236
|
+
currentSummary: summarizeSettingValue(value)
|
|
46237
|
+
});
|
|
46238
|
+
}
|
|
46239
|
+
return {
|
|
46240
|
+
agent: adapter.agent,
|
|
46241
|
+
displayName: adapter.displayName,
|
|
46242
|
+
scope,
|
|
46243
|
+
settings
|
|
46244
|
+
};
|
|
46245
|
+
}
|
|
46327
46246
|
async get(agent, key, options2 = {}) {
|
|
46328
46247
|
const adapter = getAgentSettingsAdapter(agent);
|
|
46329
46248
|
if (!adapter) {
|
|
@@ -46611,6 +46530,14 @@ var printValue = function(value) {
|
|
|
46611
46530
|
}
|
|
46612
46531
|
printJson(value);
|
|
46613
46532
|
};
|
|
46533
|
+
var buildSettingFlags = function(setting4) {
|
|
46534
|
+
return [
|
|
46535
|
+
setting4.valueType,
|
|
46536
|
+
setting4.category,
|
|
46537
|
+
setting4.risk !== "safe" ? setting4.risk : null,
|
|
46538
|
+
setting4.deprecated ? `use ${setting4.replacement}` : null
|
|
46539
|
+
].filter(Boolean).join(", ");
|
|
46540
|
+
};
|
|
46614
46541
|
var buildSetOptions = function(options2) {
|
|
46615
46542
|
const result = {};
|
|
46616
46543
|
const scope = resolveScopeOption(options2);
|
|
@@ -46833,7 +46760,7 @@ function registerAgentCommand(program2) {
|
|
|
46833
46760
|
failAgentCommand(error);
|
|
46834
46761
|
}
|
|
46835
46762
|
});
|
|
46836
|
-
agent.command("list [agent]").description("List supported agents or setting keys for one agent").option("--json", "Print JSON output").action((agentId, options2) => {
|
|
46763
|
+
agent.command("list [agent]").description("List supported agents or setting keys for one agent").option("--global", "Read global user settings").option("--project", "Read shared project settings").option("--local", "Read local project settings").option("--json", "Print JSON output").option("--details", "Print detailed setting metadata with safe current-value summaries").action(async (agentId, options2) => {
|
|
46837
46764
|
try {
|
|
46838
46765
|
if (!agentId) {
|
|
46839
46766
|
const agents = manager.getSupportedAgents();
|
|
@@ -46848,11 +46775,21 @@ function registerAgentCommand(program2) {
|
|
|
46848
46775
|
const schema2 = manager.getSchema(agentId);
|
|
46849
46776
|
const keys = schema2.settings.map((setting4) => setting4.key);
|
|
46850
46777
|
if (options2.json) {
|
|
46778
|
+
if (options2.details) {
|
|
46779
|
+
const list2 = await manager.listSettings(agentId, buildReadOptions(options2));
|
|
46780
|
+
printJson(list2.settings);
|
|
46781
|
+
return;
|
|
46782
|
+
}
|
|
46851
46783
|
printJson(keys);
|
|
46852
46784
|
return;
|
|
46853
46785
|
}
|
|
46786
|
+
const list = await manager.listSettings(agentId, buildReadOptions(options2));
|
|
46854
46787
|
logger.titleBox(`AgentInit ${agentId} Settings`);
|
|
46855
|
-
|
|
46788
|
+
logger.info(`Scope: ${cyan(list.scope)}`);
|
|
46789
|
+
list.settings.forEach((setting4, index) => {
|
|
46790
|
+
const flags = buildSettingFlags(setting4);
|
|
46791
|
+
logger.tree(`${cyan(setting4.key)} ${dim(`[${flags}]`)} ${setting4.description} ${dim(`current: ${setting4.currentSummary}`)}`, index === list.settings.length - 1);
|
|
46792
|
+
});
|
|
46856
46793
|
} catch (error) {
|
|
46857
46794
|
failAgentCommand(error);
|
|
46858
46795
|
}
|
|
@@ -46867,12 +46804,7 @@ function registerAgentCommand(program2) {
|
|
|
46867
46804
|
logger.titleBox(`AgentInit ${schema2.displayName} Schema`);
|
|
46868
46805
|
logger.info(`Default omitted scope: ${cyan(schema2.effectiveDefaultScope)}`);
|
|
46869
46806
|
for (const setting4 of schema2.settings) {
|
|
46870
|
-
const flags =
|
|
46871
|
-
setting4.valueType,
|
|
46872
|
-
setting4.category,
|
|
46873
|
-
setting4.risk !== "safe" ? setting4.risk : null,
|
|
46874
|
-
setting4.deprecated ? `use ${setting4.replacement}` : null
|
|
46875
|
-
].filter(Boolean).join(", ");
|
|
46807
|
+
const flags = buildSettingFlags(setting4);
|
|
46876
46808
|
logger.tree(`${cyan(setting4.key)} ${dim(`[${flags}]`)} ${setting4.description}`, false);
|
|
46877
46809
|
}
|
|
46878
46810
|
} catch (error) {
|
|
@@ -46884,7 +46816,7 @@ function registerAgentCommand(program2) {
|
|
|
46884
46816
|
// dist/cli.js
|
|
46885
46817
|
init_logger();
|
|
46886
46818
|
var program2 = new Command;
|
|
46887
|
-
program2.name("agentinit").description("A CLI tool for managing and configuring AI coding agents").version(
|
|
46819
|
+
program2.name("agentinit").description("A CLI tool for managing and configuring AI coding agents").version(getOwnPackageVersion());
|
|
46888
46820
|
registerSkillsCommand(program2);
|
|
46889
46821
|
registerMcpCommand(program2);
|
|
46890
46822
|
registerRulesCommand(program2);
|