agentsmesh 0.8.0 → 0.10.0
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 +66 -0
- package/README.md +192 -107
- package/dist/canonical.d.ts +2 -2
- package/dist/canonical.js +1121 -390
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +126 -121
- package/dist/engine.d.ts +2 -2
- package/dist/engine.js +1241 -509
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1254 -521
- package/dist/index.js.map +1 -1
- package/dist/{schema-BeGiBqbB.d.ts → schema-qelg8gw8.d.ts} +2 -0
- package/dist/{target-descriptor-Cb9PXaxr.d.ts → target-descriptor-Dhdg8s2o.d.ts} +3 -2
- package/dist/targets.d.ts +22 -4
- package/dist/targets.js +1091 -389
- package/dist/targets.js.map +1 -1
- package/package.json +3 -3
- package/schemas/agentsmesh.json +3 -0
- package/schemas/pack.json +1 -0
package/dist/targets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { readFile, readdir, stat, mkdir, lstat, writeFile, rename, rm, realpath, access } from 'fs/promises';
|
|
3
|
-
import { basename, join,
|
|
2
|
+
import { readFile, readdir, stat, mkdir, lstat, unlink, writeFile, rename, rm, realpath, access } from 'fs/promises';
|
|
3
|
+
import { basename, join, win32, posix, relative, dirname, extname } from 'path';
|
|
4
4
|
import { existsSync, realpathSync, constants, statSync } from 'fs';
|
|
5
5
|
import { stringify, parse } from 'yaml';
|
|
6
6
|
import { parse as parse$1 } from 'smol-toml';
|
|
@@ -11,35 +11,35 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
11
11
|
var __esm = (fn, res) => function __init() {
|
|
12
12
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
13
|
};
|
|
14
|
-
var __export = (
|
|
14
|
+
var __export = (target14, all) => {
|
|
15
15
|
for (var name in all)
|
|
16
|
-
__defProp(
|
|
16
|
+
__defProp(target14, name, { get: all[name], enumerable: true });
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
// src/config/core/conversions.ts
|
|
20
|
-
function usesCommandSkillProjection(
|
|
21
|
-
return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS,
|
|
20
|
+
function usesCommandSkillProjection(target14) {
|
|
21
|
+
return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS, target14);
|
|
22
22
|
}
|
|
23
|
-
function usesAgentSkillProjection(
|
|
24
|
-
return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS,
|
|
23
|
+
function usesAgentSkillProjection(target14) {
|
|
24
|
+
return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS, target14);
|
|
25
25
|
}
|
|
26
26
|
function resolveConversionValue(value, scope) {
|
|
27
27
|
if (value === void 0) return void 0;
|
|
28
28
|
if (typeof value === "boolean") return value;
|
|
29
29
|
return value[scope];
|
|
30
30
|
}
|
|
31
|
-
function shouldConvertCommandsToSkills(config,
|
|
32
|
-
const raw = config.conversions?.commands_to_skills?.[
|
|
31
|
+
function shouldConvertCommandsToSkills(config, target14, defaultEnabled, scope = "project") {
|
|
32
|
+
const raw = config.conversions?.commands_to_skills?.[target14];
|
|
33
33
|
const configVal = resolveConversionValue(raw, scope);
|
|
34
34
|
if (configVal !== void 0) return configVal;
|
|
35
|
-
if (usesCommandSkillProjection(
|
|
35
|
+
if (usesCommandSkillProjection(target14)) return DEFAULT_COMMANDS_TO_SKILLS[target14];
|
|
36
36
|
return defaultEnabled ?? false;
|
|
37
37
|
}
|
|
38
|
-
function shouldConvertAgentsToSkills(config,
|
|
39
|
-
const raw = config.conversions?.agents_to_skills?.[
|
|
38
|
+
function shouldConvertAgentsToSkills(config, target14, defaultEnabled, scope = "project") {
|
|
39
|
+
const raw = config.conversions?.agents_to_skills?.[target14];
|
|
40
40
|
const configVal = resolveConversionValue(raw, scope);
|
|
41
41
|
if (configVal !== void 0) return configVal;
|
|
42
|
-
if (usesAgentSkillProjection(
|
|
42
|
+
if (usesAgentSkillProjection(target14)) return DEFAULT_AGENTS_TO_SKILLS[target14];
|
|
43
43
|
return defaultEnabled ?? false;
|
|
44
44
|
}
|
|
45
45
|
var DEFAULT_COMMANDS_TO_SKILLS, DEFAULT_AGENTS_TO_SKILLS;
|
|
@@ -92,12 +92,12 @@ function capabilityLevel(capability) {
|
|
|
92
92
|
function canUseScopedSettings(feature) {
|
|
93
93
|
return settingsBackedFeatures.includes(feature);
|
|
94
94
|
}
|
|
95
|
-
function validateCapabilityImplementations(
|
|
95
|
+
function validateCapabilityImplementations(descriptor14, capabilities2, ctx, pathPrefix) {
|
|
96
96
|
for (const requirement of generatorRequirements) {
|
|
97
|
-
const level = capabilityLevel(
|
|
97
|
+
const level = capabilityLevel(capabilities2[requirement.feature]);
|
|
98
98
|
if (level === "none") continue;
|
|
99
|
-
const hasGenerator = typeof
|
|
100
|
-
const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof
|
|
99
|
+
const hasGenerator = typeof descriptor14.generators[requirement.generator] === "function";
|
|
100
|
+
const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof descriptor14.emitScopedSettings === "function";
|
|
101
101
|
if (hasGenerator || hasSettingsEmitter) continue;
|
|
102
102
|
ctx.addIssue({
|
|
103
103
|
code: "custom",
|
|
@@ -212,8 +212,8 @@ function builtinDescriptors() {
|
|
|
212
212
|
}
|
|
213
213
|
return _builtinDescriptors;
|
|
214
214
|
}
|
|
215
|
-
function registerTargetDescriptor(
|
|
216
|
-
const validated = validateDescriptor(
|
|
215
|
+
function registerTargetDescriptor(descriptor14) {
|
|
216
|
+
const validated = validateDescriptor(descriptor14);
|
|
217
217
|
descriptorRegistry.set(validated.id, validated);
|
|
218
218
|
}
|
|
219
219
|
function getDescriptor(name) {
|
|
@@ -234,11 +234,11 @@ var init_registry = __esm({
|
|
|
234
234
|
// src/targets/catalog/shared-artifact-owner.ts
|
|
235
235
|
function findSharedArtifactOwnershipConflicts(descriptors) {
|
|
236
236
|
const owners = [];
|
|
237
|
-
for (const
|
|
238
|
-
if (!
|
|
239
|
-
for (const [prefix, role] of Object.entries(
|
|
237
|
+
for (const descriptor14 of descriptors) {
|
|
238
|
+
if (!descriptor14.sharedArtifacts) continue;
|
|
239
|
+
for (const [prefix, role] of Object.entries(descriptor14.sharedArtifacts)) {
|
|
240
240
|
if (role !== "owner") continue;
|
|
241
|
-
owners.push({ targetId:
|
|
241
|
+
owners.push({ targetId: descriptor14.id, prefix });
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
const conflicts = [];
|
|
@@ -289,6 +289,7 @@ var init_builtin_target_ids_generated = __esm({
|
|
|
289
289
|
"cursor",
|
|
290
290
|
"gemini-cli",
|
|
291
291
|
"junie",
|
|
292
|
+
"kilo-code",
|
|
292
293
|
"kiro",
|
|
293
294
|
"roo-code",
|
|
294
295
|
"windsurf"
|
|
@@ -364,6 +365,11 @@ async function writeFileAtomic(path, content) {
|
|
|
364
365
|
{ errnoCode: "EISDIR" }
|
|
365
366
|
);
|
|
366
367
|
}
|
|
368
|
+
if (info.isSymbolicLink()) {
|
|
369
|
+
await unlink(path).catch((e) => {
|
|
370
|
+
if (e.code !== "ENOENT") throw e;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
367
373
|
} catch (err) {
|
|
368
374
|
if (err instanceof FileSystemError) throw err;
|
|
369
375
|
const e = err;
|
|
@@ -372,7 +378,15 @@ async function writeFileAtomic(path, content) {
|
|
|
372
378
|
const tmpPath = `${path}.tmp`;
|
|
373
379
|
const payload = shouldNormalizeLineEndings(path) ? normalizeLineEndings(content) : content;
|
|
374
380
|
try {
|
|
375
|
-
|
|
381
|
+
try {
|
|
382
|
+
const tmpInfo = await lstat(tmpPath);
|
|
383
|
+
if (tmpInfo.isSymbolicLink()) {
|
|
384
|
+
await unlink(tmpPath);
|
|
385
|
+
}
|
|
386
|
+
} catch (tmpErr) {
|
|
387
|
+
if (tmpErr.code !== "ENOENT") throw tmpErr;
|
|
388
|
+
}
|
|
389
|
+
await writeFile(tmpPath, payload, { encoding: "utf-8", flag: "w" });
|
|
376
390
|
await rename(tmpPath, path);
|
|
377
391
|
} catch (err) {
|
|
378
392
|
await rm(tmpPath, { force: true }).catch(() => {
|
|
@@ -980,21 +994,6 @@ var init_generator = __esm({
|
|
|
980
994
|
init_constants();
|
|
981
995
|
}
|
|
982
996
|
});
|
|
983
|
-
|
|
984
|
-
// src/core/reference/import-map.ts
|
|
985
|
-
async function buildImportReferenceMap(target13, projectRoot, scope = "project") {
|
|
986
|
-
const refs = /* @__PURE__ */ new Map();
|
|
987
|
-
const def = getDescriptor(target13);
|
|
988
|
-
if (def) {
|
|
989
|
-
await def.buildImportPaths(refs, projectRoot, scope);
|
|
990
|
-
}
|
|
991
|
-
return refs;
|
|
992
|
-
}
|
|
993
|
-
var init_import_map = __esm({
|
|
994
|
-
"src/core/reference/import-map.ts"() {
|
|
995
|
-
init_registry();
|
|
996
|
-
}
|
|
997
|
-
});
|
|
998
997
|
function pathApi(projectRoot) {
|
|
999
998
|
return projectRoot.includes("\\") || WINDOWS_ABSOLUTE_PATH.test(projectRoot) ? win32 : posix;
|
|
1000
999
|
}
|
|
@@ -1033,13 +1032,28 @@ var init_path_helpers = __esm({
|
|
|
1033
1032
|
}
|
|
1034
1033
|
});
|
|
1035
1034
|
|
|
1035
|
+
// src/core/reference/import-map.ts
|
|
1036
|
+
async function buildImportReferenceMap(target14, projectRoot, scope = "project") {
|
|
1037
|
+
const refs = /* @__PURE__ */ new Map();
|
|
1038
|
+
const def = getDescriptor(target14);
|
|
1039
|
+
if (def) {
|
|
1040
|
+
await def.buildImportPaths(refs, projectRoot, scope);
|
|
1041
|
+
}
|
|
1042
|
+
return refs;
|
|
1043
|
+
}
|
|
1044
|
+
var init_import_map = __esm({
|
|
1045
|
+
"src/core/reference/import-map.ts"() {
|
|
1046
|
+
init_registry();
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1036
1050
|
// src/core/reference/link-format-registry.ts
|
|
1037
|
-
function topLevelDotfilePrefixes(
|
|
1038
|
-
const layouts = [
|
|
1051
|
+
function topLevelDotfilePrefixes(descriptor14) {
|
|
1052
|
+
const layouts = [descriptor14.project, descriptor14.globalSupport?.layout].filter(
|
|
1039
1053
|
(l) => l !== void 0
|
|
1040
1054
|
);
|
|
1041
1055
|
const candidates = [
|
|
1042
|
-
...
|
|
1056
|
+
...descriptor14.detectionPaths,
|
|
1043
1057
|
...layouts.flatMap((l) => l.managedOutputs?.dirs ?? []),
|
|
1044
1058
|
...layouts.flatMap((l) => l.managedOutputs?.files ?? [])
|
|
1045
1059
|
];
|
|
@@ -1052,8 +1066,8 @@ function topLevelDotfilePrefixes(descriptor13) {
|
|
|
1052
1066
|
}
|
|
1053
1067
|
function buildDefaultRootRelativePrefixes() {
|
|
1054
1068
|
const set = /* @__PURE__ */ new Set([".agentsmesh/"]);
|
|
1055
|
-
for (const
|
|
1056
|
-
for (const prefix of topLevelDotfilePrefixes(
|
|
1069
|
+
for (const descriptor14 of BUILTIN_TARGETS) {
|
|
1070
|
+
for (const prefix of topLevelDotfilePrefixes(descriptor14)) set.add(prefix);
|
|
1057
1071
|
}
|
|
1058
1072
|
return Array.from(set);
|
|
1059
1073
|
}
|
|
@@ -1124,7 +1138,7 @@ function resolveProjectPath(token, projectRoot, sourceFile) {
|
|
|
1124
1138
|
}
|
|
1125
1139
|
return [windowsToken];
|
|
1126
1140
|
}
|
|
1127
|
-
if (isAbsolute(token)) {
|
|
1141
|
+
if (api.isAbsolute(token)) {
|
|
1128
1142
|
const absoluteToken = normalizeForProject(projectRoot, token);
|
|
1129
1143
|
if (absoluteToken.startsWith(normalizedProjectRoot) || existsSync(token))
|
|
1130
1144
|
return [absoluteToken];
|
|
@@ -1230,9 +1244,14 @@ var init_link_rebaser_helpers = __esm({
|
|
|
1230
1244
|
LINE_NUMBER_SUFFIX = /(?::(\d+)){1,2}$/;
|
|
1231
1245
|
}
|
|
1232
1246
|
});
|
|
1247
|
+
|
|
1248
|
+
// src/core/reference/link-rebaser-formatting.ts
|
|
1233
1249
|
function isReadingContext(context) {
|
|
1234
1250
|
return context === void 0 || context.role === "inline-code" || context.role === "bracketed" || context.role === "quoted" || context.role === "at-prefix" || context.role === "bracket-label" || context.role === "bare-prose";
|
|
1235
1251
|
}
|
|
1252
|
+
function isReadingContextOptions(options) {
|
|
1253
|
+
return isReadingContext(options.tokenContext);
|
|
1254
|
+
}
|
|
1236
1255
|
function isUnderProjectRoot(projectRoot, absolutePath) {
|
|
1237
1256
|
const api = pathApi(projectRoot);
|
|
1238
1257
|
const root = normalizeForProject(projectRoot, projectRoot);
|
|
@@ -1272,11 +1291,6 @@ function toProjectRootRelative(projectRoot, absolutePath, keepSlash) {
|
|
|
1272
1291
|
const rewritten = relPath.length > 0 ? relPath : ".";
|
|
1273
1292
|
return keepSlash && !rewritten.endsWith("/") ? `${rewritten}/` : rewritten;
|
|
1274
1293
|
}
|
|
1275
|
-
function shouldPreserveAgentsMeshAnchor(_projectRoot, _destinationFile, options) {
|
|
1276
|
-
if (!isReadingContext(options.tokenContext)) return false;
|
|
1277
|
-
if (options.originalToken === void 0) return false;
|
|
1278
|
-
return normalizeSeparators(options.originalToken).startsWith(".agentsmesh/");
|
|
1279
|
-
}
|
|
1280
1294
|
function toProjectRootReference(projectRoot, absolutePath, keepSlash) {
|
|
1281
1295
|
const formatted = toProjectRootRelative(projectRoot, absolutePath, keepSlash);
|
|
1282
1296
|
if (formatted === null) return null;
|
|
@@ -1286,21 +1300,21 @@ function formatLinkPathForDestinationLegacy(projectRoot, destinationFile, absolu
|
|
|
1286
1300
|
const api = pathApi(projectRoot);
|
|
1287
1301
|
const root = normalizeForProject(projectRoot, projectRoot);
|
|
1288
1302
|
const destFile = normalizeForProject(projectRoot, destinationFile);
|
|
1289
|
-
const
|
|
1290
|
-
if (!isUnderProjectRoot(projectRoot,
|
|
1291
|
-
return toProjectRootReference(projectRoot,
|
|
1303
|
+
const target14 = normalizeForProject(projectRoot, absoluteTargetPath);
|
|
1304
|
+
if (!isUnderProjectRoot(projectRoot, target14)) {
|
|
1305
|
+
return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
|
|
1292
1306
|
}
|
|
1293
|
-
const destDir = normalizeForProject(projectRoot, dirname(destFile));
|
|
1307
|
+
const destDir = normalizeForProject(projectRoot, api.dirname(destFile));
|
|
1294
1308
|
if (!isUnderProjectRoot(projectRoot, destDir) && destDir !== root) {
|
|
1295
|
-
return toProjectRootReference(projectRoot,
|
|
1309
|
+
return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
|
|
1296
1310
|
}
|
|
1297
|
-
let rel2 = api.relative(destDir,
|
|
1311
|
+
let rel2 = api.relative(destDir, target14).replace(/\\/g, "/");
|
|
1298
1312
|
if (api.isAbsolute(rel2) || WINDOWS_ABSOLUTE_PATH.test(rel2)) {
|
|
1299
|
-
return toProjectRootRelative(projectRoot,
|
|
1313
|
+
return toProjectRootRelative(projectRoot, target14, keepSlash);
|
|
1300
1314
|
}
|
|
1301
1315
|
const joined = normalizeForProject(projectRoot, api.join(destDir, rel2));
|
|
1302
1316
|
if (!isUnderProjectRoot(projectRoot, joined)) {
|
|
1303
|
-
return toProjectRootRelative(projectRoot,
|
|
1317
|
+
return toProjectRootRelative(projectRoot, target14, keepSlash);
|
|
1304
1318
|
}
|
|
1305
1319
|
if (rel2 === "" || rel2 === ".") {
|
|
1306
1320
|
rel2 = ".";
|
|
@@ -1319,9 +1333,14 @@ var init_link_rebaser_formatting = __esm({
|
|
|
1319
1333
|
// src/core/reference/link-rebaser-output.ts
|
|
1320
1334
|
function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTargetPath, keepSlash, options = {}) {
|
|
1321
1335
|
const scope = options.scope ?? "project";
|
|
1322
|
-
const
|
|
1323
|
-
if (
|
|
1324
|
-
|
|
1336
|
+
const target14 = normalizeForProject(projectRoot, absoluteTargetPath);
|
|
1337
|
+
if (isReadingContextOptions(options) && isUnderAgentsMesh(projectRoot, destinationFile) && isUnderAgentsMesh(projectRoot, target14)) {
|
|
1338
|
+
const api = pathApi(projectRoot);
|
|
1339
|
+
const root = normalizeForProject(projectRoot, projectRoot);
|
|
1340
|
+
const rel2 = api.relative(root, target14).replace(/\\/g, "/");
|
|
1341
|
+
if (!rel2.startsWith("..") && rel2.length > 0) {
|
|
1342
|
+
return keepSlash && !rel2.endsWith("/") ? `${rel2}/` : rel2;
|
|
1343
|
+
}
|
|
1325
1344
|
}
|
|
1326
1345
|
if (options.forceRelative) {
|
|
1327
1346
|
return formatLinkPathForDestinationLegacy(
|
|
@@ -1333,10 +1352,10 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
|
|
|
1333
1352
|
);
|
|
1334
1353
|
}
|
|
1335
1354
|
if (scope === "global" && !isUnderAgentsMesh(projectRoot, destinationFile)) {
|
|
1336
|
-
return toProjectRootReference(projectRoot,
|
|
1355
|
+
return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
|
|
1337
1356
|
}
|
|
1338
1357
|
const meshCanonicalForShape = (() => {
|
|
1339
|
-
if (isUnderAgentsMesh(projectRoot,
|
|
1358
|
+
if (isUnderAgentsMesh(projectRoot, target14)) return target14;
|
|
1340
1359
|
const logical = options.logicalMeshSourceAbsolute;
|
|
1341
1360
|
if (logical && isUnderAgentsMesh(projectRoot, normalizeForProject(projectRoot, logical))) {
|
|
1342
1361
|
return normalizeForProject(projectRoot, logical);
|
|
@@ -1344,9 +1363,9 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
|
|
|
1344
1363
|
return null;
|
|
1345
1364
|
})();
|
|
1346
1365
|
if (!meshCanonicalForShape) {
|
|
1347
|
-
return toProjectRootReference(projectRoot,
|
|
1366
|
+
return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
|
|
1348
1367
|
}
|
|
1349
|
-
const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(
|
|
1368
|
+
const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(target14) ?? false);
|
|
1350
1369
|
if (treatAsDirectory) {
|
|
1351
1370
|
const meshRelative = toAgentsMeshRootRelative(projectRoot, meshCanonicalForShape, keepSlash);
|
|
1352
1371
|
if (meshRelative !== null) return meshRelative;
|
|
@@ -1370,7 +1389,7 @@ var init_link_rebaser_output = __esm({
|
|
|
1370
1389
|
});
|
|
1371
1390
|
|
|
1372
1391
|
// src/core/reference/link-rebaser-suffix-strip.ts
|
|
1373
|
-
function resolveByDestinationSuffixStrip(token, projectRoot, destinationFile,
|
|
1392
|
+
function resolveByDestinationSuffixStrip(token, projectRoot, destinationFile, pathExists2) {
|
|
1374
1393
|
const api = pathApi(projectRoot);
|
|
1375
1394
|
const normalizedToken = normalizeSeparators(token);
|
|
1376
1395
|
if (!isRootRelativePathToken(normalizedToken)) return null;
|
|
@@ -1382,7 +1401,7 @@ function resolveByDestinationSuffixStrip(token, projectRoot, destinationFile, pa
|
|
|
1382
1401
|
const suffix = segments.slice(i).join("/");
|
|
1383
1402
|
const candidate = normalizeForProject(projectRoot, api.join(destDir, suffix));
|
|
1384
1403
|
if (candidate === destFilePath) continue;
|
|
1385
|
-
if (
|
|
1404
|
+
if (pathExists2(candidate)) return candidate;
|
|
1386
1405
|
}
|
|
1387
1406
|
return null;
|
|
1388
1407
|
}
|
|
@@ -1699,22 +1718,23 @@ var init_link_rebaser = __esm({
|
|
|
1699
1718
|
init_link_token_context();
|
|
1700
1719
|
}
|
|
1701
1720
|
});
|
|
1702
|
-
function pathVariants(path) {
|
|
1703
|
-
const variants = [normalize(path)];
|
|
1721
|
+
function pathVariants(api, path) {
|
|
1722
|
+
const variants = [api.normalize(path)];
|
|
1704
1723
|
if (!existsSync(path)) return variants;
|
|
1705
1724
|
try {
|
|
1706
1725
|
const realPaths = [realpathSync(path), realpathSync.native(path)];
|
|
1707
1726
|
for (const realPath of realPaths) {
|
|
1708
|
-
const normalized = normalize(realPath);
|
|
1727
|
+
const normalized = api.normalize(realPath);
|
|
1709
1728
|
if (!variants.includes(normalized)) variants.push(normalized);
|
|
1710
1729
|
}
|
|
1711
1730
|
} catch {
|
|
1712
1731
|
}
|
|
1713
1732
|
return variants;
|
|
1714
1733
|
}
|
|
1715
|
-
async function createImportReferenceNormalizer(
|
|
1734
|
+
async function createImportReferenceNormalizer(target14, projectRoot, scope = "project") {
|
|
1735
|
+
const api = pathApi(projectRoot);
|
|
1716
1736
|
const refs = /* @__PURE__ */ new Map();
|
|
1717
|
-
const targets = Array.from(/* @__PURE__ */ new Set([
|
|
1737
|
+
const targets = Array.from(/* @__PURE__ */ new Set([target14, ...TARGET_IDS]));
|
|
1718
1738
|
for (const candidate of targets) {
|
|
1719
1739
|
const candidateRefs = await buildImportReferenceMap(candidate, projectRoot, scope);
|
|
1720
1740
|
for (const [targetPath, canonicalPath] of candidateRefs.entries()) {
|
|
@@ -1723,17 +1743,17 @@ async function createImportReferenceNormalizer(target13, projectRoot, scope = "p
|
|
|
1723
1743
|
}
|
|
1724
1744
|
const artifactMap = /* @__PURE__ */ new Map();
|
|
1725
1745
|
for (const [targetPath, canonicalPath] of refs.entries()) {
|
|
1726
|
-
const canonicalAbsPath = normalize(join(projectRoot, canonicalPath));
|
|
1727
|
-
for (const variant of pathVariants(join(projectRoot, targetPath))) {
|
|
1746
|
+
const canonicalAbsPath = api.normalize(api.join(projectRoot, canonicalPath));
|
|
1747
|
+
for (const variant of pathVariants(api, api.join(projectRoot, targetPath))) {
|
|
1728
1748
|
artifactMap.set(variant, canonicalAbsPath);
|
|
1729
1749
|
}
|
|
1730
1750
|
}
|
|
1731
1751
|
const canonicalDestAbs = /* @__PURE__ */ new Set();
|
|
1732
1752
|
for (const canonicalPath of new Set(refs.values())) {
|
|
1733
|
-
const abs = normalize(join(projectRoot, canonicalPath));
|
|
1753
|
+
const abs = api.normalize(api.join(projectRoot, canonicalPath));
|
|
1734
1754
|
canonicalDestAbs.add(abs);
|
|
1735
|
-
for (const variant of pathVariants(abs)) {
|
|
1736
|
-
canonicalDestAbs.add(normalize(variant));
|
|
1755
|
+
for (const variant of pathVariants(api, abs)) {
|
|
1756
|
+
canonicalDestAbs.add(api.normalize(variant));
|
|
1737
1757
|
}
|
|
1738
1758
|
}
|
|
1739
1759
|
return (content, sourceFile, destinationFile) => rewriteFileLinks({
|
|
@@ -1743,7 +1763,7 @@ async function createImportReferenceNormalizer(target13, projectRoot, scope = "p
|
|
|
1743
1763
|
destinationFile,
|
|
1744
1764
|
translatePath: (absolutePath) => artifactMap.get(absolutePath) ?? absolutePath,
|
|
1745
1765
|
pathExists: (absolutePath) => {
|
|
1746
|
-
const normalized = normalize(absolutePath);
|
|
1766
|
+
const normalized = api.normalize(absolutePath);
|
|
1747
1767
|
return artifactMap.has(absolutePath) || artifactMap.has(normalized) || existsSync(absolutePath) || canonicalDestAbs.has(normalized);
|
|
1748
1768
|
},
|
|
1749
1769
|
explicitCurrentDirLinks: false,
|
|
@@ -1760,11 +1780,43 @@ async function createImportReferenceNormalizer(target13, projectRoot, scope = "p
|
|
|
1760
1780
|
}
|
|
1761
1781
|
var init_import_rewriter = __esm({
|
|
1762
1782
|
"src/core/reference/import-rewriter.ts"() {
|
|
1783
|
+
init_path_helpers();
|
|
1763
1784
|
init_import_map();
|
|
1764
1785
|
init_link_rebaser();
|
|
1765
1786
|
init_target_ids();
|
|
1766
1787
|
}
|
|
1767
1788
|
});
|
|
1789
|
+
async function writeMcpWithMerge(projectRoot, canonicalPath, imported) {
|
|
1790
|
+
const destPath = join(projectRoot, canonicalPath);
|
|
1791
|
+
const existing = await readExistingServers(destPath);
|
|
1792
|
+
const merged = { ...existing, ...imported };
|
|
1793
|
+
await mkdirp(dirname(destPath));
|
|
1794
|
+
await writeFileAtomic(destPath, JSON.stringify({ mcpServers: merged }, null, 2));
|
|
1795
|
+
}
|
|
1796
|
+
async function readExistingServers(path) {
|
|
1797
|
+
const content = await readFileSafe(path);
|
|
1798
|
+
if (content === null) return {};
|
|
1799
|
+
let parsed;
|
|
1800
|
+
try {
|
|
1801
|
+
parsed = JSON.parse(content);
|
|
1802
|
+
} catch {
|
|
1803
|
+
return {};
|
|
1804
|
+
}
|
|
1805
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
1806
|
+
const raw = parsed.mcpServers;
|
|
1807
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
|
|
1808
|
+
const out = {};
|
|
1809
|
+
for (const [name, value] of Object.entries(raw)) {
|
|
1810
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
1811
|
+
out[name] = value;
|
|
1812
|
+
}
|
|
1813
|
+
return out;
|
|
1814
|
+
}
|
|
1815
|
+
var init_mcp_merge = __esm({
|
|
1816
|
+
"src/targets/import/mcp-merge.ts"() {
|
|
1817
|
+
init_fs();
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1768
1820
|
|
|
1769
1821
|
// src/targets/import/shared-import-helpers.ts
|
|
1770
1822
|
function toGlobsArray(v) {
|
|
@@ -2010,18 +2062,24 @@ async function runDirectory(spec, sources, projectRoot, fromTool, normalize) {
|
|
|
2010
2062
|
}
|
|
2011
2063
|
return results;
|
|
2012
2064
|
}
|
|
2065
|
+
function resolveCanonicalFilePath(spec) {
|
|
2066
|
+
const filename = spec.canonicalFilename;
|
|
2067
|
+
if (filename.includes("/") || filename.includes("\\")) return filename;
|
|
2068
|
+
return posix.join(spec.canonicalDir, filename);
|
|
2069
|
+
}
|
|
2013
2070
|
async function runFlatFile(spec, sources, projectRoot, fromTool) {
|
|
2014
2071
|
if (!spec.canonicalFilename) {
|
|
2015
2072
|
throw new Error(`flatFile spec for ${spec.feature} must set canonicalFilename`);
|
|
2016
2073
|
}
|
|
2074
|
+
const canonicalPath = resolveCanonicalFilePath(spec);
|
|
2017
2075
|
for (const rel2 of sources) {
|
|
2018
2076
|
const srcPath = join(projectRoot, rel2);
|
|
2019
2077
|
const content = await readFileSafe(srcPath);
|
|
2020
2078
|
if (content === null) continue;
|
|
2021
|
-
const destPath = join(projectRoot,
|
|
2079
|
+
const destPath = join(projectRoot, canonicalPath);
|
|
2022
2080
|
await mkdirp(dirname(destPath));
|
|
2023
2081
|
await writeFileAtomic(destPath, content.trimEnd());
|
|
2024
|
-
return [{ fromTool, fromPath: srcPath, toPath:
|
|
2082
|
+
return [{ fromTool, fromPath: srcPath, toPath: canonicalPath, feature: spec.feature }];
|
|
2025
2083
|
}
|
|
2026
2084
|
return [];
|
|
2027
2085
|
}
|
|
@@ -2066,24 +2124,19 @@ async function runMcpJson(spec, sources, projectRoot, fromTool) {
|
|
|
2066
2124
|
if (!spec.canonicalFilename) {
|
|
2067
2125
|
throw new Error(`mcpJson spec for ${spec.feature} must set canonicalFilename`);
|
|
2068
2126
|
}
|
|
2127
|
+
const canonicalPath = resolveCanonicalFilePath(spec);
|
|
2069
2128
|
for (const rel2 of sources) {
|
|
2070
2129
|
const srcPath = join(projectRoot, rel2);
|
|
2071
2130
|
const content = await readFileSafe(srcPath);
|
|
2072
2131
|
if (content === null) continue;
|
|
2073
|
-
const
|
|
2074
|
-
if (Object.keys(
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
await writeFileAtomic(destPath, JSON.stringify({ mcpServers: servers }, null, 2));
|
|
2078
|
-
return [{ fromTool, fromPath: srcPath, toPath: spec.canonicalFilename, feature: spec.feature }];
|
|
2132
|
+
const imported = parseMcpJson(content);
|
|
2133
|
+
if (Object.keys(imported).length === 0) return [];
|
|
2134
|
+
await writeMcpWithMerge(projectRoot, canonicalPath, imported);
|
|
2135
|
+
return [{ fromTool, fromPath: srcPath, toPath: canonicalPath, feature: spec.feature }];
|
|
2079
2136
|
}
|
|
2080
2137
|
return [];
|
|
2081
2138
|
}
|
|
2082
|
-
|
|
2083
|
-
const primary = resolveScopedSources(spec.source, scope);
|
|
2084
|
-
const fallback = resolveScopedSources(spec.fallbacks, scope);
|
|
2085
|
-
const sources = primary.length > 0 ? primary : fallback;
|
|
2086
|
-
if (sources.length === 0) return [];
|
|
2139
|
+
function dispatchSpec(spec, sources, projectRoot, fromTool, normalize) {
|
|
2087
2140
|
switch (spec.mode) {
|
|
2088
2141
|
case "singleFile":
|
|
2089
2142
|
return runSingleFile(spec, sources, projectRoot, fromTool, normalize);
|
|
@@ -2095,20 +2148,33 @@ async function runSpec(spec, scope, projectRoot, fromTool, normalize) {
|
|
|
2095
2148
|
return runMcpJson(spec, sources, projectRoot, fromTool);
|
|
2096
2149
|
}
|
|
2097
2150
|
}
|
|
2151
|
+
async function runSpec(spec, scope, projectRoot, fromTool, normalize) {
|
|
2152
|
+
const primary = resolveScopedSources(spec.source, scope);
|
|
2153
|
+
const fallback = resolveScopedSources(spec.fallbacks, scope);
|
|
2154
|
+
if (primary.length === 0 && fallback.length === 0) return [];
|
|
2155
|
+
if (primary.length > 0) {
|
|
2156
|
+
const results = await dispatchSpec(spec, primary, projectRoot, fromTool, normalize);
|
|
2157
|
+
if (results.length > 0) return results;
|
|
2158
|
+
}
|
|
2159
|
+
if (fallback.length > 0) {
|
|
2160
|
+
return dispatchSpec(spec, fallback, projectRoot, fromTool, normalize);
|
|
2161
|
+
}
|
|
2162
|
+
return [];
|
|
2163
|
+
}
|
|
2098
2164
|
function specsForFeature(importer, feature) {
|
|
2099
2165
|
const value = importer[feature];
|
|
2100
2166
|
if (!value) return [];
|
|
2101
2167
|
if (Array.isArray(value)) return value;
|
|
2102
2168
|
return [value];
|
|
2103
2169
|
}
|
|
2104
|
-
async function runDescriptorImport(
|
|
2105
|
-
const importer =
|
|
2170
|
+
async function runDescriptorImport(descriptor14, projectRoot, scope, options) {
|
|
2171
|
+
const importer = descriptor14.importer;
|
|
2106
2172
|
if (!importer) return [];
|
|
2107
|
-
const normalize = options?.normalize ?? await createImportReferenceNormalizer(
|
|
2173
|
+
const normalize = options?.normalize ?? await createImportReferenceNormalizer(descriptor14.id, projectRoot, scope);
|
|
2108
2174
|
const results = [];
|
|
2109
2175
|
for (const feature of IMPORT_FEATURE_ORDER) {
|
|
2110
2176
|
for (const spec of specsForFeature(importer, feature)) {
|
|
2111
|
-
results.push(...await runSpec(spec, scope, projectRoot,
|
|
2177
|
+
results.push(...await runSpec(spec, scope, projectRoot, descriptor14.id, normalize));
|
|
2112
2178
|
}
|
|
2113
2179
|
}
|
|
2114
2180
|
return results;
|
|
@@ -2117,6 +2183,7 @@ var init_descriptor_import_runner = __esm({
|
|
|
2117
2183
|
"src/targets/import/descriptor-import-runner.ts"() {
|
|
2118
2184
|
init_import_rewriter();
|
|
2119
2185
|
init_fs();
|
|
2186
|
+
init_mcp_merge();
|
|
2120
2187
|
init_markdown();
|
|
2121
2188
|
init_shared_import_helpers();
|
|
2122
2189
|
init_import_metadata();
|
|
@@ -2572,22 +2639,22 @@ var init_projected_agent_skill = __esm({
|
|
|
2572
2639
|
}
|
|
2573
2640
|
});
|
|
2574
2641
|
function rel(projectRoot, absPath) {
|
|
2575
|
-
return relative(projectRoot, absPath).replace(/\\/g, "/");
|
|
2642
|
+
return pathApi(projectRoot).relative(projectRoot, absPath).replace(/\\/g, "/");
|
|
2576
2643
|
}
|
|
2577
2644
|
async function listFiles(projectRoot, dir) {
|
|
2578
|
-
return readDirRecursive(join(projectRoot, dir)).catch(() => []);
|
|
2645
|
+
return readDirRecursive(pathApi(projectRoot).join(projectRoot, dir)).catch(() => []);
|
|
2579
2646
|
}
|
|
2580
2647
|
function addDirectoryMapping(refs, from, to) {
|
|
2581
2648
|
refs.set(from, to);
|
|
2582
2649
|
refs.set(`${from}/`, `${to}/`);
|
|
2583
2650
|
}
|
|
2584
2651
|
function addAncestorMappings(refs, fromPath, toPath, stopDir) {
|
|
2585
|
-
let fromDir = dirname(fromPath);
|
|
2586
|
-
let toDir = dirname(toPath);
|
|
2652
|
+
let fromDir = posix.dirname(fromPath);
|
|
2653
|
+
let toDir = posix.dirname(toPath);
|
|
2587
2654
|
while (fromDir !== stopDir && fromDir !== ".") {
|
|
2588
2655
|
addDirectoryMapping(refs, fromDir, toDir);
|
|
2589
|
-
fromDir = dirname(fromDir);
|
|
2590
|
-
toDir = dirname(toDir);
|
|
2656
|
+
fromDir = posix.dirname(fromDir);
|
|
2657
|
+
toDir = posix.dirname(toDir);
|
|
2591
2658
|
}
|
|
2592
2659
|
}
|
|
2593
2660
|
function addSimpleFileMapping(refs, fromPath, canonicalDir, extension) {
|
|
@@ -2631,18 +2698,18 @@ async function targetRootSegments() {
|
|
|
2631
2698
|
if (targetRootSegmentsCache !== void 0) return targetRootSegmentsCache;
|
|
2632
2699
|
const { BUILTIN_TARGETS: BUILTIN_TARGETS2 } = await Promise.resolve().then(() => (init_builtin_targets(), builtin_targets_exports));
|
|
2633
2700
|
const roots = /* @__PURE__ */ new Set();
|
|
2634
|
-
for (const
|
|
2701
|
+
for (const descriptor14 of BUILTIN_TARGETS2) {
|
|
2635
2702
|
for (const path of [
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
...
|
|
2639
|
-
...
|
|
2640
|
-
...
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
...
|
|
2644
|
-
...
|
|
2645
|
-
...
|
|
2703
|
+
descriptor14.project.rootInstructionPath,
|
|
2704
|
+
descriptor14.project.skillDir,
|
|
2705
|
+
...descriptor14.project.managedOutputs?.dirs ?? [],
|
|
2706
|
+
...descriptor14.project.managedOutputs?.files ?? [],
|
|
2707
|
+
...descriptor14.detectionPaths,
|
|
2708
|
+
descriptor14.globalSupport?.layout.rootInstructionPath,
|
|
2709
|
+
descriptor14.globalSupport?.layout.skillDir,
|
|
2710
|
+
...descriptor14.globalSupport?.layout.managedOutputs?.dirs ?? [],
|
|
2711
|
+
...descriptor14.globalSupport?.layout.managedOutputs?.files ?? [],
|
|
2712
|
+
...descriptor14.globalSupport?.detectionPaths ?? []
|
|
2646
2713
|
]) {
|
|
2647
2714
|
if (path !== void 0) {
|
|
2648
2715
|
const segment = firstPathSegment(path);
|
|
@@ -2659,8 +2726,9 @@ function hasHiddenSegment(relPath) {
|
|
|
2659
2726
|
async function listScopedAgentsFiles(projectRoot) {
|
|
2660
2727
|
const files = [];
|
|
2661
2728
|
const targetRootSegmentsSet = await targetRootSegments();
|
|
2729
|
+
const api = pathApi(projectRoot);
|
|
2662
2730
|
async function walk(relDir) {
|
|
2663
|
-
const absDir = join(projectRoot, relDir);
|
|
2731
|
+
const absDir = api.join(projectRoot, relDir);
|
|
2664
2732
|
const entries = await readdir(absDir, { withFileTypes: true }).catch(() => []);
|
|
2665
2733
|
for (const entry of entries) {
|
|
2666
2734
|
const relPath = relDir ? `${relDir}/${entry.name}` : entry.name;
|
|
@@ -2669,7 +2737,7 @@ async function listScopedAgentsFiles(projectRoot) {
|
|
|
2669
2737
|
await walk(relPath);
|
|
2670
2738
|
continue;
|
|
2671
2739
|
}
|
|
2672
|
-
if (entry.isSymbolicLink() && await stat(join(projectRoot, relPath)).then(
|
|
2740
|
+
if (entry.isSymbolicLink() && await stat(api.join(projectRoot, relPath)).then(
|
|
2673
2741
|
(info) => info.isDirectory(),
|
|
2674
2742
|
() => false
|
|
2675
2743
|
)) {
|
|
@@ -2678,7 +2746,7 @@ async function listScopedAgentsFiles(projectRoot) {
|
|
|
2678
2746
|
continue;
|
|
2679
2747
|
}
|
|
2680
2748
|
if (entry.name === "AGENTS.md" || entry.name === "AGENTS.override.md") {
|
|
2681
|
-
files.push(join(projectRoot, relPath));
|
|
2749
|
+
files.push(api.join(projectRoot, relPath));
|
|
2682
2750
|
}
|
|
2683
2751
|
}
|
|
2684
2752
|
}
|
|
@@ -2692,7 +2760,7 @@ async function addScopedAgentsMappings(refs, projectRoot) {
|
|
|
2692
2760
|
const isNestedAgents = relPath.endsWith("/AGENTS.md") && relPath !== "AGENTS.md" && !relPath.endsWith("/AGENTS.override.md");
|
|
2693
2761
|
const isNestedOverride = relPath.endsWith("/AGENTS.override.md") && relPath !== "AGENTS.override.md";
|
|
2694
2762
|
if (!isNestedAgents && !isNestedOverride) continue;
|
|
2695
|
-
const parentDir = dirname(relPath);
|
|
2763
|
+
const parentDir = posix.dirname(relPath);
|
|
2696
2764
|
if (hasHiddenSegment(parentDir)) continue;
|
|
2697
2765
|
const ruleName = parentDir.replace(/\//g, "-");
|
|
2698
2766
|
refs.set(relPath, `${AB_RULES}/${ruleName}.md`);
|
|
@@ -2701,6 +2769,7 @@ async function addScopedAgentsMappings(refs, projectRoot) {
|
|
|
2701
2769
|
var AB_RULES, AB_COMMANDS, AB_AGENTS, AB_SKILLS2, targetRootSegmentsCache;
|
|
2702
2770
|
var init_import_map_shared = __esm({
|
|
2703
2771
|
"src/core/reference/import-map-shared.ts"() {
|
|
2772
|
+
init_path_helpers();
|
|
2704
2773
|
init_fs();
|
|
2705
2774
|
init_command_skill();
|
|
2706
2775
|
init_projected_agent_skill();
|
|
@@ -3155,9 +3224,100 @@ var init_junie = __esm({
|
|
|
3155
3224
|
}
|
|
3156
3225
|
});
|
|
3157
3226
|
|
|
3227
|
+
// src/targets/kilo-code/constants.ts
|
|
3228
|
+
var KILO_CODE_TARGET, KILO_CODE_DIR, KILO_CODE_ROOT_RULE, KILO_CODE_RULES_DIR, KILO_CODE_COMMANDS_DIR, KILO_CODE_AGENTS_DIR, KILO_CODE_SKILLS_DIR, KILO_CODE_MCP_FILE, KILO_CODE_IGNORE, KILO_CODE_LEGACY_DIR, KILO_CODE_LEGACY_RULES_DIR, KILO_CODE_LEGACY_WORKFLOWS_DIR, KILO_CODE_LEGACY_SKILLS_DIR, KILO_CODE_LEGACY_MCP_FILE, KILO_CODE_LEGACY_MODES_FILE, KILO_CODE_GLOBAL_DIR, KILO_CODE_GLOBAL_AGENTS_MD, KILO_CODE_GLOBAL_RULES_DIR, KILO_CODE_GLOBAL_COMMANDS_DIR, KILO_CODE_GLOBAL_AGENTS_DIR, KILO_CODE_GLOBAL_SKILLS_DIR, KILO_CODE_GLOBAL_MCP_FILE, KILO_CODE_GLOBAL_IGNORE, KILO_CODE_GLOBAL_AGENTS_SKILLS_DIR, KILO_CODE_CANONICAL_RULES_DIR, KILO_CODE_CANONICAL_COMMANDS_DIR, KILO_CODE_CANONICAL_AGENTS_DIR, KILO_CODE_CANONICAL_MCP, KILO_CODE_CANONICAL_IGNORE;
|
|
3229
|
+
var init_constants8 = __esm({
|
|
3230
|
+
"src/targets/kilo-code/constants.ts"() {
|
|
3231
|
+
KILO_CODE_TARGET = "kilo-code";
|
|
3232
|
+
KILO_CODE_DIR = ".kilo";
|
|
3233
|
+
KILO_CODE_ROOT_RULE = "AGENTS.md";
|
|
3234
|
+
KILO_CODE_RULES_DIR = `${KILO_CODE_DIR}/rules`;
|
|
3235
|
+
KILO_CODE_COMMANDS_DIR = `${KILO_CODE_DIR}/commands`;
|
|
3236
|
+
KILO_CODE_AGENTS_DIR = `${KILO_CODE_DIR}/agents`;
|
|
3237
|
+
KILO_CODE_SKILLS_DIR = `${KILO_CODE_DIR}/skills`;
|
|
3238
|
+
KILO_CODE_MCP_FILE = `${KILO_CODE_DIR}/mcp.json`;
|
|
3239
|
+
KILO_CODE_IGNORE = ".kilocodeignore";
|
|
3240
|
+
KILO_CODE_LEGACY_DIR = ".kilocode";
|
|
3241
|
+
KILO_CODE_LEGACY_RULES_DIR = `${KILO_CODE_LEGACY_DIR}/rules`;
|
|
3242
|
+
KILO_CODE_LEGACY_WORKFLOWS_DIR = `${KILO_CODE_LEGACY_DIR}/workflows`;
|
|
3243
|
+
KILO_CODE_LEGACY_SKILLS_DIR = `${KILO_CODE_LEGACY_DIR}/skills`;
|
|
3244
|
+
KILO_CODE_LEGACY_MCP_FILE = `${KILO_CODE_LEGACY_DIR}/mcp.json`;
|
|
3245
|
+
KILO_CODE_LEGACY_MODES_FILE = ".kilocodemodes";
|
|
3246
|
+
KILO_CODE_GLOBAL_DIR = ".kilo";
|
|
3247
|
+
KILO_CODE_GLOBAL_AGENTS_MD = `${KILO_CODE_GLOBAL_DIR}/AGENTS.md`;
|
|
3248
|
+
KILO_CODE_GLOBAL_RULES_DIR = `${KILO_CODE_GLOBAL_DIR}/rules`;
|
|
3249
|
+
KILO_CODE_GLOBAL_COMMANDS_DIR = `${KILO_CODE_GLOBAL_DIR}/commands`;
|
|
3250
|
+
KILO_CODE_GLOBAL_AGENTS_DIR = `${KILO_CODE_GLOBAL_DIR}/agents`;
|
|
3251
|
+
KILO_CODE_GLOBAL_SKILLS_DIR = `${KILO_CODE_GLOBAL_DIR}/skills`;
|
|
3252
|
+
KILO_CODE_GLOBAL_MCP_FILE = `${KILO_CODE_GLOBAL_DIR}/mcp.json`;
|
|
3253
|
+
KILO_CODE_GLOBAL_IGNORE = ".kilocodeignore";
|
|
3254
|
+
KILO_CODE_GLOBAL_AGENTS_SKILLS_DIR = ".agents/skills";
|
|
3255
|
+
KILO_CODE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3256
|
+
KILO_CODE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
3257
|
+
KILO_CODE_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
|
|
3258
|
+
KILO_CODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
3259
|
+
KILO_CODE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
3260
|
+
}
|
|
3261
|
+
});
|
|
3262
|
+
async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
3263
|
+
if (scope === "global") {
|
|
3264
|
+
refs.set(KILO_CODE_GLOBAL_AGENTS_MD, `${AB_RULES2}/_root.md`);
|
|
3265
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_RULES_DIR)) {
|
|
3266
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3267
|
+
}
|
|
3268
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_COMMANDS_DIR)) {
|
|
3269
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
|
|
3270
|
+
}
|
|
3271
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_AGENTS_DIR)) {
|
|
3272
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
|
|
3273
|
+
}
|
|
3274
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_SKILLS_DIR)) {
|
|
3275
|
+
addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_GLOBAL_SKILLS_DIR);
|
|
3276
|
+
}
|
|
3277
|
+
refs.set(KILO_CODE_GLOBAL_MCP_FILE, ".agentsmesh/mcp.json");
|
|
3278
|
+
return;
|
|
3279
|
+
}
|
|
3280
|
+
refs.set(KILO_CODE_ROOT_RULE, `${AB_RULES2}/_root.md`);
|
|
3281
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_RULES_DIR)) {
|
|
3282
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3283
|
+
}
|
|
3284
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_COMMANDS_DIR)) {
|
|
3285
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
|
|
3286
|
+
}
|
|
3287
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_AGENTS_DIR)) {
|
|
3288
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
|
|
3289
|
+
}
|
|
3290
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_SKILLS_DIR)) {
|
|
3291
|
+
addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_SKILLS_DIR);
|
|
3292
|
+
}
|
|
3293
|
+
refs.set(KILO_CODE_MCP_FILE, ".agentsmesh/mcp.json");
|
|
3294
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_RULES_DIR)) {
|
|
3295
|
+
const relPath = rel(projectRoot, absPath);
|
|
3296
|
+
if (basename(relPath) === "00-root.md") {
|
|
3297
|
+
refs.set(relPath, `${AB_RULES2}/_root.md`);
|
|
3298
|
+
continue;
|
|
3299
|
+
}
|
|
3300
|
+
addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
|
|
3301
|
+
}
|
|
3302
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_WORKFLOWS_DIR)) {
|
|
3303
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
|
|
3304
|
+
}
|
|
3305
|
+
for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_SKILLS_DIR)) {
|
|
3306
|
+
addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_LEGACY_SKILLS_DIR);
|
|
3307
|
+
}
|
|
3308
|
+
refs.set(KILO_CODE_LEGACY_MCP_FILE, ".agentsmesh/mcp.json");
|
|
3309
|
+
}
|
|
3310
|
+
var init_kilo_code = __esm({
|
|
3311
|
+
"src/core/reference/import-maps/kilo-code.ts"() {
|
|
3312
|
+
init_import_map_shared();
|
|
3313
|
+
init_constants8();
|
|
3314
|
+
init_constants2();
|
|
3315
|
+
}
|
|
3316
|
+
});
|
|
3317
|
+
|
|
3158
3318
|
// src/targets/kiro/constants.ts
|
|
3159
3319
|
var KIRO_TARGET, KIRO_AGENTS_MD, KIRO_DIR, KIRO_STEERING_DIR, KIRO_SKILLS_DIR, KIRO_AGENTS_DIR, KIRO_HOOKS_DIR, KIRO_SETTINGS_DIR, KIRO_MCP_FILE, KIRO_IGNORE, KIRO_GLOBAL_STEERING_DIR, KIRO_GLOBAL_STEERING_AGENTS_MD, KIRO_GLOBAL_SKILLS_DIR, KIRO_GLOBAL_AGENTS_DIR, KIRO_GLOBAL_MCP_FILE, KIRO_GLOBAL_IGNORE, KIRO_GLOBAL_AGENTS_SKILLS_DIR, KIRO_CANONICAL_ROOT_RULE, KIRO_CANONICAL_RULES_DIR, KIRO_CANONICAL_AGENTS_DIR, KIRO_CANONICAL_MCP, KIRO_CANONICAL_HOOKS, KIRO_CANONICAL_IGNORE;
|
|
3160
|
-
var
|
|
3320
|
+
var init_constants9 = __esm({
|
|
3161
3321
|
"src/targets/kiro/constants.ts"() {
|
|
3162
3322
|
KIRO_TARGET = "kiro";
|
|
3163
3323
|
KIRO_AGENTS_MD = "AGENTS.md";
|
|
@@ -3216,14 +3376,14 @@ async function buildKiroImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3216
3376
|
var init_kiro = __esm({
|
|
3217
3377
|
"src/core/reference/import-maps/kiro.ts"() {
|
|
3218
3378
|
init_import_map_shared();
|
|
3219
|
-
|
|
3379
|
+
init_constants9();
|
|
3220
3380
|
init_constants2();
|
|
3221
3381
|
}
|
|
3222
3382
|
});
|
|
3223
3383
|
|
|
3224
3384
|
// src/targets/roo-code/constants.ts
|
|
3225
3385
|
var ROO_CODE_TARGET, ROO_CODE_DIR, ROO_CODE_ROOT_RULE, ROO_CODE_ROOT_RULE_FALLBACK, ROO_CODE_RULES_DIR, ROO_CODE_COMMANDS_DIR, ROO_CODE_SKILLS_DIR, ROO_CODE_MCP_FILE, ROO_CODE_IGNORE, ROO_CODE_MODES_FILE, ROO_CODE_GLOBAL_MODES_FILE, ROO_CODE_GLOBAL_DIR, ROO_CODE_GLOBAL_RULES_DIR, ROO_CODE_GLOBAL_COMMANDS_DIR, ROO_CODE_GLOBAL_SKILLS_DIR, ROO_CODE_GLOBAL_MCP_FILE, ROO_CODE_GLOBAL_IGNORE, ROO_CODE_GLOBAL_AGENTS_MD, ROO_CODE_GLOBAL_AGENTS_SKILLS_DIR, ROO_CODE_CANONICAL_RULES_DIR, ROO_CODE_CANONICAL_COMMANDS_DIR, ROO_CODE_CANONICAL_MCP, ROO_CODE_CANONICAL_IGNORE;
|
|
3226
|
-
var
|
|
3386
|
+
var init_constants10 = __esm({
|
|
3227
3387
|
"src/targets/roo-code/constants.ts"() {
|
|
3228
3388
|
ROO_CODE_TARGET = "roo-code";
|
|
3229
3389
|
ROO_CODE_DIR = ".roo";
|
|
@@ -3290,7 +3450,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3290
3450
|
var init_roo_code = __esm({
|
|
3291
3451
|
"src/core/reference/import-maps/roo-code.ts"() {
|
|
3292
3452
|
init_import_map_shared();
|
|
3293
|
-
|
|
3453
|
+
init_constants10();
|
|
3294
3454
|
init_constants2();
|
|
3295
3455
|
}
|
|
3296
3456
|
});
|
|
@@ -3329,6 +3489,7 @@ var init_import_maps = __esm({
|
|
|
3329
3489
|
init_cursor();
|
|
3330
3490
|
init_gemini_cli();
|
|
3331
3491
|
init_junie();
|
|
3492
|
+
init_kilo_code();
|
|
3332
3493
|
init_kiro();
|
|
3333
3494
|
init_roo_code();
|
|
3334
3495
|
init_windsurf();
|
|
@@ -3820,10 +3981,8 @@ async function importSettings(projectRoot, results) {
|
|
|
3820
3981
|
}
|
|
3821
3982
|
const alreadyImportedMcp = results.some((r) => r.feature === "mcp");
|
|
3822
3983
|
if (!alreadyImportedMcp && settings.mcpServers && typeof settings.mcpServers === "object") {
|
|
3823
|
-
const
|
|
3824
|
-
|
|
3825
|
-
await mkdirp(dirname(destPath));
|
|
3826
|
-
await writeFileAtomic(destPath, mcpContent);
|
|
3984
|
+
const mcpServers = settings.mcpServers;
|
|
3985
|
+
await writeMcpWithMerge(projectRoot, CLAUDE_CANONICAL_MCP, mcpServers);
|
|
3827
3986
|
results.push({
|
|
3828
3987
|
fromTool: "claude-code",
|
|
3829
3988
|
fromPath: settingsPath,
|
|
@@ -3871,6 +4030,7 @@ var init_settings_helpers = __esm({
|
|
|
3871
4030
|
"src/targets/claude-code/settings-helpers.ts"() {
|
|
3872
4031
|
init_hook_command();
|
|
3873
4032
|
init_fs();
|
|
4033
|
+
init_mcp_merge();
|
|
3874
4034
|
init_constants3();
|
|
3875
4035
|
}
|
|
3876
4036
|
});
|
|
@@ -4830,11 +4990,11 @@ var init_linter3 = __esm({
|
|
|
4830
4990
|
});
|
|
4831
4991
|
|
|
4832
4992
|
// src/core/lint/shared/helpers.ts
|
|
4833
|
-
function createWarning(file,
|
|
4993
|
+
function createWarning(file, target14, message) {
|
|
4834
4994
|
return {
|
|
4835
4995
|
level: "warning",
|
|
4836
4996
|
file,
|
|
4837
|
-
target:
|
|
4997
|
+
target: target14,
|
|
4838
4998
|
message
|
|
4839
4999
|
};
|
|
4840
5000
|
}
|
|
@@ -4844,12 +5004,12 @@ function formatOxfordComma(items) {
|
|
|
4844
5004
|
if (items.length === 2) return `${items[0]} and ${items[1]}`;
|
|
4845
5005
|
return `${items.slice(0, -1).join(", ")}, and ${items[items.length - 1]}`;
|
|
4846
5006
|
}
|
|
4847
|
-
function createUnsupportedHookWarning(event,
|
|
4848
|
-
const by = options?.unsupportedBy ??
|
|
5007
|
+
function createUnsupportedHookWarning(event, target14, supportedEvents, options) {
|
|
5008
|
+
const by = options?.unsupportedBy ?? target14;
|
|
4849
5009
|
const supported = formatOxfordComma(supportedEvents);
|
|
4850
5010
|
return createWarning(
|
|
4851
5011
|
".agentsmesh/hooks.yaml",
|
|
4852
|
-
|
|
5012
|
+
target14,
|
|
4853
5013
|
`${event} is not supported by ${by}; only ${supported} are projected.`
|
|
4854
5014
|
);
|
|
4855
5015
|
}
|
|
@@ -5033,7 +5193,7 @@ var init_cline2 = __esm({
|
|
|
5033
5193
|
|
|
5034
5194
|
// src/targets/codex-cli/constants.ts
|
|
5035
5195
|
var CODEX_TARGET, CODEX_MD, AGENTS_MD, CODEX_GLOBAL_AGENTS_MD, CODEX_GLOBAL_AGENTS_OVERRIDE_MD, CODEX_SKILLS_DIR, CODEX_SKILLS_FALLBACK_DIR, CODEX_CONFIG_TOML, CODEX_INSTRUCTIONS_DIR, CODEX_RULES_DIR, CODEX_AGENTS_DIR, CODEX_CANONICAL_RULES_DIR, CODEX_CANONICAL_COMMANDS_DIR, CODEX_CANONICAL_AGENTS_DIR, CODEX_CANONICAL_SKILLS_DIR, CODEX_CANONICAL_MCP, CODEX_RULE_EMBED_MARKER, CODEX_RULE_EMBED_JSON_PREFIX, CODEX_RULE_EMBED_B64_BEGIN, CODEX_RULE_EMBED_B64_END, CODEX_RULE_EMBED_B64_LINE, CODEX_RULE_INDEX_START, CODEX_RULE_INDEX_END;
|
|
5036
|
-
var
|
|
5196
|
+
var init_constants11 = __esm({
|
|
5037
5197
|
"src/targets/codex-cli/constants.ts"() {
|
|
5038
5198
|
CODEX_TARGET = "codex-cli";
|
|
5039
5199
|
CODEX_MD = "codex.md";
|
|
@@ -5096,7 +5256,7 @@ function summarizeRule(rule) {
|
|
|
5096
5256
|
scopes.push(`Enforced in \`${CODEX_RULES_DIR}/${ruleSlug2(rule.source)}.rules\`.`);
|
|
5097
5257
|
}
|
|
5098
5258
|
if (rule.targets.length > 0) {
|
|
5099
|
-
scopes.push(`Targeted to ${rule.targets.map((
|
|
5259
|
+
scopes.push(`Targeted to ${rule.targets.map((target14) => `\`${target14}\``).join(", ")}.`);
|
|
5100
5260
|
}
|
|
5101
5261
|
return scopes.join(" ");
|
|
5102
5262
|
}
|
|
@@ -5126,7 +5286,7 @@ function stripCodexRuleIndex(content) {
|
|
|
5126
5286
|
var init_instruction_mirror = __esm({
|
|
5127
5287
|
"src/targets/codex-cli/instruction-mirror.ts"() {
|
|
5128
5288
|
init_markdown();
|
|
5129
|
-
|
|
5289
|
+
init_constants11();
|
|
5130
5290
|
}
|
|
5131
5291
|
});
|
|
5132
5292
|
function looksLikeCodexRulesDsl(body) {
|
|
@@ -5192,7 +5352,7 @@ function renderCodexGlobalInstructions(canonical) {
|
|
|
5192
5352
|
var init_rules = __esm({
|
|
5193
5353
|
"src/targets/codex-cli/generator/rules.ts"() {
|
|
5194
5354
|
init_managed_blocks();
|
|
5195
|
-
|
|
5355
|
+
init_constants11();
|
|
5196
5356
|
init_instruction_mirror();
|
|
5197
5357
|
}
|
|
5198
5358
|
});
|
|
@@ -5233,7 +5393,7 @@ function generateCommands4(canonical) {
|
|
|
5233
5393
|
var init_skills = __esm({
|
|
5234
5394
|
"src/targets/codex-cli/generator/skills.ts"() {
|
|
5235
5395
|
init_markdown();
|
|
5236
|
-
|
|
5396
|
+
init_constants11();
|
|
5237
5397
|
init_command_skill();
|
|
5238
5398
|
}
|
|
5239
5399
|
});
|
|
@@ -5274,7 +5434,7 @@ ${body}
|
|
|
5274
5434
|
}
|
|
5275
5435
|
var init_agents = __esm({
|
|
5276
5436
|
"src/targets/codex-cli/generator/agents.ts"() {
|
|
5277
|
-
|
|
5437
|
+
init_constants11();
|
|
5278
5438
|
}
|
|
5279
5439
|
});
|
|
5280
5440
|
|
|
@@ -5326,7 +5486,7 @@ function needsTomlQuoting(key) {
|
|
|
5326
5486
|
var init_mcp = __esm({
|
|
5327
5487
|
"src/targets/codex-cli/generator/mcp.ts"() {
|
|
5328
5488
|
init_mcp_servers();
|
|
5329
|
-
|
|
5489
|
+
init_constants11();
|
|
5330
5490
|
}
|
|
5331
5491
|
});
|
|
5332
5492
|
|
|
@@ -5385,11 +5545,7 @@ async function importMcp(projectRoot, results) {
|
|
|
5385
5545
|
if (server) mcpServers[name] = server;
|
|
5386
5546
|
}
|
|
5387
5547
|
if (Object.keys(mcpServers).length === 0) return;
|
|
5388
|
-
await
|
|
5389
|
-
await writeFileAtomic(
|
|
5390
|
-
join(projectRoot, CODEX_CANONICAL_MCP),
|
|
5391
|
-
JSON.stringify({ mcpServers }, null, 2)
|
|
5392
|
-
);
|
|
5548
|
+
await writeMcpWithMerge(projectRoot, CODEX_CANONICAL_MCP, mcpServers);
|
|
5393
5549
|
results.push({
|
|
5394
5550
|
fromTool: CODEX_TARGET,
|
|
5395
5551
|
fromPath: configPath,
|
|
@@ -5400,7 +5556,8 @@ async function importMcp(projectRoot, results) {
|
|
|
5400
5556
|
var init_mcp_helpers = __esm({
|
|
5401
5557
|
"src/targets/codex-cli/mcp-helpers.ts"() {
|
|
5402
5558
|
init_fs();
|
|
5403
|
-
|
|
5559
|
+
init_mcp_merge();
|
|
5560
|
+
init_constants11();
|
|
5404
5561
|
}
|
|
5405
5562
|
});
|
|
5406
5563
|
function shouldImportScopedAgentsRule(relDir) {
|
|
@@ -5494,7 +5651,7 @@ var init_skills_adapter2 = __esm({
|
|
|
5494
5651
|
init_projected_agent_skill();
|
|
5495
5652
|
init_scoped_agents_import();
|
|
5496
5653
|
init_skill_import_pipeline();
|
|
5497
|
-
|
|
5654
|
+
init_constants11();
|
|
5498
5655
|
}
|
|
5499
5656
|
});
|
|
5500
5657
|
async function importCodexAgentsFromToml(projectRoot, results, normalize) {
|
|
@@ -5547,7 +5704,7 @@ var init_importer_agents = __esm({
|
|
|
5547
5704
|
"src/targets/codex-cli/importer-agents.ts"() {
|
|
5548
5705
|
init_fs();
|
|
5549
5706
|
init_projected_agent_skill();
|
|
5550
|
-
|
|
5707
|
+
init_constants11();
|
|
5551
5708
|
}
|
|
5552
5709
|
});
|
|
5553
5710
|
function tryParseEmbeddedCanonicalFromCodexRules(content) {
|
|
@@ -5590,7 +5747,7 @@ function tryParseEmbeddedCanonicalFromCodexRules(content) {
|
|
|
5590
5747
|
}
|
|
5591
5748
|
var init_codex_rules_embed = __esm({
|
|
5592
5749
|
"src/targets/codex-cli/codex-rules-embed.ts"() {
|
|
5593
|
-
|
|
5750
|
+
init_constants11();
|
|
5594
5751
|
}
|
|
5595
5752
|
});
|
|
5596
5753
|
async function importCodexNonRootRuleFiles(projectRoot, destDir, normalize) {
|
|
@@ -5664,7 +5821,7 @@ var init_import_codex_non_root_rules = __esm({
|
|
|
5664
5821
|
init_fs();
|
|
5665
5822
|
init_markdown();
|
|
5666
5823
|
init_import_metadata();
|
|
5667
|
-
|
|
5824
|
+
init_constants11();
|
|
5668
5825
|
init_codex_rules_embed();
|
|
5669
5826
|
}
|
|
5670
5827
|
});
|
|
@@ -5786,7 +5943,7 @@ var init_importer_rules2 = __esm({
|
|
|
5786
5943
|
init_embedded_rules();
|
|
5787
5944
|
init_import_orchestrator();
|
|
5788
5945
|
init_scoped_agents_import();
|
|
5789
|
-
|
|
5946
|
+
init_constants11();
|
|
5790
5947
|
init_import_codex_non_root_rules();
|
|
5791
5948
|
init_instruction_mirror();
|
|
5792
5949
|
}
|
|
@@ -5811,7 +5968,7 @@ async function importFromCodex(projectRoot, options) {
|
|
|
5811
5968
|
var init_importer4 = __esm({
|
|
5812
5969
|
"src/targets/codex-cli/importer.ts"() {
|
|
5813
5970
|
init_import_rewriter();
|
|
5814
|
-
|
|
5971
|
+
init_constants11();
|
|
5815
5972
|
init_mcp_helpers();
|
|
5816
5973
|
init_skills_adapter2();
|
|
5817
5974
|
init_importer_agents();
|
|
@@ -5836,7 +5993,7 @@ function lintRules4(canonical, projectRoot, _projectFiles) {
|
|
|
5836
5993
|
}
|
|
5837
5994
|
var init_linter4 = __esm({
|
|
5838
5995
|
"src/targets/codex-cli/linter.ts"() {
|
|
5839
|
-
|
|
5996
|
+
init_constants11();
|
|
5840
5997
|
}
|
|
5841
5998
|
});
|
|
5842
5999
|
|
|
@@ -5886,7 +6043,7 @@ var target4, project4, global3, globalCapabilities4, descriptor4;
|
|
|
5886
6043
|
var init_codex_cli2 = __esm({
|
|
5887
6044
|
"src/targets/codex-cli/index.ts"() {
|
|
5888
6045
|
init_generator5();
|
|
5889
|
-
|
|
6046
|
+
init_constants11();
|
|
5890
6047
|
init_importer4();
|
|
5891
6048
|
init_linter4();
|
|
5892
6049
|
init_lint2();
|
|
@@ -6150,10 +6307,7 @@ async function importMcp2(projectRoot, results) {
|
|
|
6150
6307
|
importedFrom.push(srcPath);
|
|
6151
6308
|
}
|
|
6152
6309
|
if (Object.keys(merged).length === 0) return;
|
|
6153
|
-
await
|
|
6154
|
-
join(projectRoot, CONTINUE_CANONICAL_MCP),
|
|
6155
|
-
JSON.stringify({ mcpServers: merged }, null, 2)
|
|
6156
|
-
);
|
|
6310
|
+
await writeMcpWithMerge(projectRoot, CONTINUE_CANONICAL_MCP, merged);
|
|
6157
6311
|
for (const fromPath of importedFrom) {
|
|
6158
6312
|
results.push({
|
|
6159
6313
|
fromTool: CONTINUE_TARGET,
|
|
@@ -6177,6 +6331,7 @@ var init_importer5 = __esm({
|
|
|
6177
6331
|
init_fs();
|
|
6178
6332
|
init_embedded_skill();
|
|
6179
6333
|
init_descriptor_import_runner();
|
|
6334
|
+
init_mcp_merge();
|
|
6180
6335
|
init_shared_import_helpers();
|
|
6181
6336
|
init_constants5();
|
|
6182
6337
|
init_continue2();
|
|
@@ -6507,7 +6662,7 @@ var init_continue2 = __esm({
|
|
|
6507
6662
|
|
|
6508
6663
|
// src/targets/copilot/constants.ts
|
|
6509
6664
|
var COPILOT_TARGET, COPILOT_INSTRUCTIONS, COPILOT_CONTEXT_DIR, COPILOT_INSTRUCTIONS_DIR, COPILOT_PROMPTS_DIR, COPILOT_HOOKS_DIR, COPILOT_SKILLS_DIR, COPILOT_AGENTS_DIR, COPILOT_CANONICAL_RULES_DIR, COPILOT_CANONICAL_COMMANDS_DIR, COPILOT_CANONICAL_AGENTS_DIR, COPILOT_CANONICAL_SKILLS_DIR, COPILOT_CANONICAL_HOOKS, COPILOT_LEGACY_HOOKS_DIR, COPILOT_GLOBAL_INSTRUCTIONS, COPILOT_GLOBAL_AGENTS_DIR, COPILOT_GLOBAL_SKILLS_DIR, COPILOT_GLOBAL_PROMPTS_DIR, COPILOT_GLOBAL_AGENTS_MD, COPILOT_GLOBAL_CLAUDE_SKILLS_DIR, COPILOT_GLOBAL_AGENTS_SKILLS_DIR;
|
|
6510
|
-
var
|
|
6665
|
+
var init_constants12 = __esm({
|
|
6511
6666
|
"src/targets/copilot/constants.ts"() {
|
|
6512
6667
|
COPILOT_TARGET = "copilot";
|
|
6513
6668
|
COPILOT_INSTRUCTIONS = ".github/copilot-instructions.md";
|
|
@@ -6572,7 +6727,7 @@ function parseCommandPromptFrontmatter(frontmatter, promptPath) {
|
|
|
6572
6727
|
var init_command_prompt = __esm({
|
|
6573
6728
|
"src/targets/copilot/command-prompt.ts"() {
|
|
6574
6729
|
init_markdown();
|
|
6575
|
-
|
|
6730
|
+
init_constants12();
|
|
6576
6731
|
}
|
|
6577
6732
|
});
|
|
6578
6733
|
|
|
@@ -6724,7 +6879,7 @@ function generateHooks3(canonical) {
|
|
|
6724
6879
|
var init_generator7 = __esm({
|
|
6725
6880
|
"src/targets/copilot/generator.ts"() {
|
|
6726
6881
|
init_markdown();
|
|
6727
|
-
|
|
6882
|
+
init_constants12();
|
|
6728
6883
|
init_command_prompt();
|
|
6729
6884
|
init_hook_entry();
|
|
6730
6885
|
}
|
|
@@ -6818,7 +6973,7 @@ async function importHooks(projectRoot, results) {
|
|
|
6818
6973
|
var init_hook_parser = __esm({
|
|
6819
6974
|
"src/targets/copilot/hook-parser.ts"() {
|
|
6820
6975
|
init_fs();
|
|
6821
|
-
|
|
6976
|
+
init_constants12();
|
|
6822
6977
|
}
|
|
6823
6978
|
});
|
|
6824
6979
|
async function importSkills2(projectRoot, results, normalize, skillsDirRel = COPILOT_SKILLS_DIR) {
|
|
@@ -6839,7 +6994,7 @@ async function importSkills2(projectRoot, results, normalize, skillsDirRel = COP
|
|
|
6839
6994
|
var init_skills_adapter3 = __esm({
|
|
6840
6995
|
"src/targets/copilot/skills-adapter.ts"() {
|
|
6841
6996
|
init_skill_import_pipeline();
|
|
6842
|
-
|
|
6997
|
+
init_constants12();
|
|
6843
6998
|
}
|
|
6844
6999
|
});
|
|
6845
7000
|
|
|
@@ -6862,7 +7017,7 @@ var init_importer6 = __esm({
|
|
|
6862
7017
|
"src/targets/copilot/importer.ts"() {
|
|
6863
7018
|
init_import_rewriter();
|
|
6864
7019
|
init_descriptor_import_runner();
|
|
6865
|
-
|
|
7020
|
+
init_constants12();
|
|
6866
7021
|
init_hook_parser();
|
|
6867
7022
|
init_skills_adapter3();
|
|
6868
7023
|
init_copilot2();
|
|
@@ -6881,7 +7036,7 @@ var init_import_mappers4 = __esm({
|
|
|
6881
7036
|
init_import_metadata();
|
|
6882
7037
|
init_shared_import_helpers();
|
|
6883
7038
|
init_command_prompt();
|
|
6884
|
-
|
|
7039
|
+
init_constants12();
|
|
6885
7040
|
copilotLegacyRuleMapper = async ({
|
|
6886
7041
|
relativePath,
|
|
6887
7042
|
normalizeTo,
|
|
@@ -6998,7 +7153,7 @@ function lintRules6(canonical, projectRoot, projectFiles, options) {
|
|
|
6998
7153
|
var init_linter6 = __esm({
|
|
6999
7154
|
"src/targets/copilot/linter.ts"() {
|
|
7000
7155
|
init_validate_rules();
|
|
7001
|
-
|
|
7156
|
+
init_constants12();
|
|
7002
7157
|
}
|
|
7003
7158
|
});
|
|
7004
7159
|
|
|
@@ -7115,7 +7270,7 @@ var SCRIPT_PREFIX_RE;
|
|
|
7115
7270
|
var init_hook_assets = __esm({
|
|
7116
7271
|
"src/targets/copilot/hook-assets.ts"() {
|
|
7117
7272
|
init_fs();
|
|
7118
|
-
|
|
7273
|
+
init_constants12();
|
|
7119
7274
|
init_hook_entry();
|
|
7120
7275
|
SCRIPT_PREFIX_RE = /^(?<prefix>\s*(?:(?:bash|sh|zsh)\s+)?)["']?(?<path>(?:\.\.\/|\.\/|[^/\s"'`]+\/)[^\s"'`]+)["']?(?<suffix>(?:\s.*)?)$/;
|
|
7121
7276
|
}
|
|
@@ -7129,7 +7284,7 @@ var generateCopilotGlobalExtras;
|
|
|
7129
7284
|
var init_scope_extras2 = __esm({
|
|
7130
7285
|
"src/targets/copilot/scope-extras.ts"() {
|
|
7131
7286
|
init_fs();
|
|
7132
|
-
|
|
7287
|
+
init_constants12();
|
|
7133
7288
|
generateCopilotGlobalExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
|
|
7134
7289
|
if (scope !== "global" || !enabledFeatures.has("rules")) return [];
|
|
7135
7290
|
const root = canonical.rules.find((r) => r.root);
|
|
@@ -7152,7 +7307,7 @@ var target6, project6, global4, globalCapabilities6, descriptor6;
|
|
|
7152
7307
|
var init_copilot2 = __esm({
|
|
7153
7308
|
"src/targets/copilot/index.ts"() {
|
|
7154
7309
|
init_generator7();
|
|
7155
|
-
|
|
7310
|
+
init_constants12();
|
|
7156
7311
|
init_importer6();
|
|
7157
7312
|
init_import_mappers4();
|
|
7158
7313
|
init_linter6();
|
|
@@ -7921,8 +8076,8 @@ async function hasGlobalCursorArtifacts(projectRoot) {
|
|
|
7921
8076
|
join(projectRoot, CURSOR_COMMANDS_DIR)
|
|
7922
8077
|
];
|
|
7923
8078
|
for (const p of candidates) {
|
|
7924
|
-
const
|
|
7925
|
-
if (
|
|
8079
|
+
const stat5 = await readFileSafe(p);
|
|
8080
|
+
if (stat5 !== null && stat5.trim() !== "") return true;
|
|
7926
8081
|
}
|
|
7927
8082
|
const skillFiles = await readDirRecursive(join(projectRoot, CURSOR_GLOBAL_SKILLS_DIR));
|
|
7928
8083
|
if (skillFiles.some((f) => f.endsWith(".md"))) return true;
|
|
@@ -8080,9 +8235,8 @@ async function importMcp3(projectRoot, results) {
|
|
|
8080
8235
|
return;
|
|
8081
8236
|
}
|
|
8082
8237
|
if (!parsed || typeof parsed !== "object" || !("mcpServers" in parsed)) return;
|
|
8083
|
-
const
|
|
8084
|
-
await
|
|
8085
|
-
await writeFileAtomic(destPath, content);
|
|
8238
|
+
const servers = parsed.mcpServers;
|
|
8239
|
+
await writeMcpWithMerge(projectRoot, CURSOR_CANONICAL_MCP, servers);
|
|
8086
8240
|
results.push({
|
|
8087
8241
|
fromTool: "cursor",
|
|
8088
8242
|
fromPath: mcpPath,
|
|
@@ -8109,6 +8263,7 @@ var init_importer7 = __esm({
|
|
|
8109
8263
|
init_import_rewriter();
|
|
8110
8264
|
init_fs();
|
|
8111
8265
|
init_descriptor_import_runner();
|
|
8266
|
+
init_mcp_merge();
|
|
8112
8267
|
init_importer_rules3();
|
|
8113
8268
|
init_settings_helpers2();
|
|
8114
8269
|
init_skills_adapter4();
|
|
@@ -8410,7 +8565,7 @@ var init_cursor2 = __esm({
|
|
|
8410
8565
|
|
|
8411
8566
|
// src/targets/gemini-cli/constants.ts
|
|
8412
8567
|
var GEMINI_TARGET, GEMINI_ROOT, GEMINI_COMPAT_AGENTS, GEMINI_RULES_DIR, GEMINI_COMPAT_INNER_ROOT, GEMINI_COMMANDS_DIR, GEMINI_POLICIES_DIR, GEMINI_SETTINGS, GEMINI_IGNORE, GEMINI_SKILLS_DIR, GEMINI_AGENTS_DIR, GEMINI_SYSTEM, GEMINI_DEFAULT_POLICIES_FILE, GEMINI_CANONICAL_RULES_DIR, GEMINI_CANONICAL_COMMANDS_DIR, GEMINI_CANONICAL_AGENTS_DIR, GEMINI_CANONICAL_SKILLS_DIR, GEMINI_CANONICAL_MCP, GEMINI_CANONICAL_HOOKS, GEMINI_CANONICAL_IGNORE, GEMINI_CANONICAL_PERMISSIONS, GEMINI_GLOBAL_ROOT, GEMINI_GLOBAL_COMPAT_AGENTS, GEMINI_GLOBAL_SETTINGS, GEMINI_GLOBAL_COMMANDS_DIR, GEMINI_GLOBAL_SKILLS_DIR, GEMINI_GLOBAL_AGENTS_DIR;
|
|
8413
|
-
var
|
|
8568
|
+
var init_constants13 = __esm({
|
|
8414
8569
|
"src/targets/gemini-cli/constants.ts"() {
|
|
8415
8570
|
GEMINI_TARGET = "gemini-cli";
|
|
8416
8571
|
GEMINI_ROOT = "GEMINI.md";
|
|
@@ -8462,7 +8617,7 @@ function generateRules8(canonical) {
|
|
|
8462
8617
|
var init_rules3 = __esm({
|
|
8463
8618
|
"src/targets/gemini-cli/generator/rules.ts"() {
|
|
8464
8619
|
init_managed_blocks();
|
|
8465
|
-
|
|
8620
|
+
init_constants13();
|
|
8466
8621
|
}
|
|
8467
8622
|
});
|
|
8468
8623
|
function canonicalCommandNameToGeminiTomlPath(cmdName, commandsDir) {
|
|
@@ -8502,7 +8657,7 @@ function generateCommands8(canonical) {
|
|
|
8502
8657
|
}
|
|
8503
8658
|
var init_commands2 = __esm({
|
|
8504
8659
|
"src/targets/gemini-cli/generator/commands.ts"() {
|
|
8505
|
-
|
|
8660
|
+
init_constants13();
|
|
8506
8661
|
init_command_namespace();
|
|
8507
8662
|
}
|
|
8508
8663
|
});
|
|
@@ -8530,7 +8685,7 @@ function generateAgents6(canonical) {
|
|
|
8530
8685
|
var init_agents3 = __esm({
|
|
8531
8686
|
"src/targets/gemini-cli/generator/agents.ts"() {
|
|
8532
8687
|
init_markdown();
|
|
8533
|
-
|
|
8688
|
+
init_constants13();
|
|
8534
8689
|
}
|
|
8535
8690
|
});
|
|
8536
8691
|
|
|
@@ -8561,7 +8716,7 @@ function generateSkills8(canonical) {
|
|
|
8561
8716
|
var init_skills3 = __esm({
|
|
8562
8717
|
"src/targets/gemini-cli/generator/skills.ts"() {
|
|
8563
8718
|
init_markdown();
|
|
8564
|
-
|
|
8719
|
+
init_constants13();
|
|
8565
8720
|
}
|
|
8566
8721
|
});
|
|
8567
8722
|
|
|
@@ -8622,7 +8777,7 @@ function generateGeminiSettingsFiles(canonical) {
|
|
|
8622
8777
|
var init_settings = __esm({
|
|
8623
8778
|
"src/targets/gemini-cli/generator/settings.ts"() {
|
|
8624
8779
|
init_hook_command();
|
|
8625
|
-
|
|
8780
|
+
init_constants13();
|
|
8626
8781
|
}
|
|
8627
8782
|
});
|
|
8628
8783
|
|
|
@@ -8633,7 +8788,7 @@ function generateIgnore4(canonical) {
|
|
|
8633
8788
|
}
|
|
8634
8789
|
var init_ignore2 = __esm({
|
|
8635
8790
|
"src/targets/gemini-cli/generator/ignore.ts"() {
|
|
8636
|
-
|
|
8791
|
+
init_constants13();
|
|
8637
8792
|
}
|
|
8638
8793
|
});
|
|
8639
8794
|
|
|
@@ -8734,7 +8889,7 @@ function generateGeminiPermissionsPolicies(canonical) {
|
|
|
8734
8889
|
}
|
|
8735
8890
|
var init_policies_generator = __esm({
|
|
8736
8891
|
"src/targets/gemini-cli/policies-generator.ts"() {
|
|
8737
|
-
|
|
8892
|
+
init_constants13();
|
|
8738
8893
|
}
|
|
8739
8894
|
});
|
|
8740
8895
|
function mapGeminiHookEvent(event) {
|
|
@@ -8862,7 +9017,7 @@ var init_format_helpers_settings = __esm({
|
|
|
8862
9017
|
"src/targets/gemini-cli/format-helpers-settings.ts"() {
|
|
8863
9018
|
init_hook_command();
|
|
8864
9019
|
init_fs();
|
|
8865
|
-
|
|
9020
|
+
init_constants13();
|
|
8866
9021
|
init_format_helpers_shared();
|
|
8867
9022
|
}
|
|
8868
9023
|
});
|
|
@@ -8887,7 +9042,7 @@ async function importGeminiIgnore(projectRoot, results) {
|
|
|
8887
9042
|
var init_format_helpers = __esm({
|
|
8888
9043
|
"src/targets/gemini-cli/format-helpers.ts"() {
|
|
8889
9044
|
init_fs();
|
|
8890
|
-
|
|
9045
|
+
init_constants13();
|
|
8891
9046
|
init_format_helpers_shared();
|
|
8892
9047
|
init_format_helpers_settings();
|
|
8893
9048
|
}
|
|
@@ -8995,7 +9150,7 @@ async function importGeminiPolicies(projectRoot) {
|
|
|
8995
9150
|
var init_policies_importer = __esm({
|
|
8996
9151
|
"src/targets/gemini-cli/policies-importer.ts"() {
|
|
8997
9152
|
init_fs();
|
|
8998
|
-
|
|
9153
|
+
init_constants13();
|
|
8999
9154
|
}
|
|
9000
9155
|
});
|
|
9001
9156
|
function stripProjectRootCanonicalPrefix(content, projectRoot) {
|
|
@@ -9121,7 +9276,7 @@ var init_importer_skills_agents = __esm({
|
|
|
9121
9276
|
init_markdown();
|
|
9122
9277
|
init_import_metadata();
|
|
9123
9278
|
init_projected_agent_skill();
|
|
9124
|
-
|
|
9279
|
+
init_constants13();
|
|
9125
9280
|
}
|
|
9126
9281
|
});
|
|
9127
9282
|
async function importRootRule2(projectRoot, results, normalize) {
|
|
@@ -9197,7 +9352,7 @@ var init_importer8 = __esm({
|
|
|
9197
9352
|
init_import_metadata();
|
|
9198
9353
|
init_embedded_rules();
|
|
9199
9354
|
init_descriptor_import_runner();
|
|
9200
|
-
|
|
9355
|
+
init_constants13();
|
|
9201
9356
|
init_gemini_cli2();
|
|
9202
9357
|
init_format_helpers();
|
|
9203
9358
|
init_policies_importer();
|
|
@@ -9265,7 +9420,7 @@ var init_importer_mappers3 = __esm({
|
|
|
9265
9420
|
init_import_metadata();
|
|
9266
9421
|
init_shared_import_helpers();
|
|
9267
9422
|
init_format_helpers();
|
|
9268
|
-
|
|
9423
|
+
init_constants13();
|
|
9269
9424
|
}
|
|
9270
9425
|
});
|
|
9271
9426
|
|
|
@@ -9289,7 +9444,7 @@ function lintRules8(canonical, projectRoot, projectFiles, options) {
|
|
|
9289
9444
|
var init_linter8 = __esm({
|
|
9290
9445
|
"src/targets/gemini-cli/linter.ts"() {
|
|
9291
9446
|
init_validate_rules();
|
|
9292
|
-
|
|
9447
|
+
init_constants13();
|
|
9293
9448
|
}
|
|
9294
9449
|
});
|
|
9295
9450
|
|
|
@@ -9370,7 +9525,7 @@ var init_gemini_cli2 = __esm({
|
|
|
9370
9525
|
init_generator11();
|
|
9371
9526
|
init_capabilities();
|
|
9372
9527
|
init_policies_generator();
|
|
9373
|
-
|
|
9528
|
+
init_constants13();
|
|
9374
9529
|
init_importer8();
|
|
9375
9530
|
init_import_mappers6();
|
|
9376
9531
|
init_linter8();
|
|
@@ -9944,47 +10099,591 @@ var init_junie2 = __esm({
|
|
|
9944
10099
|
};
|
|
9945
10100
|
}
|
|
9946
10101
|
});
|
|
9947
|
-
function
|
|
9948
|
-
return value.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
|
|
9949
|
-
}
|
|
9950
|
-
function hookText(entry) {
|
|
9951
|
-
return entry.type === "prompt" ? entry.prompt : entry.command;
|
|
9952
|
-
}
|
|
9953
|
-
function toWhen(event, matcher) {
|
|
9954
|
-
const type = CANONICAL_TO_KIRO[event];
|
|
9955
|
-
if (event === "PreToolUse" || event === "PostToolUse") {
|
|
9956
|
-
return { type, tools: [matcher || "*"] };
|
|
9957
|
-
}
|
|
9958
|
-
return { type };
|
|
9959
|
-
}
|
|
9960
|
-
function generateKiroHooks(hooks) {
|
|
10102
|
+
function generateRules10(canonical) {
|
|
9961
10103
|
const outputs = [];
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
}
|
|
9979
|
-
|
|
9980
|
-
}
|
|
10104
|
+
const root = canonical.rules.find((rule) => rule.root);
|
|
10105
|
+
if (root) {
|
|
10106
|
+
outputs.push({
|
|
10107
|
+
path: KILO_CODE_ROOT_RULE,
|
|
10108
|
+
content: root.body.trim() ? root.body : ""
|
|
10109
|
+
});
|
|
10110
|
+
}
|
|
10111
|
+
for (const rule of canonical.rules) {
|
|
10112
|
+
if (rule.root) continue;
|
|
10113
|
+
if (rule.targets.length > 0 && !rule.targets.includes(KILO_CODE_TARGET)) continue;
|
|
10114
|
+
const slug = basename(rule.source, ".md");
|
|
10115
|
+
const frontmatter = {};
|
|
10116
|
+
if (rule.description) frontmatter.description = rule.description;
|
|
10117
|
+
if (rule.globs.length > 0) frontmatter.globs = rule.globs;
|
|
10118
|
+
const content = Object.keys(frontmatter).length > 0 ? serializeFrontmatter(frontmatter, rule.body.trim() || "") : rule.body.trim() || "";
|
|
10119
|
+
outputs.push({
|
|
10120
|
+
path: `${KILO_CODE_RULES_DIR}/${slug}.md`,
|
|
10121
|
+
content
|
|
10122
|
+
});
|
|
9981
10123
|
}
|
|
9982
10124
|
return outputs;
|
|
9983
10125
|
}
|
|
9984
|
-
function
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
10126
|
+
function generateCommands10(canonical) {
|
|
10127
|
+
return canonical.commands.map((command) => {
|
|
10128
|
+
const frontmatter = {};
|
|
10129
|
+
if (command.description) frontmatter.description = command.description;
|
|
10130
|
+
return {
|
|
10131
|
+
path: `${KILO_CODE_COMMANDS_DIR}/${command.name}.md`,
|
|
10132
|
+
content: serializeFrontmatter(frontmatter, command.body.trim() || "")
|
|
10133
|
+
};
|
|
10134
|
+
});
|
|
10135
|
+
}
|
|
10136
|
+
function generateAgents8(canonical) {
|
|
10137
|
+
return canonical.agents.map((agent) => {
|
|
10138
|
+
const slug = basename(agent.source, ".md");
|
|
10139
|
+
const frontmatter = { mode: "subagent" };
|
|
10140
|
+
if (agent.description) frontmatter.description = agent.description;
|
|
10141
|
+
if (agent.model) frontmatter.model = agent.model;
|
|
10142
|
+
if (agent.tools.length > 0) frontmatter.tools = agent.tools;
|
|
10143
|
+
if (agent.disallowedTools.length > 0) frontmatter.disallowedTools = agent.disallowedTools;
|
|
10144
|
+
return {
|
|
10145
|
+
path: `${KILO_CODE_AGENTS_DIR}/${slug}.md`,
|
|
10146
|
+
content: serializeFrontmatter(frontmatter, agent.body.trim() || "")
|
|
10147
|
+
};
|
|
10148
|
+
});
|
|
10149
|
+
}
|
|
10150
|
+
function generateMcp8(canonical) {
|
|
10151
|
+
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
10152
|
+
return [
|
|
10153
|
+
{
|
|
10154
|
+
path: KILO_CODE_MCP_FILE,
|
|
10155
|
+
content: JSON.stringify({ mcpServers: canonical.mcp.mcpServers }, null, 2)
|
|
10156
|
+
}
|
|
10157
|
+
];
|
|
10158
|
+
}
|
|
10159
|
+
function generateIgnore6(canonical) {
|
|
10160
|
+
if (canonical.ignore.length === 0) return [];
|
|
10161
|
+
return [{ path: KILO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
10162
|
+
}
|
|
10163
|
+
function generateSkills10(canonical) {
|
|
10164
|
+
return generateEmbeddedSkills(canonical, KILO_CODE_SKILLS_DIR);
|
|
10165
|
+
}
|
|
10166
|
+
var init_generator13 = __esm({
|
|
10167
|
+
"src/targets/kilo-code/generator.ts"() {
|
|
10168
|
+
init_embedded_skill();
|
|
10169
|
+
init_markdown();
|
|
10170
|
+
init_constants8();
|
|
10171
|
+
}
|
|
10172
|
+
});
|
|
10173
|
+
var kiloNonRootRuleMapper, kiloCommandMapper, kiloAgentMapper;
|
|
10174
|
+
var init_import_mappers7 = __esm({
|
|
10175
|
+
"src/targets/kilo-code/import-mappers.ts"() {
|
|
10176
|
+
init_markdown();
|
|
10177
|
+
init_import_metadata();
|
|
10178
|
+
init_constants8();
|
|
10179
|
+
kiloNonRootRuleMapper = async ({
|
|
10180
|
+
relativePath,
|
|
10181
|
+
normalizeTo,
|
|
10182
|
+
destDir
|
|
10183
|
+
}) => {
|
|
10184
|
+
const destPath = join(destDir, relativePath);
|
|
10185
|
+
const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
|
|
10186
|
+
return {
|
|
10187
|
+
destPath,
|
|
10188
|
+
toPath: `${KILO_CODE_CANONICAL_RULES_DIR}/${relativePath}`,
|
|
10189
|
+
content: await serializeImportedRuleWithFallback(
|
|
10190
|
+
destPath,
|
|
10191
|
+
{
|
|
10192
|
+
root: false,
|
|
10193
|
+
description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
|
|
10194
|
+
globs: Array.isArray(frontmatter.globs) ? frontmatter.globs : void 0
|
|
10195
|
+
},
|
|
10196
|
+
body
|
|
10197
|
+
)
|
|
10198
|
+
};
|
|
10199
|
+
};
|
|
10200
|
+
kiloCommandMapper = async ({
|
|
10201
|
+
relativePath,
|
|
10202
|
+
normalizeTo,
|
|
10203
|
+
destDir
|
|
10204
|
+
}) => {
|
|
10205
|
+
const destPath = join(destDir, relativePath);
|
|
10206
|
+
const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
|
|
10207
|
+
return {
|
|
10208
|
+
destPath,
|
|
10209
|
+
toPath: `${KILO_CODE_CANONICAL_COMMANDS_DIR}/${relativePath}`,
|
|
10210
|
+
content: await serializeImportedCommandWithFallback(
|
|
10211
|
+
destPath,
|
|
10212
|
+
{
|
|
10213
|
+
hasDescription: Object.prototype.hasOwnProperty.call(frontmatter, "description"),
|
|
10214
|
+
description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
|
|
10215
|
+
hasAllowedTools: false,
|
|
10216
|
+
allowedTools: []
|
|
10217
|
+
},
|
|
10218
|
+
body
|
|
10219
|
+
)
|
|
10220
|
+
};
|
|
10221
|
+
};
|
|
10222
|
+
kiloAgentMapper = async ({
|
|
10223
|
+
relativePath,
|
|
10224
|
+
normalizeTo,
|
|
10225
|
+
destDir
|
|
10226
|
+
}) => {
|
|
10227
|
+
const destPath = join(destDir, relativePath);
|
|
10228
|
+
const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
|
|
10229
|
+
return {
|
|
10230
|
+
destPath,
|
|
10231
|
+
toPath: `${KILO_CODE_CANONICAL_AGENTS_DIR}/${relativePath}`,
|
|
10232
|
+
content: await serializeImportedAgentWithFallback(destPath, frontmatter, body)
|
|
10233
|
+
};
|
|
10234
|
+
};
|
|
10235
|
+
}
|
|
10236
|
+
});
|
|
10237
|
+
async function pathExists(absolutePath) {
|
|
10238
|
+
try {
|
|
10239
|
+
await stat(absolutePath);
|
|
10240
|
+
return true;
|
|
10241
|
+
} catch {
|
|
10242
|
+
return false;
|
|
10243
|
+
}
|
|
10244
|
+
}
|
|
10245
|
+
async function importLegacyRules(projectRoot, results, normalize) {
|
|
10246
|
+
const srcDir = join(projectRoot, KILO_CODE_LEGACY_RULES_DIR);
|
|
10247
|
+
if (!await pathExists(srcDir)) return;
|
|
10248
|
+
const destDir = join(projectRoot, KILO_CODE_CANONICAL_RULES_DIR);
|
|
10249
|
+
const rootSourceFile = join(srcDir, LEGACY_ROOT_RULE_FILE);
|
|
10250
|
+
const hasCurrentRoot = results.some((result) => result.toPath === CANONICAL_ROOT_RULE_PATH);
|
|
10251
|
+
const rootContent = hasCurrentRoot ? null : await readFileSafe(rootSourceFile);
|
|
10252
|
+
if (rootContent !== null) {
|
|
10253
|
+
const destPath = join(projectRoot, CANONICAL_ROOT_RULE_PATH);
|
|
10254
|
+
const normalized = normalize(rootContent, rootSourceFile, destPath);
|
|
10255
|
+
const { body } = parseFrontmatter(normalized);
|
|
10256
|
+
const serialized = await serializeImportedRuleWithFallback(destPath, { root: true }, body);
|
|
10257
|
+
await writeFileAtomic(destPath, serialized);
|
|
10258
|
+
results.push({
|
|
10259
|
+
feature: "rules",
|
|
10260
|
+
fromTool: KILO_CODE_TARGET,
|
|
10261
|
+
fromPath: `${KILO_CODE_LEGACY_RULES_DIR}/${LEGACY_ROOT_RULE_FILE}`,
|
|
10262
|
+
toPath: CANONICAL_ROOT_RULE_PATH
|
|
10263
|
+
});
|
|
10264
|
+
}
|
|
10265
|
+
results.push(
|
|
10266
|
+
...await importFileDirectory({
|
|
10267
|
+
srcDir,
|
|
10268
|
+
destDir,
|
|
10269
|
+
extensions: [".md"],
|
|
10270
|
+
fromTool: KILO_CODE_TARGET,
|
|
10271
|
+
normalize,
|
|
10272
|
+
mapEntry: async ({ srcPath, relativePath, content, normalizeTo }) => {
|
|
10273
|
+
const mapping = await kiloNonRootRuleMapper({
|
|
10274
|
+
absolutePath: srcPath,
|
|
10275
|
+
relativePath,
|
|
10276
|
+
content,
|
|
10277
|
+
destDir,
|
|
10278
|
+
normalizeTo
|
|
10279
|
+
});
|
|
10280
|
+
if (relativePath === LEGACY_ROOT_RULE_FILE) return null;
|
|
10281
|
+
if (!mapping) return null;
|
|
10282
|
+
return { ...mapping, feature: "rules" };
|
|
10283
|
+
}
|
|
10284
|
+
})
|
|
10285
|
+
);
|
|
10286
|
+
}
|
|
10287
|
+
async function importLegacyWorkflows(projectRoot, results, normalize) {
|
|
10288
|
+
const srcDir = join(projectRoot, KILO_CODE_LEGACY_WORKFLOWS_DIR);
|
|
10289
|
+
if (!await pathExists(srcDir)) return;
|
|
10290
|
+
const destDir = join(projectRoot, KILO_CODE_CANONICAL_COMMANDS_DIR);
|
|
10291
|
+
results.push(
|
|
10292
|
+
...await importFileDirectory({
|
|
10293
|
+
srcDir,
|
|
10294
|
+
destDir,
|
|
10295
|
+
extensions: [".md"],
|
|
10296
|
+
fromTool: KILO_CODE_TARGET,
|
|
10297
|
+
normalize,
|
|
10298
|
+
mapEntry: async ({ srcPath, relativePath, content, normalizeTo }) => {
|
|
10299
|
+
const mapping = await kiloCommandMapper({
|
|
10300
|
+
absolutePath: srcPath,
|
|
10301
|
+
relativePath,
|
|
10302
|
+
content,
|
|
10303
|
+
destDir,
|
|
10304
|
+
normalizeTo
|
|
10305
|
+
});
|
|
10306
|
+
if (!mapping) return null;
|
|
10307
|
+
return { ...mapping, feature: "commands" };
|
|
10308
|
+
}
|
|
10309
|
+
})
|
|
10310
|
+
);
|
|
10311
|
+
}
|
|
10312
|
+
async function importLegacyModes(projectRoot, results, normalize) {
|
|
10313
|
+
const sourceFile = join(projectRoot, KILO_CODE_LEGACY_MODES_FILE);
|
|
10314
|
+
const content = await readFileSafe(sourceFile);
|
|
10315
|
+
if (content === null) return;
|
|
10316
|
+
let parsed;
|
|
10317
|
+
try {
|
|
10318
|
+
parsed = parse(content);
|
|
10319
|
+
} catch {
|
|
10320
|
+
return;
|
|
10321
|
+
}
|
|
10322
|
+
if (!parsed || !Array.isArray(parsed.customModes)) return;
|
|
10323
|
+
for (const raw of parsed.customModes) {
|
|
10324
|
+
if (!raw || typeof raw !== "object") continue;
|
|
10325
|
+
const mode = raw;
|
|
10326
|
+
if (typeof mode.slug !== "string" || mode.slug.length === 0) continue;
|
|
10327
|
+
const slug = mode.slug;
|
|
10328
|
+
const destPath = join(projectRoot, KILO_CODE_CANONICAL_AGENTS_DIR, `${slug}.md`);
|
|
10329
|
+
const description = typeof mode.description === "string" ? mode.description : "";
|
|
10330
|
+
const role = typeof mode.roleDefinition === "string" ? mode.roleDefinition.trim() : "";
|
|
10331
|
+
const whenToUse = typeof mode.whenToUse === "string" ? mode.whenToUse.trim() : "";
|
|
10332
|
+
const body = whenToUse ? `${role}
|
|
10333
|
+
|
|
10334
|
+
## When to use
|
|
10335
|
+
|
|
10336
|
+
${whenToUse}` : role;
|
|
10337
|
+
const frontmatter = {};
|
|
10338
|
+
if (description) frontmatter.description = description;
|
|
10339
|
+
if (typeof mode.name === "string" && mode.name.length > 0) frontmatter.name = mode.name;
|
|
10340
|
+
const serialized = await serializeImportedAgentWithFallback(destPath, frontmatter, body);
|
|
10341
|
+
const normalized = normalize(serialized, sourceFile, destPath);
|
|
10342
|
+
await writeFileAtomic(destPath, normalized);
|
|
10343
|
+
results.push({
|
|
10344
|
+
feature: "agents",
|
|
10345
|
+
fromTool: KILO_CODE_TARGET,
|
|
10346
|
+
fromPath: sourceFile,
|
|
10347
|
+
toPath: `${KILO_CODE_CANONICAL_AGENTS_DIR}/${slug}.md`
|
|
10348
|
+
});
|
|
10349
|
+
}
|
|
10350
|
+
}
|
|
10351
|
+
async function importFromKiloCode(projectRoot, options = {}) {
|
|
10352
|
+
const scope = options.scope ?? "project";
|
|
10353
|
+
const results = [];
|
|
10354
|
+
const normalize = await createImportReferenceNormalizer(KILO_CODE_TARGET, projectRoot, scope);
|
|
10355
|
+
results.push(...await runDescriptorImport(descriptor10, projectRoot, scope, { normalize }));
|
|
10356
|
+
await importEmbeddedSkills(
|
|
10357
|
+
projectRoot,
|
|
10358
|
+
KILO_CODE_SKILLS_DIR,
|
|
10359
|
+
KILO_CODE_TARGET,
|
|
10360
|
+
results,
|
|
10361
|
+
normalize
|
|
10362
|
+
);
|
|
10363
|
+
if (scope === "project") {
|
|
10364
|
+
await importLegacyRules(projectRoot, results, normalize);
|
|
10365
|
+
await importLegacyWorkflows(projectRoot, results, normalize);
|
|
10366
|
+
await importLegacyModes(projectRoot, results, normalize);
|
|
10367
|
+
await importEmbeddedSkills(
|
|
10368
|
+
projectRoot,
|
|
10369
|
+
KILO_CODE_LEGACY_SKILLS_DIR,
|
|
10370
|
+
KILO_CODE_TARGET,
|
|
10371
|
+
results,
|
|
10372
|
+
normalize
|
|
10373
|
+
);
|
|
10374
|
+
}
|
|
10375
|
+
return results;
|
|
10376
|
+
}
|
|
10377
|
+
var CANONICAL_ROOT_RULE_PATH, LEGACY_ROOT_RULE_FILE;
|
|
10378
|
+
var init_importer10 = __esm({
|
|
10379
|
+
"src/targets/kilo-code/importer.ts"() {
|
|
10380
|
+
init_import_rewriter();
|
|
10381
|
+
init_embedded_skill();
|
|
10382
|
+
init_import_orchestrator();
|
|
10383
|
+
init_descriptor_import_runner();
|
|
10384
|
+
init_fs();
|
|
10385
|
+
init_import_metadata();
|
|
10386
|
+
init_markdown();
|
|
10387
|
+
init_import_mappers7();
|
|
10388
|
+
init_constants8();
|
|
10389
|
+
init_kilo_code2();
|
|
10390
|
+
CANONICAL_ROOT_RULE_PATH = `${KILO_CODE_CANONICAL_RULES_DIR}/_root.md`;
|
|
10391
|
+
LEGACY_ROOT_RULE_FILE = "00-root.md";
|
|
10392
|
+
}
|
|
10393
|
+
});
|
|
10394
|
+
|
|
10395
|
+
// src/targets/kilo-code/linter.ts
|
|
10396
|
+
function lintRules10(canonical, projectRoot, projectFiles, options) {
|
|
10397
|
+
return validateRules(canonical, projectRoot, projectFiles, {
|
|
10398
|
+
checkGlobMatches: options?.scope !== "global"
|
|
10399
|
+
}).map((diagnostic) => ({
|
|
10400
|
+
...diagnostic,
|
|
10401
|
+
target: KILO_CODE_TARGET
|
|
10402
|
+
}));
|
|
10403
|
+
}
|
|
10404
|
+
var init_linter10 = __esm({
|
|
10405
|
+
"src/targets/kilo-code/linter.ts"() {
|
|
10406
|
+
init_validate_rules();
|
|
10407
|
+
init_constants8();
|
|
10408
|
+
}
|
|
10409
|
+
});
|
|
10410
|
+
|
|
10411
|
+
// src/targets/kilo-code/lint.ts
|
|
10412
|
+
function lintHooks4(canonical) {
|
|
10413
|
+
if (!canonical.hooks) return [];
|
|
10414
|
+
const hasEntries = Object.values(canonical.hooks).some(
|
|
10415
|
+
(entries) => Array.isArray(entries) && entries.length > 0
|
|
10416
|
+
);
|
|
10417
|
+
if (!hasEntries) return [];
|
|
10418
|
+
return [
|
|
10419
|
+
createWarning(
|
|
10420
|
+
".agentsmesh/hooks.yaml",
|
|
10421
|
+
"kilo-code",
|
|
10422
|
+
"kilo-code does not support user-defined lifecycle hooks; canonical hooks are not projected."
|
|
10423
|
+
)
|
|
10424
|
+
];
|
|
10425
|
+
}
|
|
10426
|
+
function lintPermissions2(canonical) {
|
|
10427
|
+
if (!canonical.permissions) return [];
|
|
10428
|
+
const { allow, deny } = canonical.permissions;
|
|
10429
|
+
const ask = canonical.permissions.ask ?? [];
|
|
10430
|
+
if (allow.length === 0 && deny.length === 0 && ask.length === 0) return [];
|
|
10431
|
+
return [
|
|
10432
|
+
createWarning(
|
|
10433
|
+
".agentsmesh/permissions.yaml",
|
|
10434
|
+
"kilo-code",
|
|
10435
|
+
"kilo-code permissions live in kilo.jsonc, which agentsmesh does not generate in v1; canonical permissions are not projected."
|
|
10436
|
+
)
|
|
10437
|
+
];
|
|
10438
|
+
}
|
|
10439
|
+
var init_lint8 = __esm({
|
|
10440
|
+
"src/targets/kilo-code/lint.ts"() {
|
|
10441
|
+
init_helpers();
|
|
10442
|
+
}
|
|
10443
|
+
});
|
|
10444
|
+
|
|
10445
|
+
// src/targets/kilo-code/index.ts
|
|
10446
|
+
var target10, project10, globalLayout3, capabilities, descriptor10;
|
|
10447
|
+
var init_kilo_code2 = __esm({
|
|
10448
|
+
"src/targets/kilo-code/index.ts"() {
|
|
10449
|
+
init_generator13();
|
|
10450
|
+
init_constants8();
|
|
10451
|
+
init_skill_mirror();
|
|
10452
|
+
init_importer10();
|
|
10453
|
+
init_import_mappers7();
|
|
10454
|
+
init_linter10();
|
|
10455
|
+
init_lint8();
|
|
10456
|
+
init_import_map_builders();
|
|
10457
|
+
target10 = {
|
|
10458
|
+
name: KILO_CODE_TARGET,
|
|
10459
|
+
primaryRootInstructionPath: KILO_CODE_ROOT_RULE,
|
|
10460
|
+
generateRules: generateRules10,
|
|
10461
|
+
generateCommands: generateCommands10,
|
|
10462
|
+
generateAgents: generateAgents8,
|
|
10463
|
+
generateSkills: generateSkills10,
|
|
10464
|
+
generateMcp: generateMcp8,
|
|
10465
|
+
generateIgnore: generateIgnore6,
|
|
10466
|
+
importFrom: importFromKiloCode
|
|
10467
|
+
};
|
|
10468
|
+
project10 = {
|
|
10469
|
+
rootInstructionPath: KILO_CODE_ROOT_RULE,
|
|
10470
|
+
skillDir: KILO_CODE_SKILLS_DIR,
|
|
10471
|
+
managedOutputs: {
|
|
10472
|
+
dirs: [KILO_CODE_RULES_DIR, KILO_CODE_COMMANDS_DIR, KILO_CODE_AGENTS_DIR, KILO_CODE_SKILLS_DIR],
|
|
10473
|
+
files: [KILO_CODE_ROOT_RULE, KILO_CODE_MCP_FILE, KILO_CODE_IGNORE]
|
|
10474
|
+
},
|
|
10475
|
+
paths: {
|
|
10476
|
+
rulePath(slug, _rule) {
|
|
10477
|
+
return `${KILO_CODE_RULES_DIR}/${slug}.md`;
|
|
10478
|
+
},
|
|
10479
|
+
commandPath(name, _config) {
|
|
10480
|
+
return `${KILO_CODE_COMMANDS_DIR}/${name}.md`;
|
|
10481
|
+
},
|
|
10482
|
+
agentPath(name, _config) {
|
|
10483
|
+
return `${KILO_CODE_AGENTS_DIR}/${name}.md`;
|
|
10484
|
+
}
|
|
10485
|
+
}
|
|
10486
|
+
};
|
|
10487
|
+
globalLayout3 = {
|
|
10488
|
+
rootInstructionPath: KILO_CODE_GLOBAL_AGENTS_MD,
|
|
10489
|
+
skillDir: KILO_CODE_GLOBAL_SKILLS_DIR,
|
|
10490
|
+
managedOutputs: {
|
|
10491
|
+
dirs: [
|
|
10492
|
+
KILO_CODE_GLOBAL_RULES_DIR,
|
|
10493
|
+
KILO_CODE_GLOBAL_COMMANDS_DIR,
|
|
10494
|
+
KILO_CODE_GLOBAL_AGENTS_DIR,
|
|
10495
|
+
KILO_CODE_GLOBAL_SKILLS_DIR,
|
|
10496
|
+
KILO_CODE_GLOBAL_AGENTS_SKILLS_DIR
|
|
10497
|
+
],
|
|
10498
|
+
files: [KILO_CODE_GLOBAL_AGENTS_MD, KILO_CODE_GLOBAL_MCP_FILE, KILO_CODE_GLOBAL_IGNORE]
|
|
10499
|
+
},
|
|
10500
|
+
rewriteGeneratedPath(path) {
|
|
10501
|
+
if (path === KILO_CODE_ROOT_RULE) return KILO_CODE_GLOBAL_AGENTS_MD;
|
|
10502
|
+
return path;
|
|
10503
|
+
},
|
|
10504
|
+
mirrorGlobalPath(path, activeTargets) {
|
|
10505
|
+
return mirrorSkillsToAgents(path, KILO_CODE_GLOBAL_SKILLS_DIR, activeTargets);
|
|
10506
|
+
},
|
|
10507
|
+
paths: {
|
|
10508
|
+
rulePath(slug, _rule) {
|
|
10509
|
+
return `${KILO_CODE_GLOBAL_RULES_DIR}/${slug}.md`;
|
|
10510
|
+
},
|
|
10511
|
+
commandPath(name, _config) {
|
|
10512
|
+
return `${KILO_CODE_GLOBAL_COMMANDS_DIR}/${name}.md`;
|
|
10513
|
+
},
|
|
10514
|
+
agentPath(name, _config) {
|
|
10515
|
+
return `${KILO_CODE_GLOBAL_AGENTS_DIR}/${name}.md`;
|
|
10516
|
+
}
|
|
10517
|
+
}
|
|
10518
|
+
};
|
|
10519
|
+
capabilities = {
|
|
10520
|
+
rules: "native",
|
|
10521
|
+
additionalRules: "native",
|
|
10522
|
+
commands: "native",
|
|
10523
|
+
agents: "native",
|
|
10524
|
+
skills: "native",
|
|
10525
|
+
mcp: "native",
|
|
10526
|
+
hooks: "none",
|
|
10527
|
+
ignore: "native",
|
|
10528
|
+
permissions: "none"
|
|
10529
|
+
};
|
|
10530
|
+
descriptor10 = {
|
|
10531
|
+
id: KILO_CODE_TARGET,
|
|
10532
|
+
generators: target10,
|
|
10533
|
+
capabilities,
|
|
10534
|
+
emptyImportMessage: "No Kilo Code config found (AGENTS.md, .kilo/rules, .kilo/commands, .kilo/agents, .kilo/skills, .kilo/mcp.json, .kilocodeignore, .kilocode/, or .kilocodemodes).",
|
|
10535
|
+
lintRules: lintRules10,
|
|
10536
|
+
lint: {
|
|
10537
|
+
hooks: lintHooks4,
|
|
10538
|
+
permissions: lintPermissions2
|
|
10539
|
+
},
|
|
10540
|
+
project: project10,
|
|
10541
|
+
globalSupport: {
|
|
10542
|
+
capabilities,
|
|
10543
|
+
detectionPaths: [
|
|
10544
|
+
KILO_CODE_GLOBAL_AGENTS_MD,
|
|
10545
|
+
KILO_CODE_GLOBAL_RULES_DIR,
|
|
10546
|
+
KILO_CODE_GLOBAL_COMMANDS_DIR,
|
|
10547
|
+
KILO_CODE_GLOBAL_AGENTS_DIR,
|
|
10548
|
+
KILO_CODE_GLOBAL_SKILLS_DIR,
|
|
10549
|
+
KILO_CODE_GLOBAL_MCP_FILE,
|
|
10550
|
+
KILO_CODE_GLOBAL_IGNORE
|
|
10551
|
+
],
|
|
10552
|
+
layout: globalLayout3
|
|
10553
|
+
},
|
|
10554
|
+
importer: {
|
|
10555
|
+
rules: [
|
|
10556
|
+
{
|
|
10557
|
+
// Root rule: prefer AGENTS.md (new) → in legacy projects users
|
|
10558
|
+
// historically used .kilocode/rules/00-root.md, but those import
|
|
10559
|
+
// through the descriptor's directory mapper as a regular rule with
|
|
10560
|
+
// slug `00-root` (we don't promote them to root). The legacy global
|
|
10561
|
+
// rules dir falls back to AGENTS.md only.
|
|
10562
|
+
feature: "rules",
|
|
10563
|
+
mode: "singleFile",
|
|
10564
|
+
source: {
|
|
10565
|
+
project: [KILO_CODE_ROOT_RULE],
|
|
10566
|
+
global: [KILO_CODE_GLOBAL_AGENTS_MD]
|
|
10567
|
+
},
|
|
10568
|
+
canonicalDir: KILO_CODE_CANONICAL_RULES_DIR,
|
|
10569
|
+
canonicalRootFilename: "_root.md",
|
|
10570
|
+
markAsRoot: true
|
|
10571
|
+
},
|
|
10572
|
+
{
|
|
10573
|
+
feature: "rules",
|
|
10574
|
+
mode: "directory",
|
|
10575
|
+
source: {
|
|
10576
|
+
project: [KILO_CODE_RULES_DIR],
|
|
10577
|
+
global: [KILO_CODE_GLOBAL_RULES_DIR]
|
|
10578
|
+
},
|
|
10579
|
+
canonicalDir: KILO_CODE_CANONICAL_RULES_DIR,
|
|
10580
|
+
extensions: [".md"],
|
|
10581
|
+
map: kiloNonRootRuleMapper
|
|
10582
|
+
}
|
|
10583
|
+
],
|
|
10584
|
+
commands: {
|
|
10585
|
+
feature: "commands",
|
|
10586
|
+
mode: "directory",
|
|
10587
|
+
source: {
|
|
10588
|
+
project: [KILO_CODE_COMMANDS_DIR],
|
|
10589
|
+
global: [KILO_CODE_GLOBAL_COMMANDS_DIR]
|
|
10590
|
+
},
|
|
10591
|
+
canonicalDir: KILO_CODE_CANONICAL_COMMANDS_DIR,
|
|
10592
|
+
extensions: [".md"],
|
|
10593
|
+
map: kiloCommandMapper
|
|
10594
|
+
},
|
|
10595
|
+
agents: {
|
|
10596
|
+
feature: "agents",
|
|
10597
|
+
mode: "directory",
|
|
10598
|
+
source: {
|
|
10599
|
+
project: [KILO_CODE_AGENTS_DIR],
|
|
10600
|
+
global: [KILO_CODE_GLOBAL_AGENTS_DIR]
|
|
10601
|
+
},
|
|
10602
|
+
canonicalDir: KILO_CODE_CANONICAL_AGENTS_DIR,
|
|
10603
|
+
extensions: [".md"],
|
|
10604
|
+
map: kiloAgentMapper
|
|
10605
|
+
},
|
|
10606
|
+
mcp: {
|
|
10607
|
+
feature: "mcp",
|
|
10608
|
+
mode: "mcpJson",
|
|
10609
|
+
source: {
|
|
10610
|
+
project: [KILO_CODE_MCP_FILE, KILO_CODE_LEGACY_MCP_FILE],
|
|
10611
|
+
global: [KILO_CODE_GLOBAL_MCP_FILE]
|
|
10612
|
+
},
|
|
10613
|
+
canonicalDir: ".agentsmesh",
|
|
10614
|
+
canonicalFilename: KILO_CODE_CANONICAL_MCP
|
|
10615
|
+
},
|
|
10616
|
+
ignore: {
|
|
10617
|
+
feature: "ignore",
|
|
10618
|
+
mode: "flatFile",
|
|
10619
|
+
source: {
|
|
10620
|
+
project: [KILO_CODE_IGNORE],
|
|
10621
|
+
global: [KILO_CODE_GLOBAL_IGNORE]
|
|
10622
|
+
},
|
|
10623
|
+
canonicalDir: ".agentsmesh",
|
|
10624
|
+
canonicalFilename: KILO_CODE_CANONICAL_IGNORE
|
|
10625
|
+
}
|
|
10626
|
+
},
|
|
10627
|
+
buildImportPaths: buildKiloCodeImportPaths,
|
|
10628
|
+
detectionPaths: [
|
|
10629
|
+
KILO_CODE_RULES_DIR,
|
|
10630
|
+
KILO_CODE_COMMANDS_DIR,
|
|
10631
|
+
KILO_CODE_AGENTS_DIR,
|
|
10632
|
+
KILO_CODE_SKILLS_DIR,
|
|
10633
|
+
KILO_CODE_MCP_FILE,
|
|
10634
|
+
KILO_CODE_LEGACY_RULES_DIR,
|
|
10635
|
+
KILO_CODE_LEGACY_WORKFLOWS_DIR,
|
|
10636
|
+
KILO_CODE_LEGACY_SKILLS_DIR,
|
|
10637
|
+
KILO_CODE_LEGACY_MCP_FILE,
|
|
10638
|
+
KILO_CODE_LEGACY_MODES_FILE,
|
|
10639
|
+
KILO_CODE_IGNORE,
|
|
10640
|
+
"kilo.jsonc",
|
|
10641
|
+
"kilo.json"
|
|
10642
|
+
]
|
|
10643
|
+
};
|
|
10644
|
+
}
|
|
10645
|
+
});
|
|
10646
|
+
function toKebab(value) {
|
|
10647
|
+
return value.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
|
|
10648
|
+
}
|
|
10649
|
+
function hookText(entry) {
|
|
10650
|
+
return entry.type === "prompt" ? entry.prompt : entry.command;
|
|
10651
|
+
}
|
|
10652
|
+
function toWhen(event, matcher) {
|
|
10653
|
+
const type = CANONICAL_TO_KIRO[event];
|
|
10654
|
+
if (event === "PreToolUse" || event === "PostToolUse") {
|
|
10655
|
+
return { type, tools: [matcher || "*"] };
|
|
10656
|
+
}
|
|
10657
|
+
return { type };
|
|
10658
|
+
}
|
|
10659
|
+
function generateKiroHooks(hooks) {
|
|
10660
|
+
const outputs = [];
|
|
10661
|
+
for (const [event, entries] of Object.entries(hooks)) {
|
|
10662
|
+
const mappedEvent = event;
|
|
10663
|
+
if (!(mappedEvent in CANONICAL_TO_KIRO) || !Array.isArray(entries)) continue;
|
|
10664
|
+
let index = 1;
|
|
10665
|
+
for (const entry of entries) {
|
|
10666
|
+
const text = hookText(entry);
|
|
10667
|
+
if (!text) continue;
|
|
10668
|
+
const file = {
|
|
10669
|
+
name: `${toKebab(event)} ${index}`,
|
|
10670
|
+
version: "1",
|
|
10671
|
+
when: toWhen(mappedEvent, entry.matcher),
|
|
10672
|
+
then: entry.type === "prompt" ? { type: "askAgent", prompt: text } : { type: "shellCommand", command: text }
|
|
10673
|
+
};
|
|
10674
|
+
outputs.push({
|
|
10675
|
+
name: `${toKebab(event)}-${index}.kiro.hook`,
|
|
10676
|
+
content: JSON.stringify(file, null, 2)
|
|
10677
|
+
});
|
|
10678
|
+
index += 1;
|
|
10679
|
+
}
|
|
10680
|
+
}
|
|
10681
|
+
return outputs;
|
|
10682
|
+
}
|
|
10683
|
+
function toCanonicalEntry(file) {
|
|
10684
|
+
const canonicalEvent = KIRO_TO_CANONICAL.get(file.when.type);
|
|
10685
|
+
if (!canonicalEvent) return null;
|
|
10686
|
+
const matcher = file.when.tools?.[0] ?? file.when.patterns?.[0] ?? "*";
|
|
9988
10687
|
if (file.then.type === "askAgent" && typeof file.then.prompt === "string") {
|
|
9989
10688
|
return {
|
|
9990
10689
|
event: canonicalEvent,
|
|
@@ -10051,7 +10750,7 @@ function steeringFrontmatter(rule) {
|
|
|
10051
10750
|
if (rule.description) frontmatter.description = rule.description;
|
|
10052
10751
|
return frontmatter;
|
|
10053
10752
|
}
|
|
10054
|
-
function
|
|
10753
|
+
function generateRules11(canonical) {
|
|
10055
10754
|
const outputs = [];
|
|
10056
10755
|
const root = canonical.rules.find((rule) => rule.root);
|
|
10057
10756
|
if (root) {
|
|
@@ -10068,10 +10767,10 @@ function generateRules10(canonical) {
|
|
|
10068
10767
|
}
|
|
10069
10768
|
return outputs;
|
|
10070
10769
|
}
|
|
10071
|
-
function
|
|
10770
|
+
function generateSkills11(canonical) {
|
|
10072
10771
|
return generateEmbeddedSkills(canonical, KIRO_SKILLS_DIR);
|
|
10073
10772
|
}
|
|
10074
|
-
function
|
|
10773
|
+
function generateMcp9(canonical) {
|
|
10075
10774
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
10076
10775
|
return [
|
|
10077
10776
|
{
|
|
@@ -10087,7 +10786,7 @@ function generateHooks5(canonical) {
|
|
|
10087
10786
|
content: hook.content
|
|
10088
10787
|
}));
|
|
10089
10788
|
}
|
|
10090
|
-
function
|
|
10789
|
+
function generateAgents9(canonical) {
|
|
10091
10790
|
return canonical.agents.map((agent) => {
|
|
10092
10791
|
const frontmatter = {
|
|
10093
10792
|
name: agent.name,
|
|
@@ -10102,16 +10801,16 @@ function generateAgents8(canonical) {
|
|
|
10102
10801
|
return { path: `${KIRO_AGENTS_DIR}/${agent.name}.md`, content };
|
|
10103
10802
|
});
|
|
10104
10803
|
}
|
|
10105
|
-
function
|
|
10804
|
+
function generateIgnore7(canonical) {
|
|
10106
10805
|
if (canonical.ignore.length === 0) return [];
|
|
10107
10806
|
return [{ path: KIRO_IGNORE, content: canonical.ignore.join("\n") }];
|
|
10108
10807
|
}
|
|
10109
|
-
var
|
|
10808
|
+
var init_generator14 = __esm({
|
|
10110
10809
|
"src/targets/kiro/generator.ts"() {
|
|
10111
10810
|
init_embedded_skill();
|
|
10112
10811
|
init_markdown();
|
|
10113
10812
|
init_hook_format();
|
|
10114
|
-
|
|
10813
|
+
init_constants9();
|
|
10115
10814
|
}
|
|
10116
10815
|
});
|
|
10117
10816
|
function canonicalRuleMeta(frontmatter) {
|
|
@@ -10200,12 +10899,12 @@ async function importFromKiro(projectRoot, options = {}) {
|
|
|
10200
10899
|
const normalize = await createImportReferenceNormalizer(KIRO_TARGET, projectRoot, scope);
|
|
10201
10900
|
await importRoot(projectRoot, results, normalize, scope);
|
|
10202
10901
|
await importNonRootRules(projectRoot, results, normalize);
|
|
10203
|
-
results.push(...await runDescriptorImport(
|
|
10902
|
+
results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
|
|
10204
10903
|
await importEmbeddedSkills(projectRoot, KIRO_SKILLS_DIR, KIRO_TARGET, results, normalize);
|
|
10205
10904
|
if (scope === "project") await importHooks2(projectRoot, results);
|
|
10206
10905
|
return results;
|
|
10207
10906
|
}
|
|
10208
|
-
var
|
|
10907
|
+
var init_importer11 = __esm({
|
|
10209
10908
|
"src/targets/kiro/importer.ts"() {
|
|
10210
10909
|
init_import_rewriter();
|
|
10211
10910
|
init_embedded_skill();
|
|
@@ -10216,13 +10915,13 @@ var init_importer10 = __esm({
|
|
|
10216
10915
|
init_fs();
|
|
10217
10916
|
init_markdown();
|
|
10218
10917
|
init_hook_format();
|
|
10219
|
-
|
|
10918
|
+
init_constants9();
|
|
10220
10919
|
init_kiro2();
|
|
10221
10920
|
}
|
|
10222
10921
|
});
|
|
10223
10922
|
|
|
10224
10923
|
// src/targets/kiro/linter.ts
|
|
10225
|
-
function
|
|
10924
|
+
function lintRules11(canonical, projectRoot, projectFiles, options) {
|
|
10226
10925
|
return validateRules(canonical, projectRoot, projectFiles, {
|
|
10227
10926
|
checkGlobMatches: options?.scope !== "global"
|
|
10228
10927
|
}).map((diagnostic) => ({
|
|
@@ -10230,15 +10929,15 @@ function lintRules10(canonical, projectRoot, projectFiles, options) {
|
|
|
10230
10929
|
target: KIRO_TARGET
|
|
10231
10930
|
}));
|
|
10232
10931
|
}
|
|
10233
|
-
var
|
|
10932
|
+
var init_linter11 = __esm({
|
|
10234
10933
|
"src/targets/kiro/linter.ts"() {
|
|
10235
10934
|
init_validate_rules();
|
|
10236
|
-
|
|
10935
|
+
init_constants9();
|
|
10237
10936
|
}
|
|
10238
10937
|
});
|
|
10239
10938
|
|
|
10240
10939
|
// src/targets/kiro/lint.ts
|
|
10241
|
-
function
|
|
10940
|
+
function lintHooks5(canonical) {
|
|
10242
10941
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
10243
10942
|
const supported = ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SubagentStop"];
|
|
10244
10943
|
const supportedSet = new Set(supported);
|
|
@@ -10246,35 +10945,35 @@ function lintHooks4(canonical) {
|
|
|
10246
10945
|
(event) => createUnsupportedHookWarning(event, "kiro", supported, { unsupportedBy: "Kiro hooks" })
|
|
10247
10946
|
);
|
|
10248
10947
|
}
|
|
10249
|
-
var
|
|
10948
|
+
var init_lint9 = __esm({
|
|
10250
10949
|
"src/targets/kiro/lint.ts"() {
|
|
10251
10950
|
init_helpers();
|
|
10252
10951
|
}
|
|
10253
10952
|
});
|
|
10254
10953
|
|
|
10255
10954
|
// src/targets/kiro/index.ts
|
|
10256
|
-
var
|
|
10955
|
+
var target11, project11, global8, globalCapabilities10, descriptor11;
|
|
10257
10956
|
var init_kiro2 = __esm({
|
|
10258
10957
|
"src/targets/kiro/index.ts"() {
|
|
10259
|
-
|
|
10958
|
+
init_generator14();
|
|
10260
10959
|
init_skill_mirror();
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10960
|
+
init_importer11();
|
|
10961
|
+
init_linter11();
|
|
10962
|
+
init_lint9();
|
|
10264
10963
|
init_import_map_builders();
|
|
10265
|
-
|
|
10266
|
-
|
|
10964
|
+
init_constants9();
|
|
10965
|
+
target11 = {
|
|
10267
10966
|
name: KIRO_TARGET,
|
|
10268
10967
|
primaryRootInstructionPath: KIRO_AGENTS_MD,
|
|
10269
|
-
generateRules:
|
|
10270
|
-
generateAgents:
|
|
10271
|
-
generateSkills:
|
|
10272
|
-
generateMcp:
|
|
10968
|
+
generateRules: generateRules11,
|
|
10969
|
+
generateAgents: generateAgents9,
|
|
10970
|
+
generateSkills: generateSkills11,
|
|
10971
|
+
generateMcp: generateMcp9,
|
|
10273
10972
|
generateHooks: generateHooks5,
|
|
10274
|
-
generateIgnore:
|
|
10973
|
+
generateIgnore: generateIgnore7,
|
|
10275
10974
|
importFrom: importFromKiro
|
|
10276
10975
|
};
|
|
10277
|
-
|
|
10976
|
+
project11 = {
|
|
10278
10977
|
rootInstructionPath: KIRO_AGENTS_MD,
|
|
10279
10978
|
skillDir: KIRO_SKILLS_DIR,
|
|
10280
10979
|
managedOutputs: {
|
|
@@ -10355,9 +11054,9 @@ var init_kiro2 = __esm({
|
|
|
10355
11054
|
ignore: "native",
|
|
10356
11055
|
permissions: "none"
|
|
10357
11056
|
};
|
|
10358
|
-
|
|
11057
|
+
descriptor11 = {
|
|
10359
11058
|
id: KIRO_TARGET,
|
|
10360
|
-
generators:
|
|
11059
|
+
generators: target11,
|
|
10361
11060
|
capabilities: {
|
|
10362
11061
|
rules: "native",
|
|
10363
11062
|
additionalRules: "native",
|
|
@@ -10370,11 +11069,11 @@ var init_kiro2 = __esm({
|
|
|
10370
11069
|
permissions: "none"
|
|
10371
11070
|
},
|
|
10372
11071
|
emptyImportMessage: "No Kiro config found (AGENTS.md, .kiro/steering, .kiro/skills, .kiro/agents, .kiro/hooks, .kiro/settings/mcp.json, or .kiroignore).",
|
|
10373
|
-
lintRules:
|
|
11072
|
+
lintRules: lintRules11,
|
|
10374
11073
|
lint: {
|
|
10375
|
-
hooks:
|
|
11074
|
+
hooks: lintHooks5
|
|
10376
11075
|
},
|
|
10377
|
-
project:
|
|
11076
|
+
project: project11,
|
|
10378
11077
|
globalSupport: {
|
|
10379
11078
|
capabilities: globalCapabilities10,
|
|
10380
11079
|
detectionPaths: [
|
|
@@ -10423,7 +11122,7 @@ var init_kiro2 = __esm({
|
|
|
10423
11122
|
};
|
|
10424
11123
|
}
|
|
10425
11124
|
});
|
|
10426
|
-
function
|
|
11125
|
+
function generateRules12(canonical) {
|
|
10427
11126
|
const outputs = [];
|
|
10428
11127
|
const root = canonical.rules.find((rule) => rule.root);
|
|
10429
11128
|
if (root) {
|
|
@@ -10443,7 +11142,7 @@ function generateRules11(canonical) {
|
|
|
10443
11142
|
}
|
|
10444
11143
|
return outputs;
|
|
10445
11144
|
}
|
|
10446
|
-
function
|
|
11145
|
+
function generateCommands11(canonical) {
|
|
10447
11146
|
return canonical.commands.map((command) => {
|
|
10448
11147
|
const frontmatter = {};
|
|
10449
11148
|
if (command.description) frontmatter.description = command.description;
|
|
@@ -10453,7 +11152,7 @@ function generateCommands10(canonical) {
|
|
|
10453
11152
|
};
|
|
10454
11153
|
});
|
|
10455
11154
|
}
|
|
10456
|
-
function
|
|
11155
|
+
function generateMcp10(canonical) {
|
|
10457
11156
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
10458
11157
|
return [
|
|
10459
11158
|
{
|
|
@@ -10462,14 +11161,14 @@ function generateMcp9(canonical) {
|
|
|
10462
11161
|
}
|
|
10463
11162
|
];
|
|
10464
11163
|
}
|
|
10465
|
-
function
|
|
11164
|
+
function generateIgnore8(canonical) {
|
|
10466
11165
|
if (canonical.ignore.length === 0) return [];
|
|
10467
11166
|
return [{ path: ROO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
10468
11167
|
}
|
|
10469
|
-
function
|
|
11168
|
+
function generateSkills12(canonical) {
|
|
10470
11169
|
return generateEmbeddedSkills(canonical, ROO_CODE_SKILLS_DIR);
|
|
10471
11170
|
}
|
|
10472
|
-
function
|
|
11171
|
+
function generateAgents10(canonical) {
|
|
10473
11172
|
if (canonical.agents.length === 0) return [];
|
|
10474
11173
|
const customModes = canonical.agents.map((agent) => {
|
|
10475
11174
|
const slug = basename(agent.source, ".md");
|
|
@@ -10480,19 +11179,19 @@ function generateAgents9(canonical) {
|
|
|
10480
11179
|
});
|
|
10481
11180
|
return [{ path: ROO_CODE_MODES_FILE, content: stringify({ customModes }) }];
|
|
10482
11181
|
}
|
|
10483
|
-
var
|
|
11182
|
+
var init_generator15 = __esm({
|
|
10484
11183
|
"src/targets/roo-code/generator.ts"() {
|
|
10485
11184
|
init_embedded_skill();
|
|
10486
11185
|
init_markdown();
|
|
10487
|
-
|
|
11186
|
+
init_constants10();
|
|
10488
11187
|
}
|
|
10489
11188
|
});
|
|
10490
11189
|
var rooNonRootRuleMapper, rooCommandMapper;
|
|
10491
|
-
var
|
|
11190
|
+
var init_import_mappers8 = __esm({
|
|
10492
11191
|
"src/targets/roo-code/import-mappers.ts"() {
|
|
10493
11192
|
init_markdown();
|
|
10494
11193
|
init_import_metadata();
|
|
10495
|
-
|
|
11194
|
+
init_constants10();
|
|
10496
11195
|
rooNonRootRuleMapper = async ({
|
|
10497
11196
|
relativePath,
|
|
10498
11197
|
normalizeTo,
|
|
@@ -10576,25 +11275,25 @@ async function importFromRooCode(projectRoot, options = {}) {
|
|
|
10576
11275
|
const scope = options.scope ?? "project";
|
|
10577
11276
|
const results = [];
|
|
10578
11277
|
const normalize = await createImportReferenceNormalizer(ROO_CODE_TARGET, projectRoot, scope);
|
|
10579
|
-
results.push(...await runDescriptorImport(
|
|
11278
|
+
results.push(...await runDescriptorImport(descriptor12, projectRoot, scope, { normalize }));
|
|
10580
11279
|
await importPerModeRules(projectRoot, results, normalize);
|
|
10581
11280
|
await importEmbeddedSkills(projectRoot, ROO_CODE_SKILLS_DIR, ROO_CODE_TARGET, results, normalize);
|
|
10582
11281
|
return results;
|
|
10583
11282
|
}
|
|
10584
|
-
var
|
|
11283
|
+
var init_importer12 = __esm({
|
|
10585
11284
|
"src/targets/roo-code/importer.ts"() {
|
|
10586
11285
|
init_import_rewriter();
|
|
10587
11286
|
init_embedded_skill();
|
|
10588
11287
|
init_import_orchestrator();
|
|
10589
11288
|
init_descriptor_import_runner();
|
|
10590
|
-
|
|
10591
|
-
|
|
11289
|
+
init_import_mappers8();
|
|
11290
|
+
init_constants10();
|
|
10592
11291
|
init_roo_code2();
|
|
10593
11292
|
}
|
|
10594
11293
|
});
|
|
10595
11294
|
|
|
10596
11295
|
// src/targets/roo-code/linter.ts
|
|
10597
|
-
function
|
|
11296
|
+
function lintRules12(canonical, projectRoot, projectFiles, options) {
|
|
10598
11297
|
return validateRules(canonical, projectRoot, projectFiles, {
|
|
10599
11298
|
checkGlobMatches: options?.scope !== "global"
|
|
10600
11299
|
}).map((diagnostic) => ({
|
|
@@ -10602,10 +11301,10 @@ function lintRules11(canonical, projectRoot, projectFiles, options) {
|
|
|
10602
11301
|
target: ROO_CODE_TARGET
|
|
10603
11302
|
}));
|
|
10604
11303
|
}
|
|
10605
|
-
var
|
|
11304
|
+
var init_linter12 = __esm({
|
|
10606
11305
|
"src/targets/roo-code/linter.ts"() {
|
|
10607
11306
|
init_validate_rules();
|
|
10608
|
-
|
|
11307
|
+
init_constants10();
|
|
10609
11308
|
}
|
|
10610
11309
|
});
|
|
10611
11310
|
function computeStatus5(existing, content) {
|
|
@@ -10613,29 +11312,29 @@ function computeStatus5(existing, content) {
|
|
|
10613
11312
|
if (existing !== content) return "updated";
|
|
10614
11313
|
return "unchanged";
|
|
10615
11314
|
}
|
|
10616
|
-
var
|
|
11315
|
+
var target12, project12, generateRooGlobalExtras, global9, globalCapabilities11, descriptor12;
|
|
10617
11316
|
var init_roo_code2 = __esm({
|
|
10618
11317
|
"src/targets/roo-code/index.ts"() {
|
|
10619
11318
|
init_fs();
|
|
10620
|
-
|
|
10621
|
-
|
|
11319
|
+
init_generator15();
|
|
11320
|
+
init_constants10();
|
|
10622
11321
|
init_skill_mirror();
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
11322
|
+
init_importer12();
|
|
11323
|
+
init_import_mappers8();
|
|
11324
|
+
init_linter12();
|
|
10626
11325
|
init_import_map_builders();
|
|
10627
|
-
|
|
11326
|
+
target12 = {
|
|
10628
11327
|
name: "roo-code",
|
|
10629
11328
|
primaryRootInstructionPath: ROO_CODE_ROOT_RULE,
|
|
10630
|
-
generateRules:
|
|
10631
|
-
generateCommands:
|
|
10632
|
-
generateSkills:
|
|
10633
|
-
generateMcp:
|
|
10634
|
-
generateIgnore:
|
|
10635
|
-
generateAgents:
|
|
11329
|
+
generateRules: generateRules12,
|
|
11330
|
+
generateCommands: generateCommands11,
|
|
11331
|
+
generateSkills: generateSkills12,
|
|
11332
|
+
generateMcp: generateMcp10,
|
|
11333
|
+
generateIgnore: generateIgnore8,
|
|
11334
|
+
generateAgents: generateAgents10,
|
|
10636
11335
|
importFrom: importFromRooCode
|
|
10637
11336
|
};
|
|
10638
|
-
|
|
11337
|
+
project12 = {
|
|
10639
11338
|
rootInstructionPath: ROO_CODE_ROOT_RULE,
|
|
10640
11339
|
skillDir: ".roo/skills",
|
|
10641
11340
|
managedOutputs: {
|
|
@@ -10743,9 +11442,9 @@ var init_roo_code2 = __esm({
|
|
|
10743
11442
|
ignore: "native",
|
|
10744
11443
|
permissions: "none"
|
|
10745
11444
|
};
|
|
10746
|
-
|
|
11445
|
+
descriptor12 = {
|
|
10747
11446
|
id: "roo-code",
|
|
10748
|
-
generators:
|
|
11447
|
+
generators: target12,
|
|
10749
11448
|
capabilities: {
|
|
10750
11449
|
rules: "native",
|
|
10751
11450
|
additionalRules: "native",
|
|
@@ -10758,8 +11457,8 @@ var init_roo_code2 = __esm({
|
|
|
10758
11457
|
permissions: "none"
|
|
10759
11458
|
},
|
|
10760
11459
|
emptyImportMessage: "No Roo Code config found (.roo/rules, .roo/commands, .roo/skills, .roo/mcp.json, .rooignore, or .roorules).",
|
|
10761
|
-
lintRules:
|
|
10762
|
-
project:
|
|
11460
|
+
lintRules: lintRules12,
|
|
11461
|
+
project: project12,
|
|
10763
11462
|
globalSupport: {
|
|
10764
11463
|
capabilities: globalCapabilities11,
|
|
10765
11464
|
detectionPaths: [
|
|
@@ -10842,7 +11541,7 @@ var init_roo_code2 = __esm({
|
|
|
10842
11541
|
|
|
10843
11542
|
// src/targets/windsurf/constants.ts
|
|
10844
11543
|
var WINDSURF_TARGET, WINDSURF_RULES_ROOT, WINDSURF_RULES_DIR, WINDSURF_IGNORE, CODEIUM_IGNORE, WINDSURF_AGENTS_MD, WINDSURF_HOOKS_FILE, WINDSURF_MCP_EXAMPLE_FILE, WINDSURF_MCP_CONFIG_FILE, WINDSURF_WORKFLOWS_DIR, WINDSURF_SKILLS_DIR, WINDSURF_CANONICAL_RULES_DIR, WINDSURF_CANONICAL_COMMANDS_DIR, WINDSURF_CANONICAL_AGENTS_DIR, WINDSURF_CANONICAL_SKILLS_DIR, WINDSURF_CANONICAL_IGNORE, WINDSURF_CANONICAL_HOOKS, WINDSURF_CANONICAL_MCP, WINDSURF_GLOBAL_RULES, WINDSURF_GLOBAL_SKILLS_DIR, WINDSURF_GLOBAL_WORKFLOWS_DIR, WINDSURF_GLOBAL_HOOKS_FILE, WINDSURF_GLOBAL_MCP_FILE, WINDSURF_GLOBAL_IGNORE, WINDSURF_GLOBAL_AGENTS_SKILLS_DIR;
|
|
10845
|
-
var
|
|
11544
|
+
var init_constants14 = __esm({
|
|
10846
11545
|
"src/targets/windsurf/constants.ts"() {
|
|
10847
11546
|
WINDSURF_TARGET = "windsurf";
|
|
10848
11547
|
WINDSURF_RULES_ROOT = ".windsurfrules";
|
|
@@ -10881,7 +11580,7 @@ function directoryScopedRuleDir(globs) {
|
|
|
10881
11580
|
if (dirs.length !== globs.length) return null;
|
|
10882
11581
|
return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
|
|
10883
11582
|
}
|
|
10884
|
-
function
|
|
11583
|
+
function generateRules13(canonical) {
|
|
10885
11584
|
const outputs = [];
|
|
10886
11585
|
const root = canonical.rules.find((r) => r.root);
|
|
10887
11586
|
if (!root) return [];
|
|
@@ -10918,23 +11617,23 @@ function generateRules12(canonical) {
|
|
|
10918
11617
|
var init_rules4 = __esm({
|
|
10919
11618
|
"src/targets/windsurf/generator/rules.ts"() {
|
|
10920
11619
|
init_markdown();
|
|
10921
|
-
|
|
11620
|
+
init_constants14();
|
|
10922
11621
|
}
|
|
10923
11622
|
});
|
|
10924
11623
|
|
|
10925
11624
|
// src/targets/windsurf/generator/ignore.ts
|
|
10926
|
-
function
|
|
11625
|
+
function generateIgnore9(canonical) {
|
|
10927
11626
|
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
10928
11627
|
return [{ path: CODEIUM_IGNORE, content: canonical.ignore.join("\n") }];
|
|
10929
11628
|
}
|
|
10930
11629
|
var init_ignore3 = __esm({
|
|
10931
11630
|
"src/targets/windsurf/generator/ignore.ts"() {
|
|
10932
|
-
|
|
11631
|
+
init_constants14();
|
|
10933
11632
|
}
|
|
10934
11633
|
});
|
|
10935
11634
|
|
|
10936
11635
|
// src/targets/windsurf/generator/workflows.ts
|
|
10937
|
-
function
|
|
11636
|
+
function generateCommands12(canonical) {
|
|
10938
11637
|
return canonical.commands.map((cmd) => {
|
|
10939
11638
|
const frontmatter = {
|
|
10940
11639
|
description: cmd.description.trim() || void 0,
|
|
@@ -10953,12 +11652,12 @@ function generateCommands11(canonical) {
|
|
|
10953
11652
|
var init_workflows = __esm({
|
|
10954
11653
|
"src/targets/windsurf/generator/workflows.ts"() {
|
|
10955
11654
|
init_markdown();
|
|
10956
|
-
|
|
11655
|
+
init_constants14();
|
|
10957
11656
|
}
|
|
10958
11657
|
});
|
|
10959
11658
|
|
|
10960
11659
|
// src/targets/windsurf/generator/agents.ts
|
|
10961
|
-
function
|
|
11660
|
+
function generateAgents11(canonical) {
|
|
10962
11661
|
return canonical.agents.map((agent) => ({
|
|
10963
11662
|
path: `${WINDSURF_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
|
|
10964
11663
|
content: serializeProjectedAgentSkill(agent)
|
|
@@ -10967,12 +11666,12 @@ function generateAgents10(canonical) {
|
|
|
10967
11666
|
var init_agents4 = __esm({
|
|
10968
11667
|
"src/targets/windsurf/generator/agents.ts"() {
|
|
10969
11668
|
init_projected_agent_skill();
|
|
10970
|
-
|
|
11669
|
+
init_constants14();
|
|
10971
11670
|
}
|
|
10972
11671
|
});
|
|
10973
11672
|
|
|
10974
11673
|
// src/targets/windsurf/generator/mcp.ts
|
|
10975
|
-
function
|
|
11674
|
+
function generateMcp11(canonical) {
|
|
10976
11675
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
10977
11676
|
return [
|
|
10978
11677
|
{
|
|
@@ -10983,7 +11682,7 @@ function generateMcp10(canonical) {
|
|
|
10983
11682
|
}
|
|
10984
11683
|
var init_mcp3 = __esm({
|
|
10985
11684
|
"src/targets/windsurf/generator/mcp.ts"() {
|
|
10986
|
-
|
|
11685
|
+
init_constants14();
|
|
10987
11686
|
}
|
|
10988
11687
|
});
|
|
10989
11688
|
|
|
@@ -11026,12 +11725,12 @@ function generateHooks6(canonical) {
|
|
|
11026
11725
|
var init_hooks2 = __esm({
|
|
11027
11726
|
"src/targets/windsurf/generator/hooks.ts"() {
|
|
11028
11727
|
init_hook_command();
|
|
11029
|
-
|
|
11728
|
+
init_constants14();
|
|
11030
11729
|
}
|
|
11031
11730
|
});
|
|
11032
11731
|
|
|
11033
11732
|
// src/targets/windsurf/generator/skills.ts
|
|
11034
|
-
function
|
|
11733
|
+
function generateSkills13(canonical) {
|
|
11035
11734
|
const outputs = [];
|
|
11036
11735
|
for (const skill of canonical.skills) {
|
|
11037
11736
|
const frontmatter = {
|
|
@@ -11053,12 +11752,12 @@ function generateSkills12(canonical) {
|
|
|
11053
11752
|
var init_skills4 = __esm({
|
|
11054
11753
|
"src/targets/windsurf/generator/skills.ts"() {
|
|
11055
11754
|
init_markdown();
|
|
11056
|
-
|
|
11755
|
+
init_constants14();
|
|
11057
11756
|
}
|
|
11058
11757
|
});
|
|
11059
11758
|
|
|
11060
11759
|
// src/targets/windsurf/generator/index.ts
|
|
11061
|
-
var
|
|
11760
|
+
var init_generator16 = __esm({
|
|
11062
11761
|
"src/targets/windsurf/generator/index.ts"() {
|
|
11063
11762
|
init_rules4();
|
|
11064
11763
|
init_ignore3();
|
|
@@ -11071,9 +11770,9 @@ var init_generator15 = __esm({
|
|
|
11071
11770
|
});
|
|
11072
11771
|
|
|
11073
11772
|
// src/targets/windsurf/generator.ts
|
|
11074
|
-
var
|
|
11773
|
+
var init_generator17 = __esm({
|
|
11075
11774
|
"src/targets/windsurf/generator.ts"() {
|
|
11076
|
-
|
|
11775
|
+
init_generator16();
|
|
11077
11776
|
}
|
|
11078
11777
|
});
|
|
11079
11778
|
function toStringArray8(value) {
|
|
@@ -11125,7 +11824,7 @@ var init_importer_workflows = __esm({
|
|
|
11125
11824
|
init_fs();
|
|
11126
11825
|
init_markdown();
|
|
11127
11826
|
init_import_metadata();
|
|
11128
|
-
|
|
11827
|
+
init_constants14();
|
|
11129
11828
|
}
|
|
11130
11829
|
});
|
|
11131
11830
|
async function importSkills4(projectRoot, results, normalize, skillsRelDir = WINDSURF_SKILLS_DIR) {
|
|
@@ -11172,7 +11871,7 @@ var init_skills_adapter5 = __esm({
|
|
|
11172
11871
|
init_projected_agent_skill();
|
|
11173
11872
|
init_scoped_agents_import();
|
|
11174
11873
|
init_skill_import_pipeline();
|
|
11175
|
-
|
|
11874
|
+
init_constants14();
|
|
11176
11875
|
}
|
|
11177
11876
|
});
|
|
11178
11877
|
async function importWindsurfHooks(projectRoot, results) {
|
|
@@ -11270,7 +11969,7 @@ async function importWindsurfMcp(projectRoot, results) {
|
|
|
11270
11969
|
var init_importer_hooks_mcp = __esm({
|
|
11271
11970
|
"src/targets/windsurf/importer-hooks-mcp.ts"() {
|
|
11272
11971
|
init_fs();
|
|
11273
|
-
|
|
11972
|
+
init_constants14();
|
|
11274
11973
|
}
|
|
11275
11974
|
});
|
|
11276
11975
|
async function importFromWindsurf(projectRoot, options) {
|
|
@@ -11407,7 +12106,7 @@ async function importFromWindsurf(projectRoot, options) {
|
|
|
11407
12106
|
await importWindsurfMcp(projectRoot, results);
|
|
11408
12107
|
return results;
|
|
11409
12108
|
}
|
|
11410
|
-
var
|
|
12109
|
+
var init_importer13 = __esm({
|
|
11411
12110
|
"src/targets/windsurf/importer.ts"() {
|
|
11412
12111
|
init_import_rewriter();
|
|
11413
12112
|
init_fs();
|
|
@@ -11415,13 +12114,13 @@ var init_importer12 = __esm({
|
|
|
11415
12114
|
init_import_metadata();
|
|
11416
12115
|
init_import_orchestrator();
|
|
11417
12116
|
init_scoped_agents_import();
|
|
11418
|
-
|
|
12117
|
+
init_constants14();
|
|
11419
12118
|
init_importer_workflows();
|
|
11420
12119
|
init_skills_adapter5();
|
|
11421
12120
|
init_importer_hooks_mcp();
|
|
11422
12121
|
}
|
|
11423
12122
|
});
|
|
11424
|
-
function
|
|
12123
|
+
function lintRules13(canonical, projectRoot, _projectFiles) {
|
|
11425
12124
|
const diags = [];
|
|
11426
12125
|
const { rules } = canonical;
|
|
11427
12126
|
if (rules.length > 0) {
|
|
@@ -11448,9 +12147,9 @@ function lintRules12(canonical, projectRoot, _projectFiles) {
|
|
|
11448
12147
|
}
|
|
11449
12148
|
return diags;
|
|
11450
12149
|
}
|
|
11451
|
-
var
|
|
12150
|
+
var init_linter13 = __esm({
|
|
11452
12151
|
"src/targets/windsurf/linter.ts"() {
|
|
11453
|
-
|
|
12152
|
+
init_constants14();
|
|
11454
12153
|
}
|
|
11455
12154
|
});
|
|
11456
12155
|
|
|
@@ -11474,7 +12173,7 @@ function lintMcp4(canonical) {
|
|
|
11474
12173
|
)
|
|
11475
12174
|
];
|
|
11476
12175
|
}
|
|
11477
|
-
var
|
|
12176
|
+
var init_lint10 = __esm({
|
|
11478
12177
|
"src/targets/windsurf/lint.ts"() {
|
|
11479
12178
|
init_helpers();
|
|
11480
12179
|
}
|
|
@@ -11487,32 +12186,32 @@ function directoryScopedRuleDir2(globs) {
|
|
|
11487
12186
|
if (dirs.length !== globs.length) return null;
|
|
11488
12187
|
return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
|
|
11489
12188
|
}
|
|
11490
|
-
var
|
|
12189
|
+
var target13, project13, global10, globalCapabilities12, descriptor13;
|
|
11491
12190
|
var init_windsurf2 = __esm({
|
|
11492
12191
|
"src/targets/windsurf/index.ts"() {
|
|
11493
|
-
|
|
12192
|
+
init_generator17();
|
|
11494
12193
|
init_capabilities();
|
|
11495
|
-
|
|
12194
|
+
init_constants14();
|
|
11496
12195
|
init_skill_mirror();
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
|
|
12196
|
+
init_importer13();
|
|
12197
|
+
init_linter13();
|
|
12198
|
+
init_lint10();
|
|
11500
12199
|
init_import_map_builders();
|
|
11501
12200
|
init_conversions();
|
|
11502
12201
|
init_projected_agent_skill();
|
|
11503
|
-
|
|
12202
|
+
target13 = {
|
|
11504
12203
|
name: "windsurf",
|
|
11505
12204
|
primaryRootInstructionPath: WINDSURF_AGENTS_MD,
|
|
11506
|
-
generateRules:
|
|
11507
|
-
generateCommands:
|
|
11508
|
-
generateAgents:
|
|
11509
|
-
generateSkills:
|
|
11510
|
-
generateMcp:
|
|
12205
|
+
generateRules: generateRules13,
|
|
12206
|
+
generateCommands: generateCommands12,
|
|
12207
|
+
generateAgents: generateAgents11,
|
|
12208
|
+
generateSkills: generateSkills13,
|
|
12209
|
+
generateMcp: generateMcp11,
|
|
11511
12210
|
generateHooks: generateHooks6,
|
|
11512
|
-
generateIgnore:
|
|
12211
|
+
generateIgnore: generateIgnore9,
|
|
11513
12212
|
importFrom: importFromWindsurf
|
|
11514
12213
|
};
|
|
11515
|
-
|
|
12214
|
+
project13 = {
|
|
11516
12215
|
rootInstructionPath: WINDSURF_AGENTS_MD,
|
|
11517
12216
|
extraRuleOutputPaths(rule) {
|
|
11518
12217
|
if (rule.root) return [WINDSURF_AGENTS_MD];
|
|
@@ -11607,9 +12306,9 @@ var init_windsurf2 = __esm({
|
|
|
11607
12306
|
ignore: "native",
|
|
11608
12307
|
permissions: "none"
|
|
11609
12308
|
};
|
|
11610
|
-
|
|
12309
|
+
descriptor13 = {
|
|
11611
12310
|
id: "windsurf",
|
|
11612
|
-
generators:
|
|
12311
|
+
generators: target13,
|
|
11613
12312
|
capabilities: {
|
|
11614
12313
|
rules: "native",
|
|
11615
12314
|
additionalRules: "native",
|
|
@@ -11623,12 +12322,12 @@ var init_windsurf2 = __esm({
|
|
|
11623
12322
|
},
|
|
11624
12323
|
emptyImportMessage: "No Windsurf config found (.windsurfrules, .windsurf/rules, .windsurfignore, or .codeiumignore).",
|
|
11625
12324
|
supportsConversion: { agents: true },
|
|
11626
|
-
lintRules:
|
|
12325
|
+
lintRules: lintRules13,
|
|
11627
12326
|
lint: {
|
|
11628
12327
|
commands: lintCommands6,
|
|
11629
12328
|
mcp: lintMcp4
|
|
11630
12329
|
},
|
|
11631
|
-
project:
|
|
12330
|
+
project: project13,
|
|
11632
12331
|
globalSupport: {
|
|
11633
12332
|
capabilities: globalCapabilities12,
|
|
11634
12333
|
detectionPaths: [
|
|
@@ -11671,67 +12370,67 @@ function builtinTargetsMap() {
|
|
|
11671
12370
|
}
|
|
11672
12371
|
return _builtinTargetsMap;
|
|
11673
12372
|
}
|
|
11674
|
-
function getBuiltinTargetDefinition(
|
|
11675
|
-
return builtinTargetsMap().get(
|
|
12373
|
+
function getBuiltinTargetDefinition(target14) {
|
|
12374
|
+
return builtinTargetsMap().get(target14);
|
|
11676
12375
|
}
|
|
11677
|
-
function getTargetCapabilities(
|
|
11678
|
-
const
|
|
11679
|
-
if (!
|
|
11680
|
-
const raw = scope === "global" ?
|
|
12376
|
+
function getTargetCapabilities(target14, scope = "project") {
|
|
12377
|
+
const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
|
|
12378
|
+
if (!descriptor14) return void 0;
|
|
12379
|
+
const raw = scope === "global" ? descriptor14.globalSupport?.capabilities ?? descriptor14.capabilities : descriptor14.capabilities;
|
|
11681
12380
|
return normalizeTargetCapabilities(raw);
|
|
11682
12381
|
}
|
|
11683
|
-
function getTargetDetectionPaths(
|
|
11684
|
-
const
|
|
11685
|
-
if (!
|
|
12382
|
+
function getTargetDetectionPaths(target14, scope = "project") {
|
|
12383
|
+
const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
|
|
12384
|
+
if (!descriptor14) return [];
|
|
11686
12385
|
if (scope === "global") {
|
|
11687
|
-
return
|
|
12386
|
+
return descriptor14.globalSupport?.detectionPaths ?? [];
|
|
11688
12387
|
}
|
|
11689
|
-
return
|
|
12388
|
+
return descriptor14.detectionPaths;
|
|
11690
12389
|
}
|
|
11691
|
-
function getTargetLayout(
|
|
11692
|
-
const
|
|
11693
|
-
if (!
|
|
12390
|
+
function getTargetLayout(target14, scope = "project") {
|
|
12391
|
+
const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
|
|
12392
|
+
if (!descriptor14) return void 0;
|
|
11694
12393
|
if (scope === "global") {
|
|
11695
|
-
return
|
|
12394
|
+
return descriptor14.globalSupport?.layout;
|
|
11696
12395
|
}
|
|
11697
|
-
return
|
|
12396
|
+
return descriptor14.project;
|
|
11698
12397
|
}
|
|
11699
|
-
function getTargetPrimaryRootInstructionPath(
|
|
11700
|
-
return getTargetLayout(
|
|
12398
|
+
function getTargetPrimaryRootInstructionPath(target14, scope = "project") {
|
|
12399
|
+
return getTargetLayout(target14, scope)?.rootInstructionPath;
|
|
11701
12400
|
}
|
|
11702
|
-
function getTargetSkillDir(
|
|
11703
|
-
return getTargetLayout(
|
|
12401
|
+
function getTargetSkillDir(target14, scope = "project") {
|
|
12402
|
+
return getTargetLayout(target14, scope)?.skillDir;
|
|
11704
12403
|
}
|
|
11705
|
-
function getTargetManagedOutputs(
|
|
11706
|
-
return getTargetLayout(
|
|
12404
|
+
function getTargetManagedOutputs(target14, scope = "project") {
|
|
12405
|
+
return getTargetLayout(target14, scope)?.managedOutputs;
|
|
11707
12406
|
}
|
|
11708
|
-
function rewriteGeneratedOutputPath(
|
|
11709
|
-
const layout = getTargetLayout(
|
|
12407
|
+
function rewriteGeneratedOutputPath(target14, path, scope = "project") {
|
|
12408
|
+
const layout = getTargetLayout(target14, scope);
|
|
11710
12409
|
if (!layout) return null;
|
|
11711
12410
|
return layout.rewriteGeneratedPath ? layout.rewriteGeneratedPath(path) : path;
|
|
11712
12411
|
}
|
|
11713
|
-
function isFeatureSuppressedByConversion(
|
|
11714
|
-
if (!
|
|
11715
|
-
if (feature === "commands" &&
|
|
11716
|
-
return !shouldConvertCommandsToSkills(config,
|
|
12412
|
+
function isFeatureSuppressedByConversion(descriptor14, feature, config, scope) {
|
|
12413
|
+
if (!descriptor14 || !config) return false;
|
|
12414
|
+
if (feature === "commands" && descriptor14.supportsConversion?.commands) {
|
|
12415
|
+
return !shouldConvertCommandsToSkills(config, descriptor14.id, true, scope);
|
|
11717
12416
|
}
|
|
11718
|
-
if (feature === "agents" &&
|
|
11719
|
-
return !shouldConvertAgentsToSkills(config,
|
|
12417
|
+
if (feature === "agents" && descriptor14.supportsConversion?.agents) {
|
|
12418
|
+
return !shouldConvertAgentsToSkills(config, descriptor14.id, true, scope);
|
|
11720
12419
|
}
|
|
11721
12420
|
return false;
|
|
11722
12421
|
}
|
|
11723
|
-
function getEffectiveTargetSupportLevel(
|
|
11724
|
-
const baseLevel = getTargetCapabilities(
|
|
12422
|
+
function getEffectiveTargetSupportLevel(target14, feature, config, scope = "project") {
|
|
12423
|
+
const baseLevel = getTargetCapabilities(target14, scope)?.[feature]?.level ?? "none";
|
|
11725
12424
|
if (baseLevel !== "embedded") return baseLevel;
|
|
11726
|
-
const
|
|
11727
|
-
return isFeatureSuppressedByConversion(
|
|
12425
|
+
const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
|
|
12426
|
+
return isFeatureSuppressedByConversion(descriptor14, feature, config, scope) ? "none" : baseLevel;
|
|
11728
12427
|
}
|
|
11729
|
-
function resolveTargetFeatureGenerator(
|
|
11730
|
-
const
|
|
11731
|
-
if (!
|
|
11732
|
-
if (isFeatureSuppressedByConversion(
|
|
12428
|
+
function resolveTargetFeatureGenerator(target14, feature, config, scope = "project") {
|
|
12429
|
+
const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
|
|
12430
|
+
if (!descriptor14?.generators) return void 0;
|
|
12431
|
+
if (isFeatureSuppressedByConversion(descriptor14, feature, config, scope)) return void 0;
|
|
11733
12432
|
const pick = PICK_FEATURE_GENERATOR[feature];
|
|
11734
|
-
return pick === null ? void 0 : pick(
|
|
12433
|
+
return pick === null ? void 0 : pick(descriptor14.generators);
|
|
11735
12434
|
}
|
|
11736
12435
|
var BUILTIN_TARGETS, _builtinTargetsMap, PICK_FEATURE_GENERATOR;
|
|
11737
12436
|
var init_builtin_targets = __esm({
|
|
@@ -11750,6 +12449,7 @@ var init_builtin_targets = __esm({
|
|
|
11750
12449
|
init_cursor2();
|
|
11751
12450
|
init_gemini_cli2();
|
|
11752
12451
|
init_junie2();
|
|
12452
|
+
init_kilo_code2();
|
|
11753
12453
|
init_kiro2();
|
|
11754
12454
|
init_roo_code2();
|
|
11755
12455
|
init_windsurf2();
|
|
@@ -11765,7 +12465,8 @@ var init_builtin_targets = __esm({
|
|
|
11765
12465
|
descriptor9,
|
|
11766
12466
|
descriptor10,
|
|
11767
12467
|
descriptor11,
|
|
11768
|
-
descriptor12
|
|
12468
|
+
descriptor12,
|
|
12469
|
+
descriptor13
|
|
11769
12470
|
];
|
|
11770
12471
|
PICK_FEATURE_GENERATOR = {
|
|
11771
12472
|
rules: (g) => g.generateRules,
|
|
@@ -11784,8 +12485,9 @@ var init_builtin_targets = __esm({
|
|
|
11784
12485
|
// src/public/targets.ts
|
|
11785
12486
|
init_builtin_targets();
|
|
11786
12487
|
init_registry();
|
|
11787
|
-
|
|
11788
|
-
|
|
12488
|
+
init_descriptor_import_runner();
|
|
12489
|
+
function copyCapabilities(capabilities2) {
|
|
12490
|
+
return Object.freeze({ ...capabilities2 });
|
|
11789
12491
|
}
|
|
11790
12492
|
function copyGenerators(generators) {
|
|
11791
12493
|
return Object.freeze({ ...generators });
|
|
@@ -11818,23 +12520,23 @@ function copyGlobalSupport(globalSupport) {
|
|
|
11818
12520
|
layout: copyLayout(globalSupport.layout)
|
|
11819
12521
|
});
|
|
11820
12522
|
}
|
|
11821
|
-
function copyTargetDescriptor(
|
|
12523
|
+
function copyTargetDescriptor(descriptor14) {
|
|
11822
12524
|
return Object.freeze({
|
|
11823
|
-
...
|
|
11824
|
-
generators: copyGenerators(
|
|
11825
|
-
capabilities: copyCapabilities(
|
|
11826
|
-
globalSupport:
|
|
11827
|
-
lint:
|
|
11828
|
-
project: copyLayout(
|
|
11829
|
-
supportsConversion:
|
|
11830
|
-
detectionPaths: Object.freeze([...
|
|
11831
|
-
sharedArtifacts:
|
|
12525
|
+
...descriptor14,
|
|
12526
|
+
generators: copyGenerators(descriptor14.generators),
|
|
12527
|
+
capabilities: copyCapabilities(descriptor14.capabilities),
|
|
12528
|
+
globalSupport: descriptor14.globalSupport === void 0 ? void 0 : copyGlobalSupport(descriptor14.globalSupport),
|
|
12529
|
+
lint: descriptor14.lint === void 0 ? void 0 : Object.freeze({ ...descriptor14.lint }),
|
|
12530
|
+
project: copyLayout(descriptor14.project),
|
|
12531
|
+
supportsConversion: descriptor14.supportsConversion === void 0 ? void 0 : Object.freeze({ ...descriptor14.supportsConversion }),
|
|
12532
|
+
detectionPaths: Object.freeze([...descriptor14.detectionPaths]),
|
|
12533
|
+
sharedArtifacts: descriptor14.sharedArtifacts === void 0 ? void 0 : Object.freeze({ ...descriptor14.sharedArtifacts })
|
|
11832
12534
|
});
|
|
11833
12535
|
}
|
|
11834
12536
|
function getTargetCatalog() {
|
|
11835
12537
|
return Object.freeze(BUILTIN_TARGETS.map(copyTargetDescriptor));
|
|
11836
12538
|
}
|
|
11837
12539
|
|
|
11838
|
-
export { getAllDescriptors, getDescriptor, getTargetCatalog, registerTargetDescriptor };
|
|
12540
|
+
export { getAllDescriptors, getDescriptor, getTargetCatalog, registerTargetDescriptor, runDescriptorImport };
|
|
11839
12541
|
//# sourceMappingURL=targets.js.map
|
|
11840
12542
|
//# sourceMappingURL=targets.js.map
|