agentsmesh 0.9.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/dist/canonical.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { access, readdir, realpath, stat, readFile, rm, mkdir, writeFile, rename, lstat, unlink } from 'fs/promises';
2
- import { join, basename, dirname, resolve, relative, normalize, extname, win32, isAbsolute, posix } from 'path';
2
+ import { join, basename, dirname, resolve, relative, posix, win32, extname } from 'path';
3
3
  import { constants, existsSync, realpathSync, statSync } from 'fs';
4
4
  import { parse, stringify } from 'yaml';
5
5
  import { parse as parse$1 } from 'smol-toml';
@@ -17,9 +17,9 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
17
17
  var __esm = (fn, res) => function __init() {
18
18
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
19
19
  };
20
- var __export = (target13, all) => {
20
+ var __export = (target14, all) => {
21
21
  for (var name in all)
22
- __defProp(target13, name, { get: all[name], enumerable: true });
22
+ __defProp(target14, name, { get: all[name], enumerable: true });
23
23
  };
24
24
 
25
25
  // src/core/errors.ts
@@ -294,31 +294,68 @@ var init_hook_command = __esm({
294
294
  "src/core/hook-command.ts"() {
295
295
  }
296
296
  });
297
+ function pathApi(projectRoot) {
298
+ return projectRoot.includes("\\") || WINDOWS_ABSOLUTE_PATH.test(projectRoot) ? win32 : posix;
299
+ }
300
+ function normalizeSeparators(token) {
301
+ return token.replace(/\\/g, "/");
302
+ }
303
+ function normalizeForProject(projectRoot, filePath) {
304
+ const api = pathApi(projectRoot);
305
+ const normalized = api.normalize(
306
+ api === win32 ? filePath.replace(/\//g, "\\") : normalizeSeparators(filePath)
307
+ );
308
+ return normalized.endsWith(api.sep) && normalized.length > 1 ? normalized.slice(0, -1) : normalized;
309
+ }
310
+ function isAbsoluteForProject(projectRoot, filePath) {
311
+ return pathApi(projectRoot).isAbsolute(filePath) || WINDOWS_ABSOLUTE_PATH.test(filePath);
312
+ }
313
+ function stripTrailingPunctuation(token) {
314
+ let candidate = token;
315
+ let suffix = "";
316
+ while (TRAILING_PUNCTUATION.test(candidate)) {
317
+ suffix = candidate.at(-1) + suffix;
318
+ candidate = candidate.slice(0, -1);
319
+ }
320
+ return { candidate, suffix };
321
+ }
322
+ function rootFallbackPath(token, projectRoot) {
323
+ const api = pathApi(projectRoot);
324
+ const stripped = token.replace(/^(\.\.\/)+/, "").replace(/^\.\//, "");
325
+ return stripped && stripped !== token ? normalizeForProject(projectRoot, api.join(projectRoot, stripped)) : null;
326
+ }
327
+ var WINDOWS_ABSOLUTE_PATH, TRAILING_PUNCTUATION;
328
+ var init_path_helpers = __esm({
329
+ "src/core/path-helpers.ts"() {
330
+ WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]/;
331
+ TRAILING_PUNCTUATION = /[.!?:;]+$/;
332
+ }
333
+ });
297
334
 
298
335
  // src/config/core/conversions.ts
299
- function usesCommandSkillProjection(target13) {
300
- return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS, target13);
336
+ function usesCommandSkillProjection(target14) {
337
+ return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS, target14);
301
338
  }
302
- function usesAgentSkillProjection(target13) {
303
- return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS, target13);
339
+ function usesAgentSkillProjection(target14) {
340
+ return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS, target14);
304
341
  }
305
342
  function resolveConversionValue(value, scope) {
306
343
  if (value === void 0) return void 0;
307
344
  if (typeof value === "boolean") return value;
308
345
  return value[scope];
309
346
  }
310
- function shouldConvertCommandsToSkills(config, target13, defaultEnabled, scope = "project") {
311
- const raw = config.conversions?.commands_to_skills?.[target13];
347
+ function shouldConvertCommandsToSkills(config, target14, defaultEnabled, scope = "project") {
348
+ const raw = config.conversions?.commands_to_skills?.[target14];
312
349
  const configVal = resolveConversionValue(raw, scope);
313
350
  if (configVal !== void 0) return configVal;
314
- if (usesCommandSkillProjection(target13)) return DEFAULT_COMMANDS_TO_SKILLS[target13];
351
+ if (usesCommandSkillProjection(target14)) return DEFAULT_COMMANDS_TO_SKILLS[target14];
315
352
  return defaultEnabled ?? false;
316
353
  }
317
- function shouldConvertAgentsToSkills(config, target13, defaultEnabled, scope = "project") {
318
- const raw = config.conversions?.agents_to_skills?.[target13];
354
+ function shouldConvertAgentsToSkills(config, target14, defaultEnabled, scope = "project") {
355
+ const raw = config.conversions?.agents_to_skills?.[target14];
319
356
  const configVal = resolveConversionValue(raw, scope);
320
357
  if (configVal !== void 0) return configVal;
321
- if (usesAgentSkillProjection(target13)) return DEFAULT_AGENTS_TO_SKILLS[target13];
358
+ if (usesAgentSkillProjection(target14)) return DEFAULT_AGENTS_TO_SKILLS[target14];
322
359
  return defaultEnabled ?? false;
323
360
  }
324
361
  var DEFAULT_COMMANDS_TO_SKILLS, DEFAULT_AGENTS_TO_SKILLS;
@@ -369,11 +406,11 @@ var init_capabilities = __esm({
369
406
  // src/targets/catalog/shared-artifact-owner.ts
370
407
  function findSharedArtifactOwnershipConflicts(descriptors) {
371
408
  const owners = [];
372
- for (const descriptor13 of descriptors) {
373
- if (!descriptor13.sharedArtifacts) continue;
374
- for (const [prefix, role] of Object.entries(descriptor13.sharedArtifacts)) {
409
+ for (const descriptor14 of descriptors) {
410
+ if (!descriptor14.sharedArtifacts) continue;
411
+ for (const [prefix, role] of Object.entries(descriptor14.sharedArtifacts)) {
375
412
  if (role !== "owner") continue;
376
- owners.push({ targetId: descriptor13.id, prefix });
413
+ owners.push({ targetId: descriptor14.id, prefix });
377
414
  }
378
415
  }
379
416
  const conflicts = [];
@@ -424,6 +461,7 @@ var init_builtin_target_ids_generated = __esm({
424
461
  "cursor",
425
462
  "gemini-cli",
426
463
  "junie",
464
+ "kilo-code",
427
465
  "kiro",
428
466
  "roo-code",
429
467
  "windsurf"
@@ -905,6 +943,37 @@ var init_generator = __esm({
905
943
  init_constants();
906
944
  }
907
945
  });
946
+ async function writeMcpWithMerge(projectRoot, canonicalPath, imported) {
947
+ const destPath = join(projectRoot, canonicalPath);
948
+ const existing = await readExistingServers(destPath);
949
+ const merged = { ...existing, ...imported };
950
+ await mkdirp(dirname(destPath));
951
+ await writeFileAtomic(destPath, JSON.stringify({ mcpServers: merged }, null, 2));
952
+ }
953
+ async function readExistingServers(path) {
954
+ const content = await readFileSafe(path);
955
+ if (content === null) return {};
956
+ let parsed;
957
+ try {
958
+ parsed = JSON.parse(content);
959
+ } catch {
960
+ return {};
961
+ }
962
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
963
+ const raw = parsed.mcpServers;
964
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
965
+ const out = {};
966
+ for (const [name, value] of Object.entries(raw)) {
967
+ if (!value || typeof value !== "object" || Array.isArray(value)) continue;
968
+ out[name] = value;
969
+ }
970
+ return out;
971
+ }
972
+ var init_mcp_merge = __esm({
973
+ "src/targets/import/mcp-merge.ts"() {
974
+ init_fs();
975
+ }
976
+ });
908
977
 
909
978
  // src/targets/import/shared-import-helpers.ts
910
979
  function toGlobsArray(v) {
@@ -1217,11 +1286,9 @@ async function runMcpJson(spec, sources, projectRoot, fromTool) {
1217
1286
  const srcPath = join(projectRoot, rel2);
1218
1287
  const content = await readFileSafe(srcPath);
1219
1288
  if (content === null) continue;
1220
- const servers = parseMcpJson(content);
1221
- if (Object.keys(servers).length === 0) return [];
1222
- const destPath = join(projectRoot, canonicalPath);
1223
- await mkdirp(dirname(destPath));
1224
- await writeFileAtomic(destPath, JSON.stringify({ mcpServers: servers }, null, 2));
1289
+ const imported = parseMcpJson(content);
1290
+ if (Object.keys(imported).length === 0) return [];
1291
+ await writeMcpWithMerge(projectRoot, canonicalPath, imported);
1225
1292
  return [{ fromTool, fromPath: srcPath, toPath: canonicalPath, feature: spec.feature }];
1226
1293
  }
1227
1294
  return [];
@@ -1257,14 +1324,14 @@ function specsForFeature(importer, feature) {
1257
1324
  if (Array.isArray(value)) return value;
1258
1325
  return [value];
1259
1326
  }
1260
- async function runDescriptorImport(descriptor13, projectRoot, scope, options) {
1261
- const importer = descriptor13.importer;
1327
+ async function runDescriptorImport(descriptor14, projectRoot, scope, options) {
1328
+ const importer = descriptor14.importer;
1262
1329
  if (!importer) return [];
1263
- const normalize = options?.normalize ?? await createImportReferenceNormalizer(descriptor13.id, projectRoot, scope);
1330
+ const normalize = options?.normalize ?? await createImportReferenceNormalizer(descriptor14.id, projectRoot, scope);
1264
1331
  const results = [];
1265
1332
  for (const feature of IMPORT_FEATURE_ORDER) {
1266
1333
  for (const spec of specsForFeature(importer, feature)) {
1267
- results.push(...await runSpec(spec, scope, projectRoot, descriptor13.id, normalize));
1334
+ results.push(...await runSpec(spec, scope, projectRoot, descriptor14.id, normalize));
1268
1335
  }
1269
1336
  }
1270
1337
  return results;
@@ -1273,6 +1340,7 @@ var init_descriptor_import_runner = __esm({
1273
1340
  "src/targets/import/descriptor-import-runner.ts"() {
1274
1341
  init_import_rewriter();
1275
1342
  init_fs();
1343
+ init_mcp_merge();
1276
1344
  init_markdown();
1277
1345
  init_shared_import_helpers();
1278
1346
  init_import_metadata();
@@ -1728,22 +1796,22 @@ var init_projected_agent_skill = __esm({
1728
1796
  }
1729
1797
  });
1730
1798
  function rel(projectRoot, absPath) {
1731
- return relative(projectRoot, absPath).replace(/\\/g, "/");
1799
+ return pathApi(projectRoot).relative(projectRoot, absPath).replace(/\\/g, "/");
1732
1800
  }
1733
1801
  async function listFiles(projectRoot, dir) {
1734
- return readDirRecursive(join(projectRoot, dir)).catch(() => []);
1802
+ return readDirRecursive(pathApi(projectRoot).join(projectRoot, dir)).catch(() => []);
1735
1803
  }
1736
1804
  function addDirectoryMapping(refs, from, to) {
1737
1805
  refs.set(from, to);
1738
1806
  refs.set(`${from}/`, `${to}/`);
1739
1807
  }
1740
1808
  function addAncestorMappings(refs, fromPath, toPath, stopDir) {
1741
- let fromDir = dirname(fromPath);
1742
- let toDir = dirname(toPath);
1809
+ let fromDir = posix.dirname(fromPath);
1810
+ let toDir = posix.dirname(toPath);
1743
1811
  while (fromDir !== stopDir && fromDir !== ".") {
1744
1812
  addDirectoryMapping(refs, fromDir, toDir);
1745
- fromDir = dirname(fromDir);
1746
- toDir = dirname(toDir);
1813
+ fromDir = posix.dirname(fromDir);
1814
+ toDir = posix.dirname(toDir);
1747
1815
  }
1748
1816
  }
1749
1817
  function addSimpleFileMapping(refs, fromPath, canonicalDir, extension) {
@@ -1787,18 +1855,18 @@ async function targetRootSegments() {
1787
1855
  if (targetRootSegmentsCache !== void 0) return targetRootSegmentsCache;
1788
1856
  const { BUILTIN_TARGETS: BUILTIN_TARGETS2 } = await Promise.resolve().then(() => (init_builtin_targets(), builtin_targets_exports));
1789
1857
  const roots = /* @__PURE__ */ new Set();
1790
- for (const descriptor13 of BUILTIN_TARGETS2) {
1858
+ for (const descriptor14 of BUILTIN_TARGETS2) {
1791
1859
  for (const path of [
1792
- descriptor13.project.rootInstructionPath,
1793
- descriptor13.project.skillDir,
1794
- ...descriptor13.project.managedOutputs?.dirs ?? [],
1795
- ...descriptor13.project.managedOutputs?.files ?? [],
1796
- ...descriptor13.detectionPaths,
1797
- descriptor13.globalSupport?.layout.rootInstructionPath,
1798
- descriptor13.globalSupport?.layout.skillDir,
1799
- ...descriptor13.globalSupport?.layout.managedOutputs?.dirs ?? [],
1800
- ...descriptor13.globalSupport?.layout.managedOutputs?.files ?? [],
1801
- ...descriptor13.globalSupport?.detectionPaths ?? []
1860
+ descriptor14.project.rootInstructionPath,
1861
+ descriptor14.project.skillDir,
1862
+ ...descriptor14.project.managedOutputs?.dirs ?? [],
1863
+ ...descriptor14.project.managedOutputs?.files ?? [],
1864
+ ...descriptor14.detectionPaths,
1865
+ descriptor14.globalSupport?.layout.rootInstructionPath,
1866
+ descriptor14.globalSupport?.layout.skillDir,
1867
+ ...descriptor14.globalSupport?.layout.managedOutputs?.dirs ?? [],
1868
+ ...descriptor14.globalSupport?.layout.managedOutputs?.files ?? [],
1869
+ ...descriptor14.globalSupport?.detectionPaths ?? []
1802
1870
  ]) {
1803
1871
  if (path !== void 0) {
1804
1872
  const segment = firstPathSegment(path);
@@ -1815,8 +1883,9 @@ function hasHiddenSegment(relPath) {
1815
1883
  async function listScopedAgentsFiles(projectRoot) {
1816
1884
  const files = [];
1817
1885
  const targetRootSegmentsSet = await targetRootSegments();
1886
+ const api = pathApi(projectRoot);
1818
1887
  async function walk(relDir) {
1819
- const absDir = join(projectRoot, relDir);
1888
+ const absDir = api.join(projectRoot, relDir);
1820
1889
  const entries = await readdir(absDir, { withFileTypes: true }).catch(() => []);
1821
1890
  for (const entry of entries) {
1822
1891
  const relPath = relDir ? `${relDir}/${entry.name}` : entry.name;
@@ -1825,7 +1894,7 @@ async function listScopedAgentsFiles(projectRoot) {
1825
1894
  await walk(relPath);
1826
1895
  continue;
1827
1896
  }
1828
- if (entry.isSymbolicLink() && await stat(join(projectRoot, relPath)).then(
1897
+ if (entry.isSymbolicLink() && await stat(api.join(projectRoot, relPath)).then(
1829
1898
  (info) => info.isDirectory(),
1830
1899
  () => false
1831
1900
  )) {
@@ -1834,7 +1903,7 @@ async function listScopedAgentsFiles(projectRoot) {
1834
1903
  continue;
1835
1904
  }
1836
1905
  if (entry.name === "AGENTS.md" || entry.name === "AGENTS.override.md") {
1837
- files.push(join(projectRoot, relPath));
1906
+ files.push(api.join(projectRoot, relPath));
1838
1907
  }
1839
1908
  }
1840
1909
  }
@@ -1848,7 +1917,7 @@ async function addScopedAgentsMappings(refs, projectRoot) {
1848
1917
  const isNestedAgents = relPath.endsWith("/AGENTS.md") && relPath !== "AGENTS.md" && !relPath.endsWith("/AGENTS.override.md");
1849
1918
  const isNestedOverride = relPath.endsWith("/AGENTS.override.md") && relPath !== "AGENTS.override.md";
1850
1919
  if (!isNestedAgents && !isNestedOverride) continue;
1851
- const parentDir = dirname(relPath);
1920
+ const parentDir = posix.dirname(relPath);
1852
1921
  if (hasHiddenSegment(parentDir)) continue;
1853
1922
  const ruleName = parentDir.replace(/\//g, "-");
1854
1923
  refs.set(relPath, `${AB_RULES}/${ruleName}.md`);
@@ -1857,6 +1926,7 @@ async function addScopedAgentsMappings(refs, projectRoot) {
1857
1926
  var AB_RULES, AB_COMMANDS, AB_AGENTS, AB_SKILLS2, targetRootSegmentsCache;
1858
1927
  var init_import_map_shared = __esm({
1859
1928
  "src/core/reference/import-map-shared.ts"() {
1929
+ init_path_helpers();
1860
1930
  init_fs();
1861
1931
  init_command_skill();
1862
1932
  init_projected_agent_skill();
@@ -2311,9 +2381,100 @@ var init_junie = __esm({
2311
2381
  }
2312
2382
  });
2313
2383
 
2384
+ // src/targets/kilo-code/constants.ts
2385
+ 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;
2386
+ var init_constants8 = __esm({
2387
+ "src/targets/kilo-code/constants.ts"() {
2388
+ KILO_CODE_TARGET = "kilo-code";
2389
+ KILO_CODE_DIR = ".kilo";
2390
+ KILO_CODE_ROOT_RULE = "AGENTS.md";
2391
+ KILO_CODE_RULES_DIR = `${KILO_CODE_DIR}/rules`;
2392
+ KILO_CODE_COMMANDS_DIR = `${KILO_CODE_DIR}/commands`;
2393
+ KILO_CODE_AGENTS_DIR = `${KILO_CODE_DIR}/agents`;
2394
+ KILO_CODE_SKILLS_DIR = `${KILO_CODE_DIR}/skills`;
2395
+ KILO_CODE_MCP_FILE = `${KILO_CODE_DIR}/mcp.json`;
2396
+ KILO_CODE_IGNORE = ".kilocodeignore";
2397
+ KILO_CODE_LEGACY_DIR = ".kilocode";
2398
+ KILO_CODE_LEGACY_RULES_DIR = `${KILO_CODE_LEGACY_DIR}/rules`;
2399
+ KILO_CODE_LEGACY_WORKFLOWS_DIR = `${KILO_CODE_LEGACY_DIR}/workflows`;
2400
+ KILO_CODE_LEGACY_SKILLS_DIR = `${KILO_CODE_LEGACY_DIR}/skills`;
2401
+ KILO_CODE_LEGACY_MCP_FILE = `${KILO_CODE_LEGACY_DIR}/mcp.json`;
2402
+ KILO_CODE_LEGACY_MODES_FILE = ".kilocodemodes";
2403
+ KILO_CODE_GLOBAL_DIR = ".kilo";
2404
+ KILO_CODE_GLOBAL_AGENTS_MD = `${KILO_CODE_GLOBAL_DIR}/AGENTS.md`;
2405
+ KILO_CODE_GLOBAL_RULES_DIR = `${KILO_CODE_GLOBAL_DIR}/rules`;
2406
+ KILO_CODE_GLOBAL_COMMANDS_DIR = `${KILO_CODE_GLOBAL_DIR}/commands`;
2407
+ KILO_CODE_GLOBAL_AGENTS_DIR = `${KILO_CODE_GLOBAL_DIR}/agents`;
2408
+ KILO_CODE_GLOBAL_SKILLS_DIR = `${KILO_CODE_GLOBAL_DIR}/skills`;
2409
+ KILO_CODE_GLOBAL_MCP_FILE = `${KILO_CODE_GLOBAL_DIR}/mcp.json`;
2410
+ KILO_CODE_GLOBAL_IGNORE = ".kilocodeignore";
2411
+ KILO_CODE_GLOBAL_AGENTS_SKILLS_DIR = ".agents/skills";
2412
+ KILO_CODE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
2413
+ KILO_CODE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
2414
+ KILO_CODE_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
2415
+ KILO_CODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
2416
+ KILO_CODE_CANONICAL_IGNORE = ".agentsmesh/ignore";
2417
+ }
2418
+ });
2419
+ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
2420
+ if (scope === "global") {
2421
+ refs.set(KILO_CODE_GLOBAL_AGENTS_MD, `${AB_RULES2}/_root.md`);
2422
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_RULES_DIR)) {
2423
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
2424
+ }
2425
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_COMMANDS_DIR)) {
2426
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
2427
+ }
2428
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_AGENTS_DIR)) {
2429
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
2430
+ }
2431
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_SKILLS_DIR)) {
2432
+ addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_GLOBAL_SKILLS_DIR);
2433
+ }
2434
+ refs.set(KILO_CODE_GLOBAL_MCP_FILE, ".agentsmesh/mcp.json");
2435
+ return;
2436
+ }
2437
+ refs.set(KILO_CODE_ROOT_RULE, `${AB_RULES2}/_root.md`);
2438
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_RULES_DIR)) {
2439
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
2440
+ }
2441
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_COMMANDS_DIR)) {
2442
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
2443
+ }
2444
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_AGENTS_DIR)) {
2445
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
2446
+ }
2447
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_SKILLS_DIR)) {
2448
+ addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_SKILLS_DIR);
2449
+ }
2450
+ refs.set(KILO_CODE_MCP_FILE, ".agentsmesh/mcp.json");
2451
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_RULES_DIR)) {
2452
+ const relPath = rel(projectRoot, absPath);
2453
+ if (basename(relPath) === "00-root.md") {
2454
+ refs.set(relPath, `${AB_RULES2}/_root.md`);
2455
+ continue;
2456
+ }
2457
+ addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
2458
+ }
2459
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_WORKFLOWS_DIR)) {
2460
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
2461
+ }
2462
+ for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_SKILLS_DIR)) {
2463
+ addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_LEGACY_SKILLS_DIR);
2464
+ }
2465
+ refs.set(KILO_CODE_LEGACY_MCP_FILE, ".agentsmesh/mcp.json");
2466
+ }
2467
+ var init_kilo_code = __esm({
2468
+ "src/core/reference/import-maps/kilo-code.ts"() {
2469
+ init_import_map_shared();
2470
+ init_constants8();
2471
+ init_constants2();
2472
+ }
2473
+ });
2474
+
2314
2475
  // src/targets/kiro/constants.ts
2315
2476
  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;
2316
- var init_constants8 = __esm({
2477
+ var init_constants9 = __esm({
2317
2478
  "src/targets/kiro/constants.ts"() {
2318
2479
  KIRO_TARGET = "kiro";
2319
2480
  KIRO_AGENTS_MD = "AGENTS.md";
@@ -2372,14 +2533,14 @@ async function buildKiroImportPaths(refs, projectRoot, scope = "project") {
2372
2533
  var init_kiro = __esm({
2373
2534
  "src/core/reference/import-maps/kiro.ts"() {
2374
2535
  init_import_map_shared();
2375
- init_constants8();
2536
+ init_constants9();
2376
2537
  init_constants2();
2377
2538
  }
2378
2539
  });
2379
2540
 
2380
2541
  // src/targets/roo-code/constants.ts
2381
2542
  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;
2382
- var init_constants9 = __esm({
2543
+ var init_constants10 = __esm({
2383
2544
  "src/targets/roo-code/constants.ts"() {
2384
2545
  ROO_CODE_TARGET = "roo-code";
2385
2546
  ROO_CODE_DIR = ".roo";
@@ -2446,7 +2607,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
2446
2607
  var init_roo_code = __esm({
2447
2608
  "src/core/reference/import-maps/roo-code.ts"() {
2448
2609
  init_import_map_shared();
2449
- init_constants9();
2610
+ init_constants10();
2450
2611
  init_constants2();
2451
2612
  }
2452
2613
  });
@@ -2485,6 +2646,7 @@ var init_import_maps = __esm({
2485
2646
  init_cursor();
2486
2647
  init_gemini_cli();
2487
2648
  init_junie();
2649
+ init_kilo_code();
2488
2650
  init_kiro();
2489
2651
  init_roo_code();
2490
2652
  init_windsurf();
@@ -2973,7 +3135,7 @@ var init_claude_code2 = __esm({
2973
3135
  init_skill_mirror();
2974
3136
  init_global_instructions();
2975
3137
  init_global_extras();
2976
- init_importer12();
3138
+ init_importer13();
2977
3139
  init_import_mappers2();
2978
3140
  init_linter2();
2979
3141
  init_import_map_builders();
@@ -3777,11 +3939,11 @@ var init_linter3 = __esm({
3777
3939
  });
3778
3940
 
3779
3941
  // src/core/lint/shared/helpers.ts
3780
- function createWarning(file, target13, message) {
3942
+ function createWarning(file, target14, message) {
3781
3943
  return {
3782
3944
  level: "warning",
3783
3945
  file,
3784
- target: target13,
3946
+ target: target14,
3785
3947
  message
3786
3948
  };
3787
3949
  }
@@ -3791,12 +3953,12 @@ function formatOxfordComma(items) {
3791
3953
  if (items.length === 2) return `${items[0]} and ${items[1]}`;
3792
3954
  return `${items.slice(0, -1).join(", ")}, and ${items[items.length - 1]}`;
3793
3955
  }
3794
- function createUnsupportedHookWarning(event, target13, supportedEvents, options) {
3795
- const by = options?.unsupportedBy ?? target13;
3956
+ function createUnsupportedHookWarning(event, target14, supportedEvents, options) {
3957
+ const by = options?.unsupportedBy ?? target14;
3796
3958
  const supported = formatOxfordComma(supportedEvents);
3797
3959
  return createWarning(
3798
3960
  ".agentsmesh/hooks.yaml",
3799
- target13,
3961
+ target14,
3800
3962
  `${event} is not supported by ${by}; only ${supported} are projected.`
3801
3963
  );
3802
3964
  }
@@ -3980,7 +4142,7 @@ var init_cline2 = __esm({
3980
4142
 
3981
4143
  // src/targets/codex-cli/constants.ts
3982
4144
  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;
3983
- var init_constants10 = __esm({
4145
+ var init_constants11 = __esm({
3984
4146
  "src/targets/codex-cli/constants.ts"() {
3985
4147
  CODEX_TARGET = "codex-cli";
3986
4148
  CODEX_MD = "codex.md";
@@ -4043,7 +4205,7 @@ function summarizeRule(rule) {
4043
4205
  scopes.push(`Enforced in \`${CODEX_RULES_DIR}/${ruleSlug3(rule.source)}.rules\`.`);
4044
4206
  }
4045
4207
  if (rule.targets.length > 0) {
4046
- scopes.push(`Targeted to ${rule.targets.map((target13) => `\`${target13}\``).join(", ")}.`);
4208
+ scopes.push(`Targeted to ${rule.targets.map((target14) => `\`${target14}\``).join(", ")}.`);
4047
4209
  }
4048
4210
  return scopes.join(" ");
4049
4211
  }
@@ -4073,7 +4235,7 @@ function stripCodexRuleIndex(content) {
4073
4235
  var init_instruction_mirror = __esm({
4074
4236
  "src/targets/codex-cli/instruction-mirror.ts"() {
4075
4237
  init_markdown();
4076
- init_constants10();
4238
+ init_constants11();
4077
4239
  }
4078
4240
  });
4079
4241
  function looksLikeCodexRulesDsl(body) {
@@ -4139,7 +4301,7 @@ function renderCodexGlobalInstructions(canonical) {
4139
4301
  var init_rules = __esm({
4140
4302
  "src/targets/codex-cli/generator/rules.ts"() {
4141
4303
  init_managed_blocks();
4142
- init_constants10();
4304
+ init_constants11();
4143
4305
  init_instruction_mirror();
4144
4306
  }
4145
4307
  });
@@ -4180,7 +4342,7 @@ function generateCommands4(canonical) {
4180
4342
  var init_skills = __esm({
4181
4343
  "src/targets/codex-cli/generator/skills.ts"() {
4182
4344
  init_markdown();
4183
- init_constants10();
4345
+ init_constants11();
4184
4346
  init_command_skill();
4185
4347
  }
4186
4348
  });
@@ -4221,7 +4383,7 @@ ${body}
4221
4383
  }
4222
4384
  var init_agents = __esm({
4223
4385
  "src/targets/codex-cli/generator/agents.ts"() {
4224
- init_constants10();
4386
+ init_constants11();
4225
4387
  }
4226
4388
  });
4227
4389
 
@@ -4273,7 +4435,7 @@ function needsTomlQuoting(key) {
4273
4435
  var init_mcp = __esm({
4274
4436
  "src/targets/codex-cli/generator/mcp.ts"() {
4275
4437
  init_mcp_servers();
4276
- init_constants10();
4438
+ init_constants11();
4277
4439
  }
4278
4440
  });
4279
4441
 
@@ -4332,11 +4494,7 @@ async function importMcp(projectRoot, results) {
4332
4494
  if (server) mcpServers[name] = server;
4333
4495
  }
4334
4496
  if (Object.keys(mcpServers).length === 0) return;
4335
- await mkdirp(join(projectRoot, ".agentsmesh"));
4336
- await writeFileAtomic(
4337
- join(projectRoot, CODEX_CANONICAL_MCP),
4338
- JSON.stringify({ mcpServers }, null, 2)
4339
- );
4497
+ await writeMcpWithMerge(projectRoot, CODEX_CANONICAL_MCP, mcpServers);
4340
4498
  results.push({
4341
4499
  fromTool: CODEX_TARGET,
4342
4500
  fromPath: configPath,
@@ -4347,7 +4505,8 @@ async function importMcp(projectRoot, results) {
4347
4505
  var init_mcp_helpers = __esm({
4348
4506
  "src/targets/codex-cli/mcp-helpers.ts"() {
4349
4507
  init_fs();
4350
- init_constants10();
4508
+ init_mcp_merge();
4509
+ init_constants11();
4351
4510
  }
4352
4511
  });
4353
4512
  function shouldImportScopedAgentsRule(relDir) {
@@ -4441,7 +4600,7 @@ var init_skills_adapter2 = __esm({
4441
4600
  init_projected_agent_skill();
4442
4601
  init_scoped_agents_import();
4443
4602
  init_skill_import_pipeline();
4444
- init_constants10();
4603
+ init_constants11();
4445
4604
  }
4446
4605
  });
4447
4606
  async function importCodexAgentsFromToml(projectRoot, results, normalize) {
@@ -4494,7 +4653,7 @@ var init_importer_agents = __esm({
4494
4653
  "src/targets/codex-cli/importer-agents.ts"() {
4495
4654
  init_fs();
4496
4655
  init_projected_agent_skill();
4497
- init_constants10();
4656
+ init_constants11();
4498
4657
  }
4499
4658
  });
4500
4659
  function tryParseEmbeddedCanonicalFromCodexRules(content) {
@@ -4537,7 +4696,7 @@ function tryParseEmbeddedCanonicalFromCodexRules(content) {
4537
4696
  }
4538
4697
  var init_codex_rules_embed = __esm({
4539
4698
  "src/targets/codex-cli/codex-rules-embed.ts"() {
4540
- init_constants10();
4699
+ init_constants11();
4541
4700
  }
4542
4701
  });
4543
4702
  async function importCodexNonRootRuleFiles(projectRoot, destDir, normalize) {
@@ -4611,7 +4770,7 @@ var init_import_codex_non_root_rules = __esm({
4611
4770
  init_fs();
4612
4771
  init_markdown();
4613
4772
  init_import_metadata();
4614
- init_constants10();
4773
+ init_constants11();
4615
4774
  init_codex_rules_embed();
4616
4775
  }
4617
4776
  });
@@ -4733,7 +4892,7 @@ var init_importer_rules2 = __esm({
4733
4892
  init_embedded_rules();
4734
4893
  init_import_orchestrator();
4735
4894
  init_scoped_agents_import();
4736
- init_constants10();
4895
+ init_constants11();
4737
4896
  init_import_codex_non_root_rules();
4738
4897
  init_instruction_mirror();
4739
4898
  }
@@ -4758,7 +4917,7 @@ async function importFromCodex(projectRoot, options) {
4758
4917
  var init_importer3 = __esm({
4759
4918
  "src/targets/codex-cli/importer.ts"() {
4760
4919
  init_import_rewriter();
4761
- init_constants10();
4920
+ init_constants11();
4762
4921
  init_mcp_helpers();
4763
4922
  init_skills_adapter2();
4764
4923
  init_importer_agents();
@@ -4783,7 +4942,7 @@ function lintRules4(canonical, projectRoot, _projectFiles) {
4783
4942
  }
4784
4943
  var init_linter4 = __esm({
4785
4944
  "src/targets/codex-cli/linter.ts"() {
4786
- init_constants10();
4945
+ init_constants11();
4787
4946
  }
4788
4947
  });
4789
4948
 
@@ -4833,7 +4992,7 @@ var target4, project4, global3, globalCapabilities4, descriptor4;
4833
4992
  var init_codex_cli2 = __esm({
4834
4993
  "src/targets/codex-cli/index.ts"() {
4835
4994
  init_generator5();
4836
- init_constants10();
4995
+ init_constants11();
4837
4996
  init_importer3();
4838
4997
  init_linter4();
4839
4998
  init_lint2();
@@ -5097,10 +5256,7 @@ async function importMcp2(projectRoot, results) {
5097
5256
  importedFrom.push(srcPath);
5098
5257
  }
5099
5258
  if (Object.keys(merged).length === 0) return;
5100
- await writeFileAtomic(
5101
- join(projectRoot, CONTINUE_CANONICAL_MCP),
5102
- JSON.stringify({ mcpServers: merged }, null, 2)
5103
- );
5259
+ await writeMcpWithMerge(projectRoot, CONTINUE_CANONICAL_MCP, merged);
5104
5260
  for (const fromPath of importedFrom) {
5105
5261
  results.push({
5106
5262
  fromTool: CONTINUE_TARGET,
@@ -5124,6 +5280,7 @@ var init_importer4 = __esm({
5124
5280
  init_fs();
5125
5281
  init_embedded_skill();
5126
5282
  init_descriptor_import_runner();
5283
+ init_mcp_merge();
5127
5284
  init_shared_import_helpers();
5128
5285
  init_constants5();
5129
5286
  init_continue2();
@@ -5454,7 +5611,7 @@ var init_continue2 = __esm({
5454
5611
 
5455
5612
  // src/targets/copilot/constants.ts
5456
5613
  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;
5457
- var init_constants11 = __esm({
5614
+ var init_constants12 = __esm({
5458
5615
  "src/targets/copilot/constants.ts"() {
5459
5616
  COPILOT_TARGET = "copilot";
5460
5617
  COPILOT_INSTRUCTIONS = ".github/copilot-instructions.md";
@@ -5519,7 +5676,7 @@ function parseCommandPromptFrontmatter(frontmatter, promptPath) {
5519
5676
  var init_command_prompt = __esm({
5520
5677
  "src/targets/copilot/command-prompt.ts"() {
5521
5678
  init_markdown();
5522
- init_constants11();
5679
+ init_constants12();
5523
5680
  }
5524
5681
  });
5525
5682
 
@@ -5671,7 +5828,7 @@ function generateHooks3(canonical) {
5671
5828
  var init_generator7 = __esm({
5672
5829
  "src/targets/copilot/generator.ts"() {
5673
5830
  init_markdown();
5674
- init_constants11();
5831
+ init_constants12();
5675
5832
  init_command_prompt();
5676
5833
  init_hook_entry();
5677
5834
  }
@@ -5765,7 +5922,7 @@ async function importHooks(projectRoot, results) {
5765
5922
  var init_hook_parser = __esm({
5766
5923
  "src/targets/copilot/hook-parser.ts"() {
5767
5924
  init_fs();
5768
- init_constants11();
5925
+ init_constants12();
5769
5926
  }
5770
5927
  });
5771
5928
  async function importSkills2(projectRoot, results, normalize, skillsDirRel = COPILOT_SKILLS_DIR) {
@@ -5786,7 +5943,7 @@ async function importSkills2(projectRoot, results, normalize, skillsDirRel = COP
5786
5943
  var init_skills_adapter3 = __esm({
5787
5944
  "src/targets/copilot/skills-adapter.ts"() {
5788
5945
  init_skill_import_pipeline();
5789
- init_constants11();
5946
+ init_constants12();
5790
5947
  }
5791
5948
  });
5792
5949
 
@@ -5809,7 +5966,7 @@ var init_importer5 = __esm({
5809
5966
  "src/targets/copilot/importer.ts"() {
5810
5967
  init_import_rewriter();
5811
5968
  init_descriptor_import_runner();
5812
- init_constants11();
5969
+ init_constants12();
5813
5970
  init_hook_parser();
5814
5971
  init_skills_adapter3();
5815
5972
  init_copilot2();
@@ -5828,7 +5985,7 @@ var init_import_mappers4 = __esm({
5828
5985
  init_import_metadata();
5829
5986
  init_shared_import_helpers();
5830
5987
  init_command_prompt();
5831
- init_constants11();
5988
+ init_constants12();
5832
5989
  copilotLegacyRuleMapper = async ({
5833
5990
  relativePath,
5834
5991
  normalizeTo,
@@ -5945,7 +6102,7 @@ function lintRules6(canonical, projectRoot, projectFiles, options) {
5945
6102
  var init_linter6 = __esm({
5946
6103
  "src/targets/copilot/linter.ts"() {
5947
6104
  init_validate_rules();
5948
- init_constants11();
6105
+ init_constants12();
5949
6106
  }
5950
6107
  });
5951
6108
 
@@ -6062,7 +6219,7 @@ var SCRIPT_PREFIX_RE;
6062
6219
  var init_hook_assets = __esm({
6063
6220
  "src/targets/copilot/hook-assets.ts"() {
6064
6221
  init_fs();
6065
- init_constants11();
6222
+ init_constants12();
6066
6223
  init_hook_entry();
6067
6224
  SCRIPT_PREFIX_RE = /^(?<prefix>\s*(?:(?:bash|sh|zsh)\s+)?)["']?(?<path>(?:\.\.\/|\.\/|[^/\s"'`]+\/)[^\s"'`]+)["']?(?<suffix>(?:\s.*)?)$/;
6068
6225
  }
@@ -6076,7 +6233,7 @@ var generateCopilotGlobalExtras;
6076
6233
  var init_scope_extras2 = __esm({
6077
6234
  "src/targets/copilot/scope-extras.ts"() {
6078
6235
  init_fs();
6079
- init_constants11();
6236
+ init_constants12();
6080
6237
  generateCopilotGlobalExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
6081
6238
  if (scope !== "global" || !enabledFeatures.has("rules")) return [];
6082
6239
  const root = canonical.rules.find((r) => r.root);
@@ -6099,7 +6256,7 @@ var target6, project6, global4, globalCapabilities6, descriptor6;
6099
6256
  var init_copilot2 = __esm({
6100
6257
  "src/targets/copilot/index.ts"() {
6101
6258
  init_generator7();
6102
- init_constants11();
6259
+ init_constants12();
6103
6260
  init_importer5();
6104
6261
  init_import_mappers4();
6105
6262
  init_linter6();
@@ -6868,8 +7025,8 @@ async function hasGlobalCursorArtifacts(projectRoot) {
6868
7025
  join(projectRoot, CURSOR_COMMANDS_DIR)
6869
7026
  ];
6870
7027
  for (const p of candidates) {
6871
- const stat6 = await readFileSafe(p);
6872
- if (stat6 !== null && stat6.trim() !== "") return true;
7028
+ const stat7 = await readFileSafe(p);
7029
+ if (stat7 !== null && stat7.trim() !== "") return true;
6873
7030
  }
6874
7031
  const skillFiles = await readDirRecursive(join(projectRoot, CURSOR_GLOBAL_SKILLS_DIR));
6875
7032
  if (skillFiles.some((f) => f.endsWith(".md"))) return true;
@@ -7027,9 +7184,8 @@ async function importMcp3(projectRoot, results) {
7027
7184
  return;
7028
7185
  }
7029
7186
  if (!parsed || typeof parsed !== "object" || !("mcpServers" in parsed)) return;
7030
- const destPath = join(projectRoot, CURSOR_CANONICAL_MCP);
7031
- await mkdirp(dirname(destPath));
7032
- await writeFileAtomic(destPath, content);
7187
+ const servers = parsed.mcpServers;
7188
+ await writeMcpWithMerge(projectRoot, CURSOR_CANONICAL_MCP, servers);
7033
7189
  results.push({
7034
7190
  fromTool: "cursor",
7035
7191
  fromPath: mcpPath,
@@ -7056,6 +7212,7 @@ var init_importer6 = __esm({
7056
7212
  init_import_rewriter();
7057
7213
  init_fs();
7058
7214
  init_descriptor_import_runner();
7215
+ init_mcp_merge();
7059
7216
  init_importer_rules3();
7060
7217
  init_settings_helpers();
7061
7218
  init_skills_adapter4();
@@ -7357,7 +7514,7 @@ var init_cursor2 = __esm({
7357
7514
 
7358
7515
  // src/targets/gemini-cli/constants.ts
7359
7516
  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;
7360
- var init_constants12 = __esm({
7517
+ var init_constants13 = __esm({
7361
7518
  "src/targets/gemini-cli/constants.ts"() {
7362
7519
  GEMINI_TARGET = "gemini-cli";
7363
7520
  GEMINI_ROOT = "GEMINI.md";
@@ -7409,7 +7566,7 @@ function generateRules8(canonical) {
7409
7566
  var init_rules3 = __esm({
7410
7567
  "src/targets/gemini-cli/generator/rules.ts"() {
7411
7568
  init_managed_blocks();
7412
- init_constants12();
7569
+ init_constants13();
7413
7570
  }
7414
7571
  });
7415
7572
  function canonicalCommandNameToGeminiTomlPath(cmdName, commandsDir) {
@@ -7449,7 +7606,7 @@ function generateCommands8(canonical) {
7449
7606
  }
7450
7607
  var init_commands2 = __esm({
7451
7608
  "src/targets/gemini-cli/generator/commands.ts"() {
7452
- init_constants12();
7609
+ init_constants13();
7453
7610
  init_command_namespace();
7454
7611
  }
7455
7612
  });
@@ -7477,7 +7634,7 @@ function generateAgents6(canonical) {
7477
7634
  var init_agents3 = __esm({
7478
7635
  "src/targets/gemini-cli/generator/agents.ts"() {
7479
7636
  init_markdown();
7480
- init_constants12();
7637
+ init_constants13();
7481
7638
  }
7482
7639
  });
7483
7640
 
@@ -7508,7 +7665,7 @@ function generateSkills8(canonical) {
7508
7665
  var init_skills3 = __esm({
7509
7666
  "src/targets/gemini-cli/generator/skills.ts"() {
7510
7667
  init_markdown();
7511
- init_constants12();
7668
+ init_constants13();
7512
7669
  }
7513
7670
  });
7514
7671
 
@@ -7569,7 +7726,7 @@ function generateGeminiSettingsFiles(canonical) {
7569
7726
  var init_settings = __esm({
7570
7727
  "src/targets/gemini-cli/generator/settings.ts"() {
7571
7728
  init_hook_command();
7572
- init_constants12();
7729
+ init_constants13();
7573
7730
  }
7574
7731
  });
7575
7732
 
@@ -7580,7 +7737,7 @@ function generateIgnore4(canonical) {
7580
7737
  }
7581
7738
  var init_ignore2 = __esm({
7582
7739
  "src/targets/gemini-cli/generator/ignore.ts"() {
7583
- init_constants12();
7740
+ init_constants13();
7584
7741
  }
7585
7742
  });
7586
7743
 
@@ -7681,7 +7838,7 @@ function generateGeminiPermissionsPolicies(canonical) {
7681
7838
  }
7682
7839
  var init_policies_generator = __esm({
7683
7840
  "src/targets/gemini-cli/policies-generator.ts"() {
7684
- init_constants12();
7841
+ init_constants13();
7685
7842
  }
7686
7843
  });
7687
7844
  function mapGeminiHookEvent(event) {
@@ -7809,7 +7966,7 @@ var init_format_helpers_settings = __esm({
7809
7966
  "src/targets/gemini-cli/format-helpers-settings.ts"() {
7810
7967
  init_hook_command();
7811
7968
  init_fs();
7812
- init_constants12();
7969
+ init_constants13();
7813
7970
  init_format_helpers_shared();
7814
7971
  }
7815
7972
  });
@@ -7834,7 +7991,7 @@ async function importGeminiIgnore(projectRoot, results) {
7834
7991
  var init_format_helpers = __esm({
7835
7992
  "src/targets/gemini-cli/format-helpers.ts"() {
7836
7993
  init_fs();
7837
- init_constants12();
7994
+ init_constants13();
7838
7995
  init_format_helpers_shared();
7839
7996
  init_format_helpers_settings();
7840
7997
  }
@@ -7942,7 +8099,7 @@ async function importGeminiPolicies(projectRoot) {
7942
8099
  var init_policies_importer = __esm({
7943
8100
  "src/targets/gemini-cli/policies-importer.ts"() {
7944
8101
  init_fs();
7945
- init_constants12();
8102
+ init_constants13();
7946
8103
  }
7947
8104
  });
7948
8105
  function stripProjectRootCanonicalPrefix(content, projectRoot) {
@@ -8068,7 +8225,7 @@ var init_importer_skills_agents = __esm({
8068
8225
  init_markdown();
8069
8226
  init_import_metadata();
8070
8227
  init_projected_agent_skill();
8071
- init_constants12();
8228
+ init_constants13();
8072
8229
  }
8073
8230
  });
8074
8231
  async function importRootRule2(projectRoot, results, normalize) {
@@ -8144,7 +8301,7 @@ var init_importer7 = __esm({
8144
8301
  init_import_metadata();
8145
8302
  init_embedded_rules();
8146
8303
  init_descriptor_import_runner();
8147
- init_constants12();
8304
+ init_constants13();
8148
8305
  init_gemini_cli2();
8149
8306
  init_format_helpers();
8150
8307
  init_policies_importer();
@@ -8212,7 +8369,7 @@ var init_importer_mappers3 = __esm({
8212
8369
  init_import_metadata();
8213
8370
  init_shared_import_helpers();
8214
8371
  init_format_helpers();
8215
- init_constants12();
8372
+ init_constants13();
8216
8373
  }
8217
8374
  });
8218
8375
 
@@ -8236,7 +8393,7 @@ function lintRules8(canonical, projectRoot, projectFiles, options) {
8236
8393
  var init_linter8 = __esm({
8237
8394
  "src/targets/gemini-cli/linter.ts"() {
8238
8395
  init_validate_rules();
8239
- init_constants12();
8396
+ init_constants13();
8240
8397
  }
8241
8398
  });
8242
8399
 
@@ -8317,7 +8474,7 @@ var init_gemini_cli2 = __esm({
8317
8474
  init_generator11();
8318
8475
  init_capabilities();
8319
8476
  init_policies_generator();
8320
- init_constants12();
8477
+ init_constants13();
8321
8478
  init_importer7();
8322
8479
  init_import_mappers6();
8323
8480
  init_linter8();
@@ -8891,54 +9048,598 @@ var init_junie2 = __esm({
8891
9048
  };
8892
9049
  }
8893
9050
  });
8894
- function toKebab(value) {
8895
- return value.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
8896
- }
8897
- function hookText(entry) {
8898
- return entry.type === "prompt" ? entry.prompt : entry.command;
8899
- }
8900
- function toWhen(event, matcher) {
8901
- const type = CANONICAL_TO_KIRO[event];
8902
- if (event === "PreToolUse" || event === "PostToolUse") {
8903
- return { type, tools: [matcher || "*"] };
8904
- }
8905
- return { type };
8906
- }
8907
- function generateKiroHooks(hooks) {
9051
+ function generateRules10(canonical) {
8908
9052
  const outputs = [];
8909
- for (const [event, entries] of Object.entries(hooks)) {
8910
- const mappedEvent = event;
8911
- if (!(mappedEvent in CANONICAL_TO_KIRO) || !Array.isArray(entries)) continue;
8912
- let index = 1;
8913
- for (const entry of entries) {
8914
- const text = hookText(entry);
8915
- if (!text) continue;
8916
- const file = {
8917
- name: `${toKebab(event)} ${index}`,
8918
- version: "1",
8919
- when: toWhen(mappedEvent, entry.matcher),
8920
- then: entry.type === "prompt" ? { type: "askAgent", prompt: text } : { type: "shellCommand", command: text }
8921
- };
8922
- outputs.push({
8923
- name: `${toKebab(event)}-${index}.kiro.hook`,
8924
- content: JSON.stringify(file, null, 2)
8925
- });
8926
- index += 1;
8927
- }
9053
+ const root = canonical.rules.find((rule) => rule.root);
9054
+ if (root) {
9055
+ outputs.push({
9056
+ path: KILO_CODE_ROOT_RULE,
9057
+ content: root.body.trim() ? root.body : ""
9058
+ });
9059
+ }
9060
+ for (const rule of canonical.rules) {
9061
+ if (rule.root) continue;
9062
+ if (rule.targets.length > 0 && !rule.targets.includes(KILO_CODE_TARGET)) continue;
9063
+ const slug = basename(rule.source, ".md");
9064
+ const frontmatter = {};
9065
+ if (rule.description) frontmatter.description = rule.description;
9066
+ if (rule.globs.length > 0) frontmatter.globs = rule.globs;
9067
+ const content = Object.keys(frontmatter).length > 0 ? serializeFrontmatter(frontmatter, rule.body.trim() || "") : rule.body.trim() || "";
9068
+ outputs.push({
9069
+ path: `${KILO_CODE_RULES_DIR}/${slug}.md`,
9070
+ content
9071
+ });
8928
9072
  }
8929
9073
  return outputs;
8930
9074
  }
8931
- function toCanonicalEntry(file) {
8932
- const canonicalEvent = KIRO_TO_CANONICAL.get(file.when.type);
8933
- if (!canonicalEvent) return null;
8934
- const matcher = file.when.tools?.[0] ?? file.when.patterns?.[0] ?? "*";
8935
- if (file.then.type === "askAgent" && typeof file.then.prompt === "string") {
9075
+ function generateCommands10(canonical) {
9076
+ return canonical.commands.map((command) => {
9077
+ const frontmatter = {};
9078
+ if (command.description) frontmatter.description = command.description;
8936
9079
  return {
8937
- event: canonicalEvent,
8938
- entry: {
8939
- matcher,
8940
- command: file.then.prompt,
8941
- prompt: file.then.prompt,
9080
+ path: `${KILO_CODE_COMMANDS_DIR}/${command.name}.md`,
9081
+ content: serializeFrontmatter(frontmatter, command.body.trim() || "")
9082
+ };
9083
+ });
9084
+ }
9085
+ function generateAgents8(canonical) {
9086
+ return canonical.agents.map((agent) => {
9087
+ const slug = basename(agent.source, ".md");
9088
+ const frontmatter = { mode: "subagent" };
9089
+ if (agent.description) frontmatter.description = agent.description;
9090
+ if (agent.model) frontmatter.model = agent.model;
9091
+ if (agent.tools.length > 0) frontmatter.tools = agent.tools;
9092
+ if (agent.disallowedTools.length > 0) frontmatter.disallowedTools = agent.disallowedTools;
9093
+ return {
9094
+ path: `${KILO_CODE_AGENTS_DIR}/${slug}.md`,
9095
+ content: serializeFrontmatter(frontmatter, agent.body.trim() || "")
9096
+ };
9097
+ });
9098
+ }
9099
+ function generateMcp8(canonical) {
9100
+ if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
9101
+ return [
9102
+ {
9103
+ path: KILO_CODE_MCP_FILE,
9104
+ content: JSON.stringify({ mcpServers: canonical.mcp.mcpServers }, null, 2)
9105
+ }
9106
+ ];
9107
+ }
9108
+ function generateIgnore6(canonical) {
9109
+ if (canonical.ignore.length === 0) return [];
9110
+ return [{ path: KILO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
9111
+ }
9112
+ function generateSkills10(canonical) {
9113
+ return generateEmbeddedSkills(canonical, KILO_CODE_SKILLS_DIR);
9114
+ }
9115
+ var init_generator13 = __esm({
9116
+ "src/targets/kilo-code/generator.ts"() {
9117
+ init_embedded_skill();
9118
+ init_markdown();
9119
+ init_constants8();
9120
+ }
9121
+ });
9122
+ var kiloNonRootRuleMapper, kiloCommandMapper, kiloAgentMapper;
9123
+ var init_import_mappers7 = __esm({
9124
+ "src/targets/kilo-code/import-mappers.ts"() {
9125
+ init_markdown();
9126
+ init_import_metadata();
9127
+ init_constants8();
9128
+ kiloNonRootRuleMapper = async ({
9129
+ relativePath,
9130
+ normalizeTo,
9131
+ destDir
9132
+ }) => {
9133
+ const destPath = join(destDir, relativePath);
9134
+ const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
9135
+ return {
9136
+ destPath,
9137
+ toPath: `${KILO_CODE_CANONICAL_RULES_DIR}/${relativePath}`,
9138
+ content: await serializeImportedRuleWithFallback(
9139
+ destPath,
9140
+ {
9141
+ root: false,
9142
+ description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
9143
+ globs: Array.isArray(frontmatter.globs) ? frontmatter.globs : void 0
9144
+ },
9145
+ body
9146
+ )
9147
+ };
9148
+ };
9149
+ kiloCommandMapper = async ({
9150
+ relativePath,
9151
+ normalizeTo,
9152
+ destDir
9153
+ }) => {
9154
+ const destPath = join(destDir, relativePath);
9155
+ const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
9156
+ return {
9157
+ destPath,
9158
+ toPath: `${KILO_CODE_CANONICAL_COMMANDS_DIR}/${relativePath}`,
9159
+ content: await serializeImportedCommandWithFallback(
9160
+ destPath,
9161
+ {
9162
+ hasDescription: Object.prototype.hasOwnProperty.call(frontmatter, "description"),
9163
+ description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
9164
+ hasAllowedTools: false,
9165
+ allowedTools: []
9166
+ },
9167
+ body
9168
+ )
9169
+ };
9170
+ };
9171
+ kiloAgentMapper = async ({
9172
+ relativePath,
9173
+ normalizeTo,
9174
+ destDir
9175
+ }) => {
9176
+ const destPath = join(destDir, relativePath);
9177
+ const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
9178
+ return {
9179
+ destPath,
9180
+ toPath: `${KILO_CODE_CANONICAL_AGENTS_DIR}/${relativePath}`,
9181
+ content: await serializeImportedAgentWithFallback(destPath, frontmatter, body)
9182
+ };
9183
+ };
9184
+ }
9185
+ });
9186
+ async function pathExists(absolutePath) {
9187
+ try {
9188
+ await stat(absolutePath);
9189
+ return true;
9190
+ } catch {
9191
+ return false;
9192
+ }
9193
+ }
9194
+ async function importLegacyRules(projectRoot, results, normalize) {
9195
+ const srcDir = join(projectRoot, KILO_CODE_LEGACY_RULES_DIR);
9196
+ if (!await pathExists(srcDir)) return;
9197
+ const destDir = join(projectRoot, KILO_CODE_CANONICAL_RULES_DIR);
9198
+ const rootSourceFile = join(srcDir, LEGACY_ROOT_RULE_FILE);
9199
+ const hasCurrentRoot = results.some((result) => result.toPath === CANONICAL_ROOT_RULE_PATH);
9200
+ const rootContent = hasCurrentRoot ? null : await readFileSafe(rootSourceFile);
9201
+ if (rootContent !== null) {
9202
+ const destPath = join(projectRoot, CANONICAL_ROOT_RULE_PATH);
9203
+ const normalized = normalize(rootContent, rootSourceFile, destPath);
9204
+ const { body } = parseFrontmatter(normalized);
9205
+ const serialized = await serializeImportedRuleWithFallback(destPath, { root: true }, body);
9206
+ await writeFileAtomic(destPath, serialized);
9207
+ results.push({
9208
+ feature: "rules",
9209
+ fromTool: KILO_CODE_TARGET,
9210
+ fromPath: `${KILO_CODE_LEGACY_RULES_DIR}/${LEGACY_ROOT_RULE_FILE}`,
9211
+ toPath: CANONICAL_ROOT_RULE_PATH
9212
+ });
9213
+ }
9214
+ results.push(
9215
+ ...await importFileDirectory({
9216
+ srcDir,
9217
+ destDir,
9218
+ extensions: [".md"],
9219
+ fromTool: KILO_CODE_TARGET,
9220
+ normalize,
9221
+ mapEntry: async ({ srcPath, relativePath, content, normalizeTo }) => {
9222
+ const mapping = await kiloNonRootRuleMapper({
9223
+ absolutePath: srcPath,
9224
+ relativePath,
9225
+ content,
9226
+ destDir,
9227
+ normalizeTo
9228
+ });
9229
+ if (relativePath === LEGACY_ROOT_RULE_FILE) return null;
9230
+ if (!mapping) return null;
9231
+ return { ...mapping, feature: "rules" };
9232
+ }
9233
+ })
9234
+ );
9235
+ }
9236
+ async function importLegacyWorkflows(projectRoot, results, normalize) {
9237
+ const srcDir = join(projectRoot, KILO_CODE_LEGACY_WORKFLOWS_DIR);
9238
+ if (!await pathExists(srcDir)) return;
9239
+ const destDir = join(projectRoot, KILO_CODE_CANONICAL_COMMANDS_DIR);
9240
+ results.push(
9241
+ ...await importFileDirectory({
9242
+ srcDir,
9243
+ destDir,
9244
+ extensions: [".md"],
9245
+ fromTool: KILO_CODE_TARGET,
9246
+ normalize,
9247
+ mapEntry: async ({ srcPath, relativePath, content, normalizeTo }) => {
9248
+ const mapping = await kiloCommandMapper({
9249
+ absolutePath: srcPath,
9250
+ relativePath,
9251
+ content,
9252
+ destDir,
9253
+ normalizeTo
9254
+ });
9255
+ if (!mapping) return null;
9256
+ return { ...mapping, feature: "commands" };
9257
+ }
9258
+ })
9259
+ );
9260
+ }
9261
+ async function importLegacyModes(projectRoot, results, normalize) {
9262
+ const sourceFile = join(projectRoot, KILO_CODE_LEGACY_MODES_FILE);
9263
+ const content = await readFileSafe(sourceFile);
9264
+ if (content === null) return;
9265
+ let parsed;
9266
+ try {
9267
+ parsed = parse(content);
9268
+ } catch {
9269
+ return;
9270
+ }
9271
+ if (!parsed || !Array.isArray(parsed.customModes)) return;
9272
+ for (const raw of parsed.customModes) {
9273
+ if (!raw || typeof raw !== "object") continue;
9274
+ const mode = raw;
9275
+ if (typeof mode.slug !== "string" || mode.slug.length === 0) continue;
9276
+ const slug = mode.slug;
9277
+ const destPath = join(projectRoot, KILO_CODE_CANONICAL_AGENTS_DIR, `${slug}.md`);
9278
+ const description = typeof mode.description === "string" ? mode.description : "";
9279
+ const role = typeof mode.roleDefinition === "string" ? mode.roleDefinition.trim() : "";
9280
+ const whenToUse = typeof mode.whenToUse === "string" ? mode.whenToUse.trim() : "";
9281
+ const body = whenToUse ? `${role}
9282
+
9283
+ ## When to use
9284
+
9285
+ ${whenToUse}` : role;
9286
+ const frontmatter = {};
9287
+ if (description) frontmatter.description = description;
9288
+ if (typeof mode.name === "string" && mode.name.length > 0) frontmatter.name = mode.name;
9289
+ const serialized = await serializeImportedAgentWithFallback(destPath, frontmatter, body);
9290
+ const normalized = normalize(serialized, sourceFile, destPath);
9291
+ await writeFileAtomic(destPath, normalized);
9292
+ results.push({
9293
+ feature: "agents",
9294
+ fromTool: KILO_CODE_TARGET,
9295
+ fromPath: sourceFile,
9296
+ toPath: `${KILO_CODE_CANONICAL_AGENTS_DIR}/${slug}.md`
9297
+ });
9298
+ }
9299
+ }
9300
+ async function importFromKiloCode(projectRoot, options = {}) {
9301
+ const scope = options.scope ?? "project";
9302
+ const results = [];
9303
+ const normalize = await createImportReferenceNormalizer(KILO_CODE_TARGET, projectRoot, scope);
9304
+ results.push(...await runDescriptorImport(descriptor10, projectRoot, scope, { normalize }));
9305
+ await importEmbeddedSkills(
9306
+ projectRoot,
9307
+ KILO_CODE_SKILLS_DIR,
9308
+ KILO_CODE_TARGET,
9309
+ results,
9310
+ normalize
9311
+ );
9312
+ if (scope === "project") {
9313
+ await importLegacyRules(projectRoot, results, normalize);
9314
+ await importLegacyWorkflows(projectRoot, results, normalize);
9315
+ await importLegacyModes(projectRoot, results, normalize);
9316
+ await importEmbeddedSkills(
9317
+ projectRoot,
9318
+ KILO_CODE_LEGACY_SKILLS_DIR,
9319
+ KILO_CODE_TARGET,
9320
+ results,
9321
+ normalize
9322
+ );
9323
+ }
9324
+ return results;
9325
+ }
9326
+ var CANONICAL_ROOT_RULE_PATH, LEGACY_ROOT_RULE_FILE;
9327
+ var init_importer9 = __esm({
9328
+ "src/targets/kilo-code/importer.ts"() {
9329
+ init_import_rewriter();
9330
+ init_embedded_skill();
9331
+ init_import_orchestrator();
9332
+ init_descriptor_import_runner();
9333
+ init_fs();
9334
+ init_import_metadata();
9335
+ init_markdown();
9336
+ init_import_mappers7();
9337
+ init_constants8();
9338
+ init_kilo_code2();
9339
+ CANONICAL_ROOT_RULE_PATH = `${KILO_CODE_CANONICAL_RULES_DIR}/_root.md`;
9340
+ LEGACY_ROOT_RULE_FILE = "00-root.md";
9341
+ }
9342
+ });
9343
+
9344
+ // src/targets/kilo-code/linter.ts
9345
+ function lintRules10(canonical, projectRoot, projectFiles, options) {
9346
+ return validateRules(canonical, projectRoot, projectFiles, {
9347
+ checkGlobMatches: options?.scope !== "global"
9348
+ }).map((diagnostic) => ({
9349
+ ...diagnostic,
9350
+ target: KILO_CODE_TARGET
9351
+ }));
9352
+ }
9353
+ var init_linter10 = __esm({
9354
+ "src/targets/kilo-code/linter.ts"() {
9355
+ init_validate_rules();
9356
+ init_constants8();
9357
+ }
9358
+ });
9359
+
9360
+ // src/targets/kilo-code/lint.ts
9361
+ function lintHooks4(canonical) {
9362
+ if (!canonical.hooks) return [];
9363
+ const hasEntries = Object.values(canonical.hooks).some(
9364
+ (entries) => Array.isArray(entries) && entries.length > 0
9365
+ );
9366
+ if (!hasEntries) return [];
9367
+ return [
9368
+ createWarning(
9369
+ ".agentsmesh/hooks.yaml",
9370
+ "kilo-code",
9371
+ "kilo-code does not support user-defined lifecycle hooks; canonical hooks are not projected."
9372
+ )
9373
+ ];
9374
+ }
9375
+ function lintPermissions2(canonical) {
9376
+ if (!canonical.permissions) return [];
9377
+ const { allow, deny } = canonical.permissions;
9378
+ const ask = canonical.permissions.ask ?? [];
9379
+ if (allow.length === 0 && deny.length === 0 && ask.length === 0) return [];
9380
+ return [
9381
+ createWarning(
9382
+ ".agentsmesh/permissions.yaml",
9383
+ "kilo-code",
9384
+ "kilo-code permissions live in kilo.jsonc, which agentsmesh does not generate in v1; canonical permissions are not projected."
9385
+ )
9386
+ ];
9387
+ }
9388
+ var init_lint8 = __esm({
9389
+ "src/targets/kilo-code/lint.ts"() {
9390
+ init_helpers();
9391
+ }
9392
+ });
9393
+
9394
+ // src/targets/kilo-code/index.ts
9395
+ var target10, project10, globalLayout3, capabilities, descriptor10;
9396
+ var init_kilo_code2 = __esm({
9397
+ "src/targets/kilo-code/index.ts"() {
9398
+ init_generator13();
9399
+ init_constants8();
9400
+ init_skill_mirror();
9401
+ init_importer9();
9402
+ init_import_mappers7();
9403
+ init_linter10();
9404
+ init_lint8();
9405
+ init_import_map_builders();
9406
+ target10 = {
9407
+ name: KILO_CODE_TARGET,
9408
+ primaryRootInstructionPath: KILO_CODE_ROOT_RULE,
9409
+ generateRules: generateRules10,
9410
+ generateCommands: generateCommands10,
9411
+ generateAgents: generateAgents8,
9412
+ generateSkills: generateSkills10,
9413
+ generateMcp: generateMcp8,
9414
+ generateIgnore: generateIgnore6,
9415
+ importFrom: importFromKiloCode
9416
+ };
9417
+ project10 = {
9418
+ rootInstructionPath: KILO_CODE_ROOT_RULE,
9419
+ skillDir: KILO_CODE_SKILLS_DIR,
9420
+ managedOutputs: {
9421
+ dirs: [KILO_CODE_RULES_DIR, KILO_CODE_COMMANDS_DIR, KILO_CODE_AGENTS_DIR, KILO_CODE_SKILLS_DIR],
9422
+ files: [KILO_CODE_ROOT_RULE, KILO_CODE_MCP_FILE, KILO_CODE_IGNORE]
9423
+ },
9424
+ paths: {
9425
+ rulePath(slug, _rule) {
9426
+ return `${KILO_CODE_RULES_DIR}/${slug}.md`;
9427
+ },
9428
+ commandPath(name, _config) {
9429
+ return `${KILO_CODE_COMMANDS_DIR}/${name}.md`;
9430
+ },
9431
+ agentPath(name, _config) {
9432
+ return `${KILO_CODE_AGENTS_DIR}/${name}.md`;
9433
+ }
9434
+ }
9435
+ };
9436
+ globalLayout3 = {
9437
+ rootInstructionPath: KILO_CODE_GLOBAL_AGENTS_MD,
9438
+ skillDir: KILO_CODE_GLOBAL_SKILLS_DIR,
9439
+ managedOutputs: {
9440
+ dirs: [
9441
+ KILO_CODE_GLOBAL_RULES_DIR,
9442
+ KILO_CODE_GLOBAL_COMMANDS_DIR,
9443
+ KILO_CODE_GLOBAL_AGENTS_DIR,
9444
+ KILO_CODE_GLOBAL_SKILLS_DIR,
9445
+ KILO_CODE_GLOBAL_AGENTS_SKILLS_DIR
9446
+ ],
9447
+ files: [KILO_CODE_GLOBAL_AGENTS_MD, KILO_CODE_GLOBAL_MCP_FILE, KILO_CODE_GLOBAL_IGNORE]
9448
+ },
9449
+ rewriteGeneratedPath(path) {
9450
+ if (path === KILO_CODE_ROOT_RULE) return KILO_CODE_GLOBAL_AGENTS_MD;
9451
+ return path;
9452
+ },
9453
+ mirrorGlobalPath(path, activeTargets) {
9454
+ return mirrorSkillsToAgents(path, KILO_CODE_GLOBAL_SKILLS_DIR, activeTargets);
9455
+ },
9456
+ paths: {
9457
+ rulePath(slug, _rule) {
9458
+ return `${KILO_CODE_GLOBAL_RULES_DIR}/${slug}.md`;
9459
+ },
9460
+ commandPath(name, _config) {
9461
+ return `${KILO_CODE_GLOBAL_COMMANDS_DIR}/${name}.md`;
9462
+ },
9463
+ agentPath(name, _config) {
9464
+ return `${KILO_CODE_GLOBAL_AGENTS_DIR}/${name}.md`;
9465
+ }
9466
+ }
9467
+ };
9468
+ capabilities = {
9469
+ rules: "native",
9470
+ additionalRules: "native",
9471
+ commands: "native",
9472
+ agents: "native",
9473
+ skills: "native",
9474
+ mcp: "native",
9475
+ hooks: "none",
9476
+ ignore: "native",
9477
+ permissions: "none"
9478
+ };
9479
+ descriptor10 = {
9480
+ id: KILO_CODE_TARGET,
9481
+ generators: target10,
9482
+ capabilities,
9483
+ emptyImportMessage: "No Kilo Code config found (AGENTS.md, .kilo/rules, .kilo/commands, .kilo/agents, .kilo/skills, .kilo/mcp.json, .kilocodeignore, .kilocode/, or .kilocodemodes).",
9484
+ lintRules: lintRules10,
9485
+ lint: {
9486
+ hooks: lintHooks4,
9487
+ permissions: lintPermissions2
9488
+ },
9489
+ project: project10,
9490
+ globalSupport: {
9491
+ capabilities,
9492
+ detectionPaths: [
9493
+ KILO_CODE_GLOBAL_AGENTS_MD,
9494
+ KILO_CODE_GLOBAL_RULES_DIR,
9495
+ KILO_CODE_GLOBAL_COMMANDS_DIR,
9496
+ KILO_CODE_GLOBAL_AGENTS_DIR,
9497
+ KILO_CODE_GLOBAL_SKILLS_DIR,
9498
+ KILO_CODE_GLOBAL_MCP_FILE,
9499
+ KILO_CODE_GLOBAL_IGNORE
9500
+ ],
9501
+ layout: globalLayout3
9502
+ },
9503
+ importer: {
9504
+ rules: [
9505
+ {
9506
+ // Root rule: prefer AGENTS.md (new) → in legacy projects users
9507
+ // historically used .kilocode/rules/00-root.md, but those import
9508
+ // through the descriptor's directory mapper as a regular rule with
9509
+ // slug `00-root` (we don't promote them to root). The legacy global
9510
+ // rules dir falls back to AGENTS.md only.
9511
+ feature: "rules",
9512
+ mode: "singleFile",
9513
+ source: {
9514
+ project: [KILO_CODE_ROOT_RULE],
9515
+ global: [KILO_CODE_GLOBAL_AGENTS_MD]
9516
+ },
9517
+ canonicalDir: KILO_CODE_CANONICAL_RULES_DIR,
9518
+ canonicalRootFilename: "_root.md",
9519
+ markAsRoot: true
9520
+ },
9521
+ {
9522
+ feature: "rules",
9523
+ mode: "directory",
9524
+ source: {
9525
+ project: [KILO_CODE_RULES_DIR],
9526
+ global: [KILO_CODE_GLOBAL_RULES_DIR]
9527
+ },
9528
+ canonicalDir: KILO_CODE_CANONICAL_RULES_DIR,
9529
+ extensions: [".md"],
9530
+ map: kiloNonRootRuleMapper
9531
+ }
9532
+ ],
9533
+ commands: {
9534
+ feature: "commands",
9535
+ mode: "directory",
9536
+ source: {
9537
+ project: [KILO_CODE_COMMANDS_DIR],
9538
+ global: [KILO_CODE_GLOBAL_COMMANDS_DIR]
9539
+ },
9540
+ canonicalDir: KILO_CODE_CANONICAL_COMMANDS_DIR,
9541
+ extensions: [".md"],
9542
+ map: kiloCommandMapper
9543
+ },
9544
+ agents: {
9545
+ feature: "agents",
9546
+ mode: "directory",
9547
+ source: {
9548
+ project: [KILO_CODE_AGENTS_DIR],
9549
+ global: [KILO_CODE_GLOBAL_AGENTS_DIR]
9550
+ },
9551
+ canonicalDir: KILO_CODE_CANONICAL_AGENTS_DIR,
9552
+ extensions: [".md"],
9553
+ map: kiloAgentMapper
9554
+ },
9555
+ mcp: {
9556
+ feature: "mcp",
9557
+ mode: "mcpJson",
9558
+ source: {
9559
+ project: [KILO_CODE_MCP_FILE, KILO_CODE_LEGACY_MCP_FILE],
9560
+ global: [KILO_CODE_GLOBAL_MCP_FILE]
9561
+ },
9562
+ canonicalDir: ".agentsmesh",
9563
+ canonicalFilename: KILO_CODE_CANONICAL_MCP
9564
+ },
9565
+ ignore: {
9566
+ feature: "ignore",
9567
+ mode: "flatFile",
9568
+ source: {
9569
+ project: [KILO_CODE_IGNORE],
9570
+ global: [KILO_CODE_GLOBAL_IGNORE]
9571
+ },
9572
+ canonicalDir: ".agentsmesh",
9573
+ canonicalFilename: KILO_CODE_CANONICAL_IGNORE
9574
+ }
9575
+ },
9576
+ buildImportPaths: buildKiloCodeImportPaths,
9577
+ detectionPaths: [
9578
+ KILO_CODE_RULES_DIR,
9579
+ KILO_CODE_COMMANDS_DIR,
9580
+ KILO_CODE_AGENTS_DIR,
9581
+ KILO_CODE_SKILLS_DIR,
9582
+ KILO_CODE_MCP_FILE,
9583
+ KILO_CODE_LEGACY_RULES_DIR,
9584
+ KILO_CODE_LEGACY_WORKFLOWS_DIR,
9585
+ KILO_CODE_LEGACY_SKILLS_DIR,
9586
+ KILO_CODE_LEGACY_MCP_FILE,
9587
+ KILO_CODE_LEGACY_MODES_FILE,
9588
+ KILO_CODE_IGNORE,
9589
+ "kilo.jsonc",
9590
+ "kilo.json"
9591
+ ]
9592
+ };
9593
+ }
9594
+ });
9595
+ function toKebab(value) {
9596
+ return value.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
9597
+ }
9598
+ function hookText(entry) {
9599
+ return entry.type === "prompt" ? entry.prompt : entry.command;
9600
+ }
9601
+ function toWhen(event, matcher) {
9602
+ const type = CANONICAL_TO_KIRO[event];
9603
+ if (event === "PreToolUse" || event === "PostToolUse") {
9604
+ return { type, tools: [matcher || "*"] };
9605
+ }
9606
+ return { type };
9607
+ }
9608
+ function generateKiroHooks(hooks) {
9609
+ const outputs = [];
9610
+ for (const [event, entries] of Object.entries(hooks)) {
9611
+ const mappedEvent = event;
9612
+ if (!(mappedEvent in CANONICAL_TO_KIRO) || !Array.isArray(entries)) continue;
9613
+ let index = 1;
9614
+ for (const entry of entries) {
9615
+ const text = hookText(entry);
9616
+ if (!text) continue;
9617
+ const file = {
9618
+ name: `${toKebab(event)} ${index}`,
9619
+ version: "1",
9620
+ when: toWhen(mappedEvent, entry.matcher),
9621
+ then: entry.type === "prompt" ? { type: "askAgent", prompt: text } : { type: "shellCommand", command: text }
9622
+ };
9623
+ outputs.push({
9624
+ name: `${toKebab(event)}-${index}.kiro.hook`,
9625
+ content: JSON.stringify(file, null, 2)
9626
+ });
9627
+ index += 1;
9628
+ }
9629
+ }
9630
+ return outputs;
9631
+ }
9632
+ function toCanonicalEntry(file) {
9633
+ const canonicalEvent = KIRO_TO_CANONICAL.get(file.when.type);
9634
+ if (!canonicalEvent) return null;
9635
+ const matcher = file.when.tools?.[0] ?? file.when.patterns?.[0] ?? "*";
9636
+ if (file.then.type === "askAgent" && typeof file.then.prompt === "string") {
9637
+ return {
9638
+ event: canonicalEvent,
9639
+ entry: {
9640
+ matcher,
9641
+ command: file.then.prompt,
9642
+ prompt: file.then.prompt,
8942
9643
  type: "prompt"
8943
9644
  }
8944
9645
  };
@@ -8998,7 +9699,7 @@ function steeringFrontmatter(rule) {
8998
9699
  if (rule.description) frontmatter.description = rule.description;
8999
9700
  return frontmatter;
9000
9701
  }
9001
- function generateRules10(canonical) {
9702
+ function generateRules11(canonical) {
9002
9703
  const outputs = [];
9003
9704
  const root = canonical.rules.find((rule) => rule.root);
9004
9705
  if (root) {
@@ -9015,10 +9716,10 @@ function generateRules10(canonical) {
9015
9716
  }
9016
9717
  return outputs;
9017
9718
  }
9018
- function generateSkills10(canonical) {
9719
+ function generateSkills11(canonical) {
9019
9720
  return generateEmbeddedSkills(canonical, KIRO_SKILLS_DIR);
9020
9721
  }
9021
- function generateMcp8(canonical) {
9722
+ function generateMcp9(canonical) {
9022
9723
  if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
9023
9724
  return [
9024
9725
  {
@@ -9034,7 +9735,7 @@ function generateHooks5(canonical) {
9034
9735
  content: hook.content
9035
9736
  }));
9036
9737
  }
9037
- function generateAgents8(canonical) {
9738
+ function generateAgents9(canonical) {
9038
9739
  return canonical.agents.map((agent) => {
9039
9740
  const frontmatter = {
9040
9741
  name: agent.name,
@@ -9049,16 +9750,16 @@ function generateAgents8(canonical) {
9049
9750
  return { path: `${KIRO_AGENTS_DIR}/${agent.name}.md`, content };
9050
9751
  });
9051
9752
  }
9052
- function generateIgnore6(canonical) {
9753
+ function generateIgnore7(canonical) {
9053
9754
  if (canonical.ignore.length === 0) return [];
9054
9755
  return [{ path: KIRO_IGNORE, content: canonical.ignore.join("\n") }];
9055
9756
  }
9056
- var init_generator13 = __esm({
9757
+ var init_generator14 = __esm({
9057
9758
  "src/targets/kiro/generator.ts"() {
9058
9759
  init_embedded_skill();
9059
9760
  init_markdown();
9060
9761
  init_hook_format();
9061
- init_constants8();
9762
+ init_constants9();
9062
9763
  }
9063
9764
  });
9064
9765
  function canonicalRuleMeta(frontmatter) {
@@ -9147,12 +9848,12 @@ async function importFromKiro(projectRoot, options = {}) {
9147
9848
  const normalize = await createImportReferenceNormalizer(KIRO_TARGET, projectRoot, scope);
9148
9849
  await importRoot(projectRoot, results, normalize, scope);
9149
9850
  await importNonRootRules(projectRoot, results, normalize);
9150
- results.push(...await runDescriptorImport(descriptor10, projectRoot, scope, { normalize }));
9851
+ results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
9151
9852
  await importEmbeddedSkills(projectRoot, KIRO_SKILLS_DIR, KIRO_TARGET, results, normalize);
9152
9853
  if (scope === "project") await importHooks2(projectRoot, results);
9153
9854
  return results;
9154
9855
  }
9155
- var init_importer9 = __esm({
9856
+ var init_importer10 = __esm({
9156
9857
  "src/targets/kiro/importer.ts"() {
9157
9858
  init_import_rewriter();
9158
9859
  init_embedded_skill();
@@ -9163,13 +9864,13 @@ var init_importer9 = __esm({
9163
9864
  init_fs();
9164
9865
  init_markdown();
9165
9866
  init_hook_format();
9166
- init_constants8();
9867
+ init_constants9();
9167
9868
  init_kiro2();
9168
9869
  }
9169
9870
  });
9170
9871
 
9171
9872
  // src/targets/kiro/linter.ts
9172
- function lintRules10(canonical, projectRoot, projectFiles, options) {
9873
+ function lintRules11(canonical, projectRoot, projectFiles, options) {
9173
9874
  return validateRules(canonical, projectRoot, projectFiles, {
9174
9875
  checkGlobMatches: options?.scope !== "global"
9175
9876
  }).map((diagnostic) => ({
@@ -9177,15 +9878,15 @@ function lintRules10(canonical, projectRoot, projectFiles, options) {
9177
9878
  target: KIRO_TARGET
9178
9879
  }));
9179
9880
  }
9180
- var init_linter10 = __esm({
9881
+ var init_linter11 = __esm({
9181
9882
  "src/targets/kiro/linter.ts"() {
9182
9883
  init_validate_rules();
9183
- init_constants8();
9884
+ init_constants9();
9184
9885
  }
9185
9886
  });
9186
9887
 
9187
9888
  // src/targets/kiro/lint.ts
9188
- function lintHooks4(canonical) {
9889
+ function lintHooks5(canonical) {
9189
9890
  if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
9190
9891
  const supported = ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SubagentStop"];
9191
9892
  const supportedSet = new Set(supported);
@@ -9193,35 +9894,35 @@ function lintHooks4(canonical) {
9193
9894
  (event) => createUnsupportedHookWarning(event, "kiro", supported, { unsupportedBy: "Kiro hooks" })
9194
9895
  );
9195
9896
  }
9196
- var init_lint8 = __esm({
9897
+ var init_lint9 = __esm({
9197
9898
  "src/targets/kiro/lint.ts"() {
9198
9899
  init_helpers();
9199
9900
  }
9200
9901
  });
9201
9902
 
9202
9903
  // src/targets/kiro/index.ts
9203
- var target10, project10, global8, globalCapabilities10, descriptor10;
9904
+ var target11, project11, global8, globalCapabilities10, descriptor11;
9204
9905
  var init_kiro2 = __esm({
9205
9906
  "src/targets/kiro/index.ts"() {
9206
- init_generator13();
9907
+ init_generator14();
9207
9908
  init_skill_mirror();
9208
- init_importer9();
9209
- init_linter10();
9210
- init_lint8();
9909
+ init_importer10();
9910
+ init_linter11();
9911
+ init_lint9();
9211
9912
  init_import_map_builders();
9212
- init_constants8();
9213
- target10 = {
9913
+ init_constants9();
9914
+ target11 = {
9214
9915
  name: KIRO_TARGET,
9215
9916
  primaryRootInstructionPath: KIRO_AGENTS_MD,
9216
- generateRules: generateRules10,
9217
- generateAgents: generateAgents8,
9218
- generateSkills: generateSkills10,
9219
- generateMcp: generateMcp8,
9917
+ generateRules: generateRules11,
9918
+ generateAgents: generateAgents9,
9919
+ generateSkills: generateSkills11,
9920
+ generateMcp: generateMcp9,
9220
9921
  generateHooks: generateHooks5,
9221
- generateIgnore: generateIgnore6,
9922
+ generateIgnore: generateIgnore7,
9222
9923
  importFrom: importFromKiro
9223
9924
  };
9224
- project10 = {
9925
+ project11 = {
9225
9926
  rootInstructionPath: KIRO_AGENTS_MD,
9226
9927
  skillDir: KIRO_SKILLS_DIR,
9227
9928
  managedOutputs: {
@@ -9302,9 +10003,9 @@ var init_kiro2 = __esm({
9302
10003
  ignore: "native",
9303
10004
  permissions: "none"
9304
10005
  };
9305
- descriptor10 = {
10006
+ descriptor11 = {
9306
10007
  id: KIRO_TARGET,
9307
- generators: target10,
10008
+ generators: target11,
9308
10009
  capabilities: {
9309
10010
  rules: "native",
9310
10011
  additionalRules: "native",
@@ -9317,11 +10018,11 @@ var init_kiro2 = __esm({
9317
10018
  permissions: "none"
9318
10019
  },
9319
10020
  emptyImportMessage: "No Kiro config found (AGENTS.md, .kiro/steering, .kiro/skills, .kiro/agents, .kiro/hooks, .kiro/settings/mcp.json, or .kiroignore).",
9320
- lintRules: lintRules10,
10021
+ lintRules: lintRules11,
9321
10022
  lint: {
9322
- hooks: lintHooks4
10023
+ hooks: lintHooks5
9323
10024
  },
9324
- project: project10,
10025
+ project: project11,
9325
10026
  globalSupport: {
9326
10027
  capabilities: globalCapabilities10,
9327
10028
  detectionPaths: [
@@ -9370,7 +10071,7 @@ var init_kiro2 = __esm({
9370
10071
  };
9371
10072
  }
9372
10073
  });
9373
- function generateRules11(canonical) {
10074
+ function generateRules12(canonical) {
9374
10075
  const outputs = [];
9375
10076
  const root = canonical.rules.find((rule) => rule.root);
9376
10077
  if (root) {
@@ -9390,7 +10091,7 @@ function generateRules11(canonical) {
9390
10091
  }
9391
10092
  return outputs;
9392
10093
  }
9393
- function generateCommands10(canonical) {
10094
+ function generateCommands11(canonical) {
9394
10095
  return canonical.commands.map((command) => {
9395
10096
  const frontmatter = {};
9396
10097
  if (command.description) frontmatter.description = command.description;
@@ -9400,7 +10101,7 @@ function generateCommands10(canonical) {
9400
10101
  };
9401
10102
  });
9402
10103
  }
9403
- function generateMcp9(canonical) {
10104
+ function generateMcp10(canonical) {
9404
10105
  if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
9405
10106
  return [
9406
10107
  {
@@ -9409,14 +10110,14 @@ function generateMcp9(canonical) {
9409
10110
  }
9410
10111
  ];
9411
10112
  }
9412
- function generateIgnore7(canonical) {
10113
+ function generateIgnore8(canonical) {
9413
10114
  if (canonical.ignore.length === 0) return [];
9414
10115
  return [{ path: ROO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
9415
10116
  }
9416
- function generateSkills11(canonical) {
10117
+ function generateSkills12(canonical) {
9417
10118
  return generateEmbeddedSkills(canonical, ROO_CODE_SKILLS_DIR);
9418
10119
  }
9419
- function generateAgents9(canonical) {
10120
+ function generateAgents10(canonical) {
9420
10121
  if (canonical.agents.length === 0) return [];
9421
10122
  const customModes = canonical.agents.map((agent) => {
9422
10123
  const slug = basename(agent.source, ".md");
@@ -9427,19 +10128,19 @@ function generateAgents9(canonical) {
9427
10128
  });
9428
10129
  return [{ path: ROO_CODE_MODES_FILE, content: stringify({ customModes }) }];
9429
10130
  }
9430
- var init_generator14 = __esm({
10131
+ var init_generator15 = __esm({
9431
10132
  "src/targets/roo-code/generator.ts"() {
9432
10133
  init_embedded_skill();
9433
10134
  init_markdown();
9434
- init_constants9();
10135
+ init_constants10();
9435
10136
  }
9436
10137
  });
9437
10138
  var rooNonRootRuleMapper, rooCommandMapper;
9438
- var init_import_mappers7 = __esm({
10139
+ var init_import_mappers8 = __esm({
9439
10140
  "src/targets/roo-code/import-mappers.ts"() {
9440
10141
  init_markdown();
9441
10142
  init_import_metadata();
9442
- init_constants9();
10143
+ init_constants10();
9443
10144
  rooNonRootRuleMapper = async ({
9444
10145
  relativePath,
9445
10146
  normalizeTo,
@@ -9523,25 +10224,25 @@ async function importFromRooCode(projectRoot, options = {}) {
9523
10224
  const scope = options.scope ?? "project";
9524
10225
  const results = [];
9525
10226
  const normalize = await createImportReferenceNormalizer(ROO_CODE_TARGET, projectRoot, scope);
9526
- results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
10227
+ results.push(...await runDescriptorImport(descriptor12, projectRoot, scope, { normalize }));
9527
10228
  await importPerModeRules(projectRoot, results, normalize);
9528
10229
  await importEmbeddedSkills(projectRoot, ROO_CODE_SKILLS_DIR, ROO_CODE_TARGET, results, normalize);
9529
10230
  return results;
9530
10231
  }
9531
- var init_importer10 = __esm({
10232
+ var init_importer11 = __esm({
9532
10233
  "src/targets/roo-code/importer.ts"() {
9533
10234
  init_import_rewriter();
9534
10235
  init_embedded_skill();
9535
10236
  init_import_orchestrator();
9536
10237
  init_descriptor_import_runner();
9537
- init_import_mappers7();
9538
- init_constants9();
10238
+ init_import_mappers8();
10239
+ init_constants10();
9539
10240
  init_roo_code2();
9540
10241
  }
9541
10242
  });
9542
10243
 
9543
10244
  // src/targets/roo-code/linter.ts
9544
- function lintRules11(canonical, projectRoot, projectFiles, options) {
10245
+ function lintRules12(canonical, projectRoot, projectFiles, options) {
9545
10246
  return validateRules(canonical, projectRoot, projectFiles, {
9546
10247
  checkGlobMatches: options?.scope !== "global"
9547
10248
  }).map((diagnostic) => ({
@@ -9549,10 +10250,10 @@ function lintRules11(canonical, projectRoot, projectFiles, options) {
9549
10250
  target: ROO_CODE_TARGET
9550
10251
  }));
9551
10252
  }
9552
- var init_linter11 = __esm({
10253
+ var init_linter12 = __esm({
9553
10254
  "src/targets/roo-code/linter.ts"() {
9554
10255
  init_validate_rules();
9555
- init_constants9();
10256
+ init_constants10();
9556
10257
  }
9557
10258
  });
9558
10259
  function computeStatus5(existing, content) {
@@ -9560,29 +10261,29 @@ function computeStatus5(existing, content) {
9560
10261
  if (existing !== content) return "updated";
9561
10262
  return "unchanged";
9562
10263
  }
9563
- var target11, project11, generateRooGlobalExtras, global9, globalCapabilities11, descriptor11;
10264
+ var target12, project12, generateRooGlobalExtras, global9, globalCapabilities11, descriptor12;
9564
10265
  var init_roo_code2 = __esm({
9565
10266
  "src/targets/roo-code/index.ts"() {
9566
10267
  init_fs();
9567
- init_generator14();
9568
- init_constants9();
10268
+ init_generator15();
10269
+ init_constants10();
9569
10270
  init_skill_mirror();
9570
- init_importer10();
9571
- init_import_mappers7();
9572
- init_linter11();
10271
+ init_importer11();
10272
+ init_import_mappers8();
10273
+ init_linter12();
9573
10274
  init_import_map_builders();
9574
- target11 = {
10275
+ target12 = {
9575
10276
  name: "roo-code",
9576
10277
  primaryRootInstructionPath: ROO_CODE_ROOT_RULE,
9577
- generateRules: generateRules11,
9578
- generateCommands: generateCommands10,
9579
- generateSkills: generateSkills11,
9580
- generateMcp: generateMcp9,
9581
- generateIgnore: generateIgnore7,
9582
- generateAgents: generateAgents9,
10278
+ generateRules: generateRules12,
10279
+ generateCommands: generateCommands11,
10280
+ generateSkills: generateSkills12,
10281
+ generateMcp: generateMcp10,
10282
+ generateIgnore: generateIgnore8,
10283
+ generateAgents: generateAgents10,
9583
10284
  importFrom: importFromRooCode
9584
10285
  };
9585
- project11 = {
10286
+ project12 = {
9586
10287
  rootInstructionPath: ROO_CODE_ROOT_RULE,
9587
10288
  skillDir: ".roo/skills",
9588
10289
  managedOutputs: {
@@ -9690,9 +10391,9 @@ var init_roo_code2 = __esm({
9690
10391
  ignore: "native",
9691
10392
  permissions: "none"
9692
10393
  };
9693
- descriptor11 = {
10394
+ descriptor12 = {
9694
10395
  id: "roo-code",
9695
- generators: target11,
10396
+ generators: target12,
9696
10397
  capabilities: {
9697
10398
  rules: "native",
9698
10399
  additionalRules: "native",
@@ -9705,8 +10406,8 @@ var init_roo_code2 = __esm({
9705
10406
  permissions: "none"
9706
10407
  },
9707
10408
  emptyImportMessage: "No Roo Code config found (.roo/rules, .roo/commands, .roo/skills, .roo/mcp.json, .rooignore, or .roorules).",
9708
- lintRules: lintRules11,
9709
- project: project11,
10409
+ lintRules: lintRules12,
10410
+ project: project12,
9710
10411
  globalSupport: {
9711
10412
  capabilities: globalCapabilities11,
9712
10413
  detectionPaths: [
@@ -9789,7 +10490,7 @@ var init_roo_code2 = __esm({
9789
10490
 
9790
10491
  // src/targets/windsurf/constants.ts
9791
10492
  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;
9792
- var init_constants13 = __esm({
10493
+ var init_constants14 = __esm({
9793
10494
  "src/targets/windsurf/constants.ts"() {
9794
10495
  WINDSURF_TARGET = "windsurf";
9795
10496
  WINDSURF_RULES_ROOT = ".windsurfrules";
@@ -9828,7 +10529,7 @@ function directoryScopedRuleDir(globs) {
9828
10529
  if (dirs.length !== globs.length) return null;
9829
10530
  return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
9830
10531
  }
9831
- function generateRules12(canonical) {
10532
+ function generateRules13(canonical) {
9832
10533
  const outputs = [];
9833
10534
  const root = canonical.rules.find((r) => r.root);
9834
10535
  if (!root) return [];
@@ -9865,23 +10566,23 @@ function generateRules12(canonical) {
9865
10566
  var init_rules4 = __esm({
9866
10567
  "src/targets/windsurf/generator/rules.ts"() {
9867
10568
  init_markdown();
9868
- init_constants13();
10569
+ init_constants14();
9869
10570
  }
9870
10571
  });
9871
10572
 
9872
10573
  // src/targets/windsurf/generator/ignore.ts
9873
- function generateIgnore8(canonical) {
10574
+ function generateIgnore9(canonical) {
9874
10575
  if (!canonical.ignore || canonical.ignore.length === 0) return [];
9875
10576
  return [{ path: CODEIUM_IGNORE, content: canonical.ignore.join("\n") }];
9876
10577
  }
9877
10578
  var init_ignore3 = __esm({
9878
10579
  "src/targets/windsurf/generator/ignore.ts"() {
9879
- init_constants13();
10580
+ init_constants14();
9880
10581
  }
9881
10582
  });
9882
10583
 
9883
10584
  // src/targets/windsurf/generator/workflows.ts
9884
- function generateCommands11(canonical) {
10585
+ function generateCommands12(canonical) {
9885
10586
  return canonical.commands.map((cmd) => {
9886
10587
  const frontmatter = {
9887
10588
  description: cmd.description.trim() || void 0,
@@ -9900,12 +10601,12 @@ function generateCommands11(canonical) {
9900
10601
  var init_workflows = __esm({
9901
10602
  "src/targets/windsurf/generator/workflows.ts"() {
9902
10603
  init_markdown();
9903
- init_constants13();
10604
+ init_constants14();
9904
10605
  }
9905
10606
  });
9906
10607
 
9907
10608
  // src/targets/windsurf/generator/agents.ts
9908
- function generateAgents10(canonical) {
10609
+ function generateAgents11(canonical) {
9909
10610
  return canonical.agents.map((agent) => ({
9910
10611
  path: `${WINDSURF_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
9911
10612
  content: serializeProjectedAgentSkill(agent)
@@ -9914,12 +10615,12 @@ function generateAgents10(canonical) {
9914
10615
  var init_agents4 = __esm({
9915
10616
  "src/targets/windsurf/generator/agents.ts"() {
9916
10617
  init_projected_agent_skill();
9917
- init_constants13();
10618
+ init_constants14();
9918
10619
  }
9919
10620
  });
9920
10621
 
9921
10622
  // src/targets/windsurf/generator/mcp.ts
9922
- function generateMcp10(canonical) {
10623
+ function generateMcp11(canonical) {
9923
10624
  if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
9924
10625
  return [
9925
10626
  {
@@ -9930,7 +10631,7 @@ function generateMcp10(canonical) {
9930
10631
  }
9931
10632
  var init_mcp3 = __esm({
9932
10633
  "src/targets/windsurf/generator/mcp.ts"() {
9933
- init_constants13();
10634
+ init_constants14();
9934
10635
  }
9935
10636
  });
9936
10637
 
@@ -9973,12 +10674,12 @@ function generateHooks6(canonical) {
9973
10674
  var init_hooks2 = __esm({
9974
10675
  "src/targets/windsurf/generator/hooks.ts"() {
9975
10676
  init_hook_command();
9976
- init_constants13();
10677
+ init_constants14();
9977
10678
  }
9978
10679
  });
9979
10680
 
9980
10681
  // src/targets/windsurf/generator/skills.ts
9981
- function generateSkills12(canonical) {
10682
+ function generateSkills13(canonical) {
9982
10683
  const outputs = [];
9983
10684
  for (const skill of canonical.skills) {
9984
10685
  const frontmatter = {
@@ -10000,12 +10701,12 @@ function generateSkills12(canonical) {
10000
10701
  var init_skills4 = __esm({
10001
10702
  "src/targets/windsurf/generator/skills.ts"() {
10002
10703
  init_markdown();
10003
- init_constants13();
10704
+ init_constants14();
10004
10705
  }
10005
10706
  });
10006
10707
 
10007
10708
  // src/targets/windsurf/generator/index.ts
10008
- var init_generator15 = __esm({
10709
+ var init_generator16 = __esm({
10009
10710
  "src/targets/windsurf/generator/index.ts"() {
10010
10711
  init_rules4();
10011
10712
  init_ignore3();
@@ -10018,9 +10719,9 @@ var init_generator15 = __esm({
10018
10719
  });
10019
10720
 
10020
10721
  // src/targets/windsurf/generator.ts
10021
- var init_generator16 = __esm({
10722
+ var init_generator17 = __esm({
10022
10723
  "src/targets/windsurf/generator.ts"() {
10023
- init_generator15();
10724
+ init_generator16();
10024
10725
  }
10025
10726
  });
10026
10727
  function toStringArray8(value) {
@@ -10072,7 +10773,7 @@ var init_importer_workflows = __esm({
10072
10773
  init_fs();
10073
10774
  init_markdown();
10074
10775
  init_import_metadata();
10075
- init_constants13();
10776
+ init_constants14();
10076
10777
  }
10077
10778
  });
10078
10779
  async function importSkills4(projectRoot, results, normalize, skillsRelDir = WINDSURF_SKILLS_DIR) {
@@ -10119,7 +10820,7 @@ var init_skills_adapter5 = __esm({
10119
10820
  init_projected_agent_skill();
10120
10821
  init_scoped_agents_import();
10121
10822
  init_skill_import_pipeline();
10122
- init_constants13();
10823
+ init_constants14();
10123
10824
  }
10124
10825
  });
10125
10826
  async function importWindsurfHooks(projectRoot, results) {
@@ -10217,7 +10918,7 @@ async function importWindsurfMcp(projectRoot, results) {
10217
10918
  var init_importer_hooks_mcp = __esm({
10218
10919
  "src/targets/windsurf/importer-hooks-mcp.ts"() {
10219
10920
  init_fs();
10220
- init_constants13();
10921
+ init_constants14();
10221
10922
  }
10222
10923
  });
10223
10924
  async function importFromWindsurf(projectRoot, options) {
@@ -10354,7 +11055,7 @@ async function importFromWindsurf(projectRoot, options) {
10354
11055
  await importWindsurfMcp(projectRoot, results);
10355
11056
  return results;
10356
11057
  }
10357
- var init_importer11 = __esm({
11058
+ var init_importer12 = __esm({
10358
11059
  "src/targets/windsurf/importer.ts"() {
10359
11060
  init_import_rewriter();
10360
11061
  init_fs();
@@ -10362,13 +11063,13 @@ var init_importer11 = __esm({
10362
11063
  init_import_metadata();
10363
11064
  init_import_orchestrator();
10364
11065
  init_scoped_agents_import();
10365
- init_constants13();
11066
+ init_constants14();
10366
11067
  init_importer_workflows();
10367
11068
  init_skills_adapter5();
10368
11069
  init_importer_hooks_mcp();
10369
11070
  }
10370
11071
  });
10371
- function lintRules12(canonical, projectRoot, _projectFiles) {
11072
+ function lintRules13(canonical, projectRoot, _projectFiles) {
10372
11073
  const diags = [];
10373
11074
  const { rules } = canonical;
10374
11075
  if (rules.length > 0) {
@@ -10395,9 +11096,9 @@ function lintRules12(canonical, projectRoot, _projectFiles) {
10395
11096
  }
10396
11097
  return diags;
10397
11098
  }
10398
- var init_linter12 = __esm({
11099
+ var init_linter13 = __esm({
10399
11100
  "src/targets/windsurf/linter.ts"() {
10400
- init_constants13();
11101
+ init_constants14();
10401
11102
  }
10402
11103
  });
10403
11104
 
@@ -10421,7 +11122,7 @@ function lintMcp4(canonical) {
10421
11122
  )
10422
11123
  ];
10423
11124
  }
10424
- var init_lint9 = __esm({
11125
+ var init_lint10 = __esm({
10425
11126
  "src/targets/windsurf/lint.ts"() {
10426
11127
  init_helpers();
10427
11128
  }
@@ -10434,32 +11135,32 @@ function directoryScopedRuleDir2(globs) {
10434
11135
  if (dirs.length !== globs.length) return null;
10435
11136
  return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
10436
11137
  }
10437
- var target12, project12, global10, globalCapabilities12, descriptor12;
11138
+ var target13, project13, global10, globalCapabilities12, descriptor13;
10438
11139
  var init_windsurf2 = __esm({
10439
11140
  "src/targets/windsurf/index.ts"() {
10440
- init_generator16();
11141
+ init_generator17();
10441
11142
  init_capabilities();
10442
- init_constants13();
11143
+ init_constants14();
10443
11144
  init_skill_mirror();
10444
- init_importer11();
10445
- init_linter12();
10446
- init_lint9();
11145
+ init_importer12();
11146
+ init_linter13();
11147
+ init_lint10();
10447
11148
  init_import_map_builders();
10448
11149
  init_conversions();
10449
11150
  init_projected_agent_skill();
10450
- target12 = {
11151
+ target13 = {
10451
11152
  name: "windsurf",
10452
11153
  primaryRootInstructionPath: WINDSURF_AGENTS_MD,
10453
- generateRules: generateRules12,
10454
- generateCommands: generateCommands11,
10455
- generateAgents: generateAgents10,
10456
- generateSkills: generateSkills12,
10457
- generateMcp: generateMcp10,
11154
+ generateRules: generateRules13,
11155
+ generateCommands: generateCommands12,
11156
+ generateAgents: generateAgents11,
11157
+ generateSkills: generateSkills13,
11158
+ generateMcp: generateMcp11,
10458
11159
  generateHooks: generateHooks6,
10459
- generateIgnore: generateIgnore8,
11160
+ generateIgnore: generateIgnore9,
10460
11161
  importFrom: importFromWindsurf
10461
11162
  };
10462
- project12 = {
11163
+ project13 = {
10463
11164
  rootInstructionPath: WINDSURF_AGENTS_MD,
10464
11165
  extraRuleOutputPaths(rule) {
10465
11166
  if (rule.root) return [WINDSURF_AGENTS_MD];
@@ -10554,9 +11255,9 @@ var init_windsurf2 = __esm({
10554
11255
  ignore: "native",
10555
11256
  permissions: "none"
10556
11257
  };
10557
- descriptor12 = {
11258
+ descriptor13 = {
10558
11259
  id: "windsurf",
10559
- generators: target12,
11260
+ generators: target13,
10560
11261
  capabilities: {
10561
11262
  rules: "native",
10562
11263
  additionalRules: "native",
@@ -10570,12 +11271,12 @@ var init_windsurf2 = __esm({
10570
11271
  },
10571
11272
  emptyImportMessage: "No Windsurf config found (.windsurfrules, .windsurf/rules, .windsurfignore, or .codeiumignore).",
10572
11273
  supportsConversion: { agents: true },
10573
- lintRules: lintRules12,
11274
+ lintRules: lintRules13,
10574
11275
  lint: {
10575
11276
  commands: lintCommands6,
10576
11277
  mcp: lintMcp4
10577
11278
  },
10578
- project: project12,
11279
+ project: project13,
10579
11280
  globalSupport: {
10580
11281
  capabilities: globalCapabilities12,
10581
11282
  detectionPaths: [
@@ -10618,67 +11319,67 @@ function builtinTargetsMap() {
10618
11319
  }
10619
11320
  return _builtinTargetsMap;
10620
11321
  }
10621
- function getBuiltinTargetDefinition(target13) {
10622
- return builtinTargetsMap().get(target13);
11322
+ function getBuiltinTargetDefinition(target14) {
11323
+ return builtinTargetsMap().get(target14);
10623
11324
  }
10624
- function getTargetCapabilities(target13, scope = "project") {
10625
- const descriptor13 = getBuiltinTargetDefinition(target13) ?? getDescriptor(target13);
10626
- if (!descriptor13) return void 0;
10627
- const raw = scope === "global" ? descriptor13.globalSupport?.capabilities ?? descriptor13.capabilities : descriptor13.capabilities;
11325
+ function getTargetCapabilities(target14, scope = "project") {
11326
+ const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
11327
+ if (!descriptor14) return void 0;
11328
+ const raw = scope === "global" ? descriptor14.globalSupport?.capabilities ?? descriptor14.capabilities : descriptor14.capabilities;
10628
11329
  return normalizeTargetCapabilities(raw);
10629
11330
  }
10630
- function getTargetDetectionPaths(target13, scope = "project") {
10631
- const descriptor13 = getBuiltinTargetDefinition(target13) ?? getDescriptor(target13);
10632
- if (!descriptor13) return [];
11331
+ function getTargetDetectionPaths(target14, scope = "project") {
11332
+ const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
11333
+ if (!descriptor14) return [];
10633
11334
  if (scope === "global") {
10634
- return descriptor13.globalSupport?.detectionPaths ?? [];
11335
+ return descriptor14.globalSupport?.detectionPaths ?? [];
10635
11336
  }
10636
- return descriptor13.detectionPaths;
11337
+ return descriptor14.detectionPaths;
10637
11338
  }
10638
- function getTargetLayout(target13, scope = "project") {
10639
- const descriptor13 = getBuiltinTargetDefinition(target13) ?? getDescriptor(target13);
10640
- if (!descriptor13) return void 0;
11339
+ function getTargetLayout(target14, scope = "project") {
11340
+ const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
11341
+ if (!descriptor14) return void 0;
10641
11342
  if (scope === "global") {
10642
- return descriptor13.globalSupport?.layout;
11343
+ return descriptor14.globalSupport?.layout;
10643
11344
  }
10644
- return descriptor13.project;
11345
+ return descriptor14.project;
10645
11346
  }
10646
- function getTargetPrimaryRootInstructionPath(target13, scope = "project") {
10647
- return getTargetLayout(target13, scope)?.rootInstructionPath;
11347
+ function getTargetPrimaryRootInstructionPath(target14, scope = "project") {
11348
+ return getTargetLayout(target14, scope)?.rootInstructionPath;
10648
11349
  }
10649
- function getTargetSkillDir(target13, scope = "project") {
10650
- return getTargetLayout(target13, scope)?.skillDir;
11350
+ function getTargetSkillDir(target14, scope = "project") {
11351
+ return getTargetLayout(target14, scope)?.skillDir;
10651
11352
  }
10652
- function getTargetManagedOutputs(target13, scope = "project") {
10653
- return getTargetLayout(target13, scope)?.managedOutputs;
11353
+ function getTargetManagedOutputs(target14, scope = "project") {
11354
+ return getTargetLayout(target14, scope)?.managedOutputs;
10654
11355
  }
10655
- function rewriteGeneratedOutputPath(target13, path, scope = "project") {
10656
- const layout = getTargetLayout(target13, scope);
11356
+ function rewriteGeneratedOutputPath(target14, path, scope = "project") {
11357
+ const layout = getTargetLayout(target14, scope);
10657
11358
  if (!layout) return null;
10658
11359
  return layout.rewriteGeneratedPath ? layout.rewriteGeneratedPath(path) : path;
10659
11360
  }
10660
- function isFeatureSuppressedByConversion(descriptor13, feature, config, scope) {
10661
- if (!descriptor13 || !config) return false;
10662
- if (feature === "commands" && descriptor13.supportsConversion?.commands) {
10663
- return !shouldConvertCommandsToSkills(config, descriptor13.id, true, scope);
11361
+ function isFeatureSuppressedByConversion(descriptor14, feature, config, scope) {
11362
+ if (!descriptor14 || !config) return false;
11363
+ if (feature === "commands" && descriptor14.supportsConversion?.commands) {
11364
+ return !shouldConvertCommandsToSkills(config, descriptor14.id, true, scope);
10664
11365
  }
10665
- if (feature === "agents" && descriptor13.supportsConversion?.agents) {
10666
- return !shouldConvertAgentsToSkills(config, descriptor13.id, true, scope);
11366
+ if (feature === "agents" && descriptor14.supportsConversion?.agents) {
11367
+ return !shouldConvertAgentsToSkills(config, descriptor14.id, true, scope);
10667
11368
  }
10668
11369
  return false;
10669
11370
  }
10670
- function getEffectiveTargetSupportLevel(target13, feature, config, scope = "project") {
10671
- const baseLevel = getTargetCapabilities(target13, scope)?.[feature]?.level ?? "none";
11371
+ function getEffectiveTargetSupportLevel(target14, feature, config, scope = "project") {
11372
+ const baseLevel = getTargetCapabilities(target14, scope)?.[feature]?.level ?? "none";
10672
11373
  if (baseLevel !== "embedded") return baseLevel;
10673
- const descriptor13 = getBuiltinTargetDefinition(target13) ?? getDescriptor(target13);
10674
- return isFeatureSuppressedByConversion(descriptor13, feature, config, scope) ? "none" : baseLevel;
11374
+ const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
11375
+ return isFeatureSuppressedByConversion(descriptor14, feature, config, scope) ? "none" : baseLevel;
10675
11376
  }
10676
- function resolveTargetFeatureGenerator(target13, feature, config, scope = "project") {
10677
- const descriptor13 = getBuiltinTargetDefinition(target13) ?? getDescriptor(target13);
10678
- if (!descriptor13?.generators) return void 0;
10679
- if (isFeatureSuppressedByConversion(descriptor13, feature, config, scope)) return void 0;
11377
+ function resolveTargetFeatureGenerator(target14, feature, config, scope = "project") {
11378
+ const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
11379
+ if (!descriptor14?.generators) return void 0;
11380
+ if (isFeatureSuppressedByConversion(descriptor14, feature, config, scope)) return void 0;
10680
11381
  const pick = PICK_FEATURE_GENERATOR[feature];
10681
- return pick === null ? void 0 : pick(descriptor13.generators);
11382
+ return pick === null ? void 0 : pick(descriptor14.generators);
10682
11383
  }
10683
11384
  var BUILTIN_TARGETS, _builtinTargetsMap, PICK_FEATURE_GENERATOR;
10684
11385
  var init_builtin_targets = __esm({
@@ -10697,6 +11398,7 @@ var init_builtin_targets = __esm({
10697
11398
  init_cursor2();
10698
11399
  init_gemini_cli2();
10699
11400
  init_junie2();
11401
+ init_kilo_code2();
10700
11402
  init_kiro2();
10701
11403
  init_roo_code2();
10702
11404
  init_windsurf2();
@@ -10712,7 +11414,8 @@ var init_builtin_targets = __esm({
10712
11414
  descriptor9,
10713
11415
  descriptor10,
10714
11416
  descriptor11,
10715
- descriptor12
11417
+ descriptor12,
11418
+ descriptor13
10716
11419
  ];
10717
11420
  PICK_FEATURE_GENERATOR = {
10718
11421
  rules: (g) => g.generateRules,
@@ -10733,12 +11436,12 @@ function capabilityLevel(capability) {
10733
11436
  function canUseScopedSettings(feature) {
10734
11437
  return settingsBackedFeatures.includes(feature);
10735
11438
  }
10736
- function validateCapabilityImplementations(descriptor13, capabilities, ctx, pathPrefix) {
11439
+ function validateCapabilityImplementations(descriptor14, capabilities2, ctx, pathPrefix) {
10737
11440
  for (const requirement of generatorRequirements) {
10738
- const level = capabilityLevel(capabilities[requirement.feature]);
11441
+ const level = capabilityLevel(capabilities2[requirement.feature]);
10739
11442
  if (level === "none") continue;
10740
- const hasGenerator = typeof descriptor13.generators[requirement.generator] === "function";
10741
- const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof descriptor13.emitScopedSettings === "function";
11443
+ const hasGenerator = typeof descriptor14.generators[requirement.generator] === "function";
11444
+ const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof descriptor14.emitScopedSettings === "function";
10742
11445
  if (hasGenerator || hasSettingsEmitter) continue;
10743
11446
  ctx.addIssue({
10744
11447
  code: "custom",
@@ -10863,9 +11566,9 @@ var init_registry = __esm({
10863
11566
  });
10864
11567
 
10865
11568
  // src/core/reference/import-map.ts
10866
- async function buildImportReferenceMap(target13, projectRoot, scope = "project") {
11569
+ async function buildImportReferenceMap(target14, projectRoot, scope = "project") {
10867
11570
  const refs = /* @__PURE__ */ new Map();
10868
- const def = getDescriptor(target13);
11571
+ const def = getDescriptor(target14);
10869
11572
  if (def) {
10870
11573
  await def.buildImportPaths(refs, projectRoot, scope);
10871
11574
  }
@@ -10876,51 +11579,14 @@ var init_import_map = __esm({
10876
11579
  init_registry();
10877
11580
  }
10878
11581
  });
10879
- function pathApi(projectRoot) {
10880
- return projectRoot.includes("\\") || WINDOWS_ABSOLUTE_PATH.test(projectRoot) ? win32 : posix;
10881
- }
10882
- function normalizeSeparators(token) {
10883
- return token.replace(/\\/g, "/");
10884
- }
10885
- function normalizeForProject(projectRoot, filePath) {
10886
- const api = pathApi(projectRoot);
10887
- const normalized = api.normalize(
10888
- api === win32 ? filePath.replace(/\//g, "\\") : normalizeSeparators(filePath)
10889
- );
10890
- return normalized.endsWith(api.sep) && normalized.length > 1 ? normalized.slice(0, -1) : normalized;
10891
- }
10892
- function isAbsoluteForProject(projectRoot, filePath) {
10893
- return pathApi(projectRoot).isAbsolute(filePath) || WINDOWS_ABSOLUTE_PATH.test(filePath);
10894
- }
10895
- function stripTrailingPunctuation(token) {
10896
- let candidate = token;
10897
- let suffix = "";
10898
- while (TRAILING_PUNCTUATION.test(candidate)) {
10899
- suffix = candidate.at(-1) + suffix;
10900
- candidate = candidate.slice(0, -1);
10901
- }
10902
- return { candidate, suffix };
10903
- }
10904
- function rootFallbackPath(token, projectRoot) {
10905
- const api = pathApi(projectRoot);
10906
- const stripped = token.replace(/^(\.\.\/)+/, "").replace(/^\.\//, "");
10907
- return stripped && stripped !== token ? normalizeForProject(projectRoot, api.join(projectRoot, stripped)) : null;
10908
- }
10909
- var WINDOWS_ABSOLUTE_PATH, TRAILING_PUNCTUATION;
10910
- var init_path_helpers = __esm({
10911
- "src/core/path-helpers.ts"() {
10912
- WINDOWS_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]/;
10913
- TRAILING_PUNCTUATION = /[.!?:;]+$/;
10914
- }
10915
- });
10916
11582
 
10917
11583
  // src/core/reference/link-format-registry.ts
10918
- function topLevelDotfilePrefixes(descriptor13) {
10919
- const layouts = [descriptor13.project, descriptor13.globalSupport?.layout].filter(
11584
+ function topLevelDotfilePrefixes(descriptor14) {
11585
+ const layouts = [descriptor14.project, descriptor14.globalSupport?.layout].filter(
10920
11586
  (l) => l !== void 0
10921
11587
  );
10922
11588
  const candidates = [
10923
- ...descriptor13.detectionPaths,
11589
+ ...descriptor14.detectionPaths,
10924
11590
  ...layouts.flatMap((l) => l.managedOutputs?.dirs ?? []),
10925
11591
  ...layouts.flatMap((l) => l.managedOutputs?.files ?? [])
10926
11592
  ];
@@ -10933,8 +11599,8 @@ function topLevelDotfilePrefixes(descriptor13) {
10933
11599
  }
10934
11600
  function buildDefaultRootRelativePrefixes() {
10935
11601
  const set = /* @__PURE__ */ new Set([".agentsmesh/"]);
10936
- for (const descriptor13 of BUILTIN_TARGETS) {
10937
- for (const prefix of topLevelDotfilePrefixes(descriptor13)) set.add(prefix);
11602
+ for (const descriptor14 of BUILTIN_TARGETS) {
11603
+ for (const prefix of topLevelDotfilePrefixes(descriptor14)) set.add(prefix);
10938
11604
  }
10939
11605
  return Array.from(set);
10940
11606
  }
@@ -11005,7 +11671,7 @@ function resolveProjectPath(token, projectRoot, sourceFile) {
11005
11671
  }
11006
11672
  return [windowsToken];
11007
11673
  }
11008
- if (isAbsolute(token)) {
11674
+ if (api.isAbsolute(token)) {
11009
11675
  const absoluteToken = normalizeForProject(projectRoot, token);
11010
11676
  if (absoluteToken.startsWith(normalizedProjectRoot) || existsSync(token))
11011
11677
  return [absoluteToken];
@@ -11111,9 +11777,14 @@ var init_link_rebaser_helpers = __esm({
11111
11777
  LINE_NUMBER_SUFFIX = /(?::(\d+)){1,2}$/;
11112
11778
  }
11113
11779
  });
11780
+
11781
+ // src/core/reference/link-rebaser-formatting.ts
11114
11782
  function isReadingContext(context) {
11115
11783
  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";
11116
11784
  }
11785
+ function isReadingContextOptions(options) {
11786
+ return isReadingContext(options.tokenContext);
11787
+ }
11117
11788
  function isUnderProjectRoot(projectRoot, absolutePath) {
11118
11789
  const api = pathApi(projectRoot);
11119
11790
  const root = normalizeForProject(projectRoot, projectRoot);
@@ -11153,11 +11824,6 @@ function toProjectRootRelative(projectRoot, absolutePath, keepSlash) {
11153
11824
  const rewritten = relPath.length > 0 ? relPath : ".";
11154
11825
  return keepSlash && !rewritten.endsWith("/") ? `${rewritten}/` : rewritten;
11155
11826
  }
11156
- function shouldPreserveAgentsMeshAnchor(_projectRoot, _destinationFile, options) {
11157
- if (!isReadingContext(options.tokenContext)) return false;
11158
- if (options.originalToken === void 0) return false;
11159
- return normalizeSeparators(options.originalToken).startsWith(".agentsmesh/");
11160
- }
11161
11827
  function toProjectRootReference(projectRoot, absolutePath, keepSlash) {
11162
11828
  const formatted = toProjectRootRelative(projectRoot, absolutePath, keepSlash);
11163
11829
  if (formatted === null) return null;
@@ -11167,21 +11833,21 @@ function formatLinkPathForDestinationLegacy(projectRoot, destinationFile, absolu
11167
11833
  const api = pathApi(projectRoot);
11168
11834
  const root = normalizeForProject(projectRoot, projectRoot);
11169
11835
  const destFile = normalizeForProject(projectRoot, destinationFile);
11170
- const target13 = normalizeForProject(projectRoot, absoluteTargetPath);
11171
- if (!isUnderProjectRoot(projectRoot, target13)) {
11172
- return toProjectRootReference(projectRoot, target13, keepSlash)?.text ?? null;
11836
+ const target14 = normalizeForProject(projectRoot, absoluteTargetPath);
11837
+ if (!isUnderProjectRoot(projectRoot, target14)) {
11838
+ return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
11173
11839
  }
11174
- const destDir = normalizeForProject(projectRoot, dirname(destFile));
11840
+ const destDir = normalizeForProject(projectRoot, api.dirname(destFile));
11175
11841
  if (!isUnderProjectRoot(projectRoot, destDir) && destDir !== root) {
11176
- return toProjectRootReference(projectRoot, target13, keepSlash)?.text ?? null;
11842
+ return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
11177
11843
  }
11178
- let rel2 = api.relative(destDir, target13).replace(/\\/g, "/");
11844
+ let rel2 = api.relative(destDir, target14).replace(/\\/g, "/");
11179
11845
  if (api.isAbsolute(rel2) || WINDOWS_ABSOLUTE_PATH.test(rel2)) {
11180
- return toProjectRootRelative(projectRoot, target13, keepSlash);
11846
+ return toProjectRootRelative(projectRoot, target14, keepSlash);
11181
11847
  }
11182
11848
  const joined = normalizeForProject(projectRoot, api.join(destDir, rel2));
11183
11849
  if (!isUnderProjectRoot(projectRoot, joined)) {
11184
- return toProjectRootRelative(projectRoot, target13, keepSlash);
11850
+ return toProjectRootRelative(projectRoot, target14, keepSlash);
11185
11851
  }
11186
11852
  if (rel2 === "" || rel2 === ".") {
11187
11853
  rel2 = ".";
@@ -11200,9 +11866,14 @@ var init_link_rebaser_formatting = __esm({
11200
11866
  // src/core/reference/link-rebaser-output.ts
11201
11867
  function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTargetPath, keepSlash, options = {}) {
11202
11868
  const scope = options.scope ?? "project";
11203
- const target13 = normalizeForProject(projectRoot, absoluteTargetPath);
11204
- if (shouldPreserveAgentsMeshAnchor(projectRoot, destinationFile, options)) {
11205
- return normalizeSeparators(options.originalToken ?? "");
11869
+ const target14 = normalizeForProject(projectRoot, absoluteTargetPath);
11870
+ if (isReadingContextOptions(options) && isUnderAgentsMesh(projectRoot, destinationFile) && isUnderAgentsMesh(projectRoot, target14)) {
11871
+ const api = pathApi(projectRoot);
11872
+ const root = normalizeForProject(projectRoot, projectRoot);
11873
+ const rel2 = api.relative(root, target14).replace(/\\/g, "/");
11874
+ if (!rel2.startsWith("..") && rel2.length > 0) {
11875
+ return keepSlash && !rel2.endsWith("/") ? `${rel2}/` : rel2;
11876
+ }
11206
11877
  }
11207
11878
  if (options.forceRelative) {
11208
11879
  return formatLinkPathForDestinationLegacy(
@@ -11214,10 +11885,10 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
11214
11885
  );
11215
11886
  }
11216
11887
  if (scope === "global" && !isUnderAgentsMesh(projectRoot, destinationFile)) {
11217
- return toProjectRootReference(projectRoot, target13, keepSlash)?.text ?? null;
11888
+ return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
11218
11889
  }
11219
11890
  const meshCanonicalForShape = (() => {
11220
- if (isUnderAgentsMesh(projectRoot, target13)) return target13;
11891
+ if (isUnderAgentsMesh(projectRoot, target14)) return target14;
11221
11892
  const logical = options.logicalMeshSourceAbsolute;
11222
11893
  if (logical && isUnderAgentsMesh(projectRoot, normalizeForProject(projectRoot, logical))) {
11223
11894
  return normalizeForProject(projectRoot, logical);
@@ -11225,9 +11896,9 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
11225
11896
  return null;
11226
11897
  })();
11227
11898
  if (!meshCanonicalForShape) {
11228
- return toProjectRootReference(projectRoot, target13, keepSlash)?.text ?? null;
11899
+ return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
11229
11900
  }
11230
- const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(target13) ?? false);
11901
+ const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(target14) ?? false);
11231
11902
  if (treatAsDirectory) {
11232
11903
  const meshRelative = toAgentsMeshRootRelative(projectRoot, meshCanonicalForShape, keepSlash);
11233
11904
  if (meshRelative !== null) return meshRelative;
@@ -11251,7 +11922,7 @@ var init_link_rebaser_output = __esm({
11251
11922
  });
11252
11923
 
11253
11924
  // src/core/reference/link-rebaser-suffix-strip.ts
11254
- function resolveByDestinationSuffixStrip(token, projectRoot, destinationFile, pathExists) {
11925
+ function resolveByDestinationSuffixStrip(token, projectRoot, destinationFile, pathExists2) {
11255
11926
  const api = pathApi(projectRoot);
11256
11927
  const normalizedToken = normalizeSeparators(token);
11257
11928
  if (!isRootRelativePathToken(normalizedToken)) return null;
@@ -11263,7 +11934,7 @@ function resolveByDestinationSuffixStrip(token, projectRoot, destinationFile, pa
11263
11934
  const suffix = segments.slice(i).join("/");
11264
11935
  const candidate = normalizeForProject(projectRoot, api.join(destDir, suffix));
11265
11936
  if (candidate === destFilePath) continue;
11266
- if (pathExists(candidate)) return candidate;
11937
+ if (pathExists2(candidate)) return candidate;
11267
11938
  }
11268
11939
  return null;
11269
11940
  }
@@ -11580,22 +12251,23 @@ var init_link_rebaser = __esm({
11580
12251
  init_link_token_context();
11581
12252
  }
11582
12253
  });
11583
- function pathVariants(path) {
11584
- const variants = [normalize(path)];
12254
+ function pathVariants(api, path) {
12255
+ const variants = [api.normalize(path)];
11585
12256
  if (!existsSync(path)) return variants;
11586
12257
  try {
11587
12258
  const realPaths = [realpathSync(path), realpathSync.native(path)];
11588
12259
  for (const realPath of realPaths) {
11589
- const normalized = normalize(realPath);
12260
+ const normalized = api.normalize(realPath);
11590
12261
  if (!variants.includes(normalized)) variants.push(normalized);
11591
12262
  }
11592
12263
  } catch {
11593
12264
  }
11594
12265
  return variants;
11595
12266
  }
11596
- async function createImportReferenceNormalizer(target13, projectRoot, scope = "project") {
12267
+ async function createImportReferenceNormalizer(target14, projectRoot, scope = "project") {
12268
+ const api = pathApi(projectRoot);
11597
12269
  const refs = /* @__PURE__ */ new Map();
11598
- const targets = Array.from(/* @__PURE__ */ new Set([target13, ...TARGET_IDS]));
12270
+ const targets = Array.from(/* @__PURE__ */ new Set([target14, ...TARGET_IDS]));
11599
12271
  for (const candidate of targets) {
11600
12272
  const candidateRefs = await buildImportReferenceMap(candidate, projectRoot, scope);
11601
12273
  for (const [targetPath, canonicalPath] of candidateRefs.entries()) {
@@ -11604,17 +12276,17 @@ async function createImportReferenceNormalizer(target13, projectRoot, scope = "p
11604
12276
  }
11605
12277
  const artifactMap = /* @__PURE__ */ new Map();
11606
12278
  for (const [targetPath, canonicalPath] of refs.entries()) {
11607
- const canonicalAbsPath = normalize(join(projectRoot, canonicalPath));
11608
- for (const variant of pathVariants(join(projectRoot, targetPath))) {
12279
+ const canonicalAbsPath = api.normalize(api.join(projectRoot, canonicalPath));
12280
+ for (const variant of pathVariants(api, api.join(projectRoot, targetPath))) {
11609
12281
  artifactMap.set(variant, canonicalAbsPath);
11610
12282
  }
11611
12283
  }
11612
12284
  const canonicalDestAbs = /* @__PURE__ */ new Set();
11613
12285
  for (const canonicalPath of new Set(refs.values())) {
11614
- const abs = normalize(join(projectRoot, canonicalPath));
12286
+ const abs = api.normalize(api.join(projectRoot, canonicalPath));
11615
12287
  canonicalDestAbs.add(abs);
11616
- for (const variant of pathVariants(abs)) {
11617
- canonicalDestAbs.add(normalize(variant));
12288
+ for (const variant of pathVariants(api, abs)) {
12289
+ canonicalDestAbs.add(api.normalize(variant));
11618
12290
  }
11619
12291
  }
11620
12292
  return (content, sourceFile, destinationFile) => rewriteFileLinks({
@@ -11624,7 +12296,7 @@ async function createImportReferenceNormalizer(target13, projectRoot, scope = "p
11624
12296
  destinationFile,
11625
12297
  translatePath: (absolutePath) => artifactMap.get(absolutePath) ?? absolutePath,
11626
12298
  pathExists: (absolutePath) => {
11627
- const normalized = normalize(absolutePath);
12299
+ const normalized = api.normalize(absolutePath);
11628
12300
  return artifactMap.has(absolutePath) || artifactMap.has(normalized) || existsSync(absolutePath) || canonicalDestAbs.has(normalized);
11629
12301
  },
11630
12302
  explicitCurrentDirLinks: false,
@@ -11641,6 +12313,7 @@ async function createImportReferenceNormalizer(target13, projectRoot, scope = "p
11641
12313
  }
11642
12314
  var init_import_rewriter = __esm({
11643
12315
  "src/core/reference/import-rewriter.ts"() {
12316
+ init_path_helpers();
11644
12317
  init_import_map();
11645
12318
  init_link_rebaser();
11646
12319
  init_target_ids();
@@ -11710,10 +12383,8 @@ async function importSettings2(projectRoot, results) {
11710
12383
  }
11711
12384
  const alreadyImportedMcp = results.some((r) => r.feature === "mcp");
11712
12385
  if (!alreadyImportedMcp && settings.mcpServers && typeof settings.mcpServers === "object") {
11713
- const mcpContent = JSON.stringify({ mcpServers: settings.mcpServers }, null, 2);
11714
- const destPath = join(projectRoot, CLAUDE_CANONICAL_MCP);
11715
- await mkdirp(dirname(destPath));
11716
- await writeFileAtomic(destPath, mcpContent);
12386
+ const mcpServers = settings.mcpServers;
12387
+ await writeMcpWithMerge(projectRoot, CLAUDE_CANONICAL_MCP, mcpServers);
11717
12388
  results.push({
11718
12389
  fromTool: "claude-code",
11719
12390
  fromPath: settingsPath,
@@ -11761,6 +12432,7 @@ var init_settings_helpers2 = __esm({
11761
12432
  "src/targets/claude-code/settings-helpers.ts"() {
11762
12433
  init_hook_command();
11763
12434
  init_fs();
12435
+ init_mcp_merge();
11764
12436
  init_constants3();
11765
12437
  }
11766
12438
  });
@@ -11820,7 +12492,7 @@ async function importFromClaudeCode(projectRoot, options = {}) {
11820
12492
  await importSettings2(projectRoot, results);
11821
12493
  return results;
11822
12494
  }
11823
- var init_importer12 = __esm({
12495
+ var init_importer13 = __esm({
11824
12496
  "src/targets/claude-code/importer.ts"() {
11825
12497
  init_import_rewriter();
11826
12498
  init_descriptor_import_runner();
@@ -12063,13 +12735,13 @@ function parseGitlabSource(source) {
12063
12735
  const slash = slug.lastIndexOf("/");
12064
12736
  if (slash < 0) return null;
12065
12737
  const namespace = slug.slice(0, slash).trim();
12066
- const project13 = slug.slice(slash + 1).trim();
12067
- if (!namespace || !project13) return null;
12738
+ const project14 = slug.slice(slash + 1).trim();
12739
+ if (!namespace || !project14) return null;
12068
12740
  return {
12069
12741
  namespace,
12070
- project: project13,
12742
+ project: project14,
12071
12743
  ref,
12072
- cloneUrl: `https://gitlab.com/${namespace}/${project13}.git`
12744
+ cloneUrl: `https://gitlab.com/${namespace}/${project14}.git`
12073
12745
  };
12074
12746
  }
12075
12747
  function parseGitSource(source) {
@@ -12774,6 +13446,21 @@ var TARGET_SIGNATURES = [
12774
13446
  {
12775
13447
  target: "kiro",
12776
13448
  paths: [".kiro", ".kiro/steering", ".kiro/settings/mcp.json"]
13449
+ },
13450
+ {
13451
+ target: "kilo-code",
13452
+ paths: [
13453
+ ".kilo",
13454
+ ".kilo/rules",
13455
+ ".kilo/commands",
13456
+ ".kilo/agents",
13457
+ ".kilo/skills",
13458
+ ".kilocodeignore",
13459
+ ".kilocode",
13460
+ ".kilocodemodes",
13461
+ "kilo.jsonc",
13462
+ "kilo.json"
13463
+ ]
12777
13464
  }
12778
13465
  ];
12779
13466
  async function detectNativeFormat(repoPath) {
@@ -12858,15 +13545,16 @@ var logger = {
12858
13545
  };
12859
13546
 
12860
13547
  // src/canonical/extends/native-extends-importer.ts
12861
- init_importer12();
13548
+ init_importer13();
12862
13549
  init_importer6();
12863
13550
  init_importer5();
12864
13551
  init_importer7();
12865
13552
  init_importer3();
12866
- init_importer11();
13553
+ init_importer12();
12867
13554
  init_importer2();
12868
13555
  init_importer4();
12869
13556
  init_importer8();
13557
+ init_importer10();
12870
13558
  init_importer9();
12871
13559
  var NATIVE_IMPORTERS = {
12872
13560
  "claude-code": importFromClaudeCode,
@@ -12878,7 +13566,8 @@ var NATIVE_IMPORTERS = {
12878
13566
  cline: importFromCline,
12879
13567
  continue: importFromContinue,
12880
13568
  junie: importFromJunie,
12881
- kiro: importFromKiro
13569
+ kiro: importFromKiro,
13570
+ "kilo-code": importFromKiloCode
12882
13571
  };
12883
13572
  async function importNativeToCanonical(repoPath, targetName) {
12884
13573
  const importFn = NATIVE_IMPORTERS[targetName];
@@ -13405,8 +14094,8 @@ function deepMergeObjects(base, overrides2) {
13405
14094
  }
13406
14095
  return result;
13407
14096
  }
13408
- function mergeLocalConfig(project13, local) {
13409
- const merged = { ...project13 };
14097
+ function mergeLocalConfig(project14, local) {
14098
+ const merged = { ...project14 };
13410
14099
  if (Array.isArray(local.targets) && local.targets.length > 0) {
13411
14100
  merged.targets = local.targets;
13412
14101
  }
@@ -13426,7 +14115,7 @@ function mergeLocalConfig(project13, local) {
13426
14115
  );
13427
14116
  }
13428
14117
  if (Array.isArray(local.extends) && local.extends.length > 0) {
13429
- merged.extends = [...project13.extends ?? [], ...local.extends];
14118
+ merged.extends = [...project14.extends ?? [], ...local.extends];
13430
14119
  }
13431
14120
  return merged;
13432
14121
  }