agentsmesh 0.10.0 → 0.11.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/targets.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
+ import { stringify, parse } from 'yaml';
2
3
  import { readFile, readdir, stat, mkdir, lstat, unlink, writeFile, rename, rm, realpath, access } from 'fs/promises';
3
4
  import { basename, join, win32, posix, relative, dirname, extname } from 'path';
4
5
  import { existsSync, realpathSync, constants, statSync } from 'fs';
5
- import { stringify, parse } from 'yaml';
6
6
  import { parse as parse$1 } from 'smol-toml';
7
7
  import { Buffer } from 'buffer';
8
8
 
@@ -11,42 +11,44 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __esm = (fn, res) => function __init() {
12
12
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
13
  };
14
- var __export = (target14, all) => {
14
+ var __export = (target16, all) => {
15
15
  for (var name in all)
16
- __defProp(target14, name, { get: all[name], enumerable: true });
16
+ __defProp(target16, name, { get: all[name], enumerable: true });
17
17
  };
18
18
 
19
19
  // src/config/core/conversions.ts
20
- function usesCommandSkillProjection(target14) {
21
- return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS, target14);
20
+ function usesCommandSkillProjection(target16) {
21
+ return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS, target16);
22
22
  }
23
- function usesAgentSkillProjection(target14) {
24
- return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS, target14);
23
+ function usesAgentSkillProjection(target16) {
24
+ return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS, target16);
25
25
  }
26
26
  function resolveConversionValue(value, scope) {
27
27
  if (value === void 0) return void 0;
28
28
  if (typeof value === "boolean") return value;
29
29
  return value[scope];
30
30
  }
31
- function shouldConvertCommandsToSkills(config, target14, defaultEnabled, scope = "project") {
32
- const raw = config.conversions?.commands_to_skills?.[target14];
31
+ function shouldConvertCommandsToSkills(config, target16, defaultEnabled, scope = "project") {
32
+ const raw = config.conversions?.commands_to_skills?.[target16];
33
33
  const configVal = resolveConversionValue(raw, scope);
34
34
  if (configVal !== void 0) return configVal;
35
- if (usesCommandSkillProjection(target14)) return DEFAULT_COMMANDS_TO_SKILLS[target14];
35
+ if (usesCommandSkillProjection(target16)) return DEFAULT_COMMANDS_TO_SKILLS[target16];
36
36
  return defaultEnabled ?? false;
37
37
  }
38
- function shouldConvertAgentsToSkills(config, target14, defaultEnabled, scope = "project") {
39
- const raw = config.conversions?.agents_to_skills?.[target14];
38
+ function shouldConvertAgentsToSkills(config, target16, defaultEnabled, scope = "project") {
39
+ const raw = config.conversions?.agents_to_skills?.[target16];
40
40
  const configVal = resolveConversionValue(raw, scope);
41
41
  if (configVal !== void 0) return configVal;
42
- if (usesAgentSkillProjection(target14)) return DEFAULT_AGENTS_TO_SKILLS[target14];
42
+ if (usesAgentSkillProjection(target16)) return DEFAULT_AGENTS_TO_SKILLS[target16];
43
43
  return defaultEnabled ?? false;
44
44
  }
45
45
  var DEFAULT_COMMANDS_TO_SKILLS, DEFAULT_AGENTS_TO_SKILLS;
46
46
  var init_conversions = __esm({
47
47
  "src/config/core/conversions.ts"() {
48
48
  DEFAULT_COMMANDS_TO_SKILLS = {
49
- "codex-cli": true
49
+ "codex-cli": true,
50
+ goose: true,
51
+ kiro: true
50
52
  };
51
53
  DEFAULT_AGENTS_TO_SKILLS = {
52
54
  "gemini-cli": false,
@@ -54,7 +56,10 @@ var init_conversions = __esm({
54
56
  cline: true,
55
57
  "codex-cli": false,
56
58
  // native .codex/agents/*.toml per agent-structures
57
- windsurf: true
59
+ windsurf: true,
60
+ goose: true,
61
+ antigravity: true,
62
+ continue: true
58
63
  };
59
64
  }
60
65
  });
@@ -92,12 +97,12 @@ function capabilityLevel(capability) {
92
97
  function canUseScopedSettings(feature) {
93
98
  return settingsBackedFeatures.includes(feature);
94
99
  }
95
- function validateCapabilityImplementations(descriptor14, capabilities2, ctx, pathPrefix) {
100
+ function validateCapabilityImplementations(descriptor16, capabilities4, ctx, pathPrefix) {
96
101
  for (const requirement of generatorRequirements) {
97
- const level = capabilityLevel(capabilities2[requirement.feature]);
102
+ const level = capabilityLevel(capabilities4[requirement.feature]);
98
103
  if (level === "none") continue;
99
- const hasGenerator = typeof descriptor14.generators[requirement.generator] === "function";
100
- const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof descriptor14.emitScopedSettings === "function";
104
+ const hasGenerator = typeof descriptor16.generators[requirement.generator] === "function";
105
+ const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof descriptor16.emitScopedSettings === "function";
101
106
  if (hasGenerator || hasSettingsEmitter) continue;
102
107
  ctx.addIssue({
103
108
  code: "custom",
@@ -212,8 +217,8 @@ function builtinDescriptors() {
212
217
  }
213
218
  return _builtinDescriptors;
214
219
  }
215
- function registerTargetDescriptor(descriptor14) {
216
- const validated = validateDescriptor(descriptor14);
220
+ function registerTargetDescriptor(descriptor16) {
221
+ const validated = validateDescriptor(descriptor16);
217
222
  descriptorRegistry.set(validated.id, validated);
218
223
  }
219
224
  function getDescriptor(name) {
@@ -234,11 +239,11 @@ var init_registry = __esm({
234
239
  // src/targets/catalog/shared-artifact-owner.ts
235
240
  function findSharedArtifactOwnershipConflicts(descriptors) {
236
241
  const owners = [];
237
- for (const descriptor14 of descriptors) {
238
- if (!descriptor14.sharedArtifacts) continue;
239
- for (const [prefix, role] of Object.entries(descriptor14.sharedArtifacts)) {
242
+ for (const descriptor16 of descriptors) {
243
+ if (!descriptor16.sharedArtifacts) continue;
244
+ for (const [prefix, role] of Object.entries(descriptor16.sharedArtifacts)) {
240
245
  if (role !== "owner") continue;
241
- owners.push({ targetId: descriptor14.id, prefix });
246
+ owners.push({ targetId: descriptor16.id, prefix });
242
247
  }
243
248
  }
244
249
  const conflicts = [];
@@ -288,9 +293,11 @@ var init_builtin_target_ids_generated = __esm({
288
293
  "copilot",
289
294
  "cursor",
290
295
  "gemini-cli",
296
+ "goose",
291
297
  "junie",
292
298
  "kilo-code",
293
299
  "kiro",
300
+ "opencode",
294
301
  "roo-code",
295
302
  "windsurf"
296
303
  ];
@@ -305,6 +312,127 @@ var init_target_ids = __esm({
305
312
  TARGET_IDS = BUILTIN_TARGET_IDS;
306
313
  }
307
314
  });
315
+ function parseFrontmatter(content) {
316
+ const open = content.indexOf("---");
317
+ if (open !== 0) {
318
+ return { frontmatter: {}, body: content.trim() };
319
+ }
320
+ const close = content.indexOf("---", 3);
321
+ if (close === -1) {
322
+ return { frontmatter: {}, body: content.trim() };
323
+ }
324
+ const yamlStr = content.slice(3, close).trim();
325
+ const body = content.slice(close + 3).trim();
326
+ const frontmatter = yamlStr === "" ? {} : parse(yamlStr) ?? {};
327
+ return { frontmatter, body };
328
+ }
329
+ function serializeFrontmatter(frontmatter, body) {
330
+ const keys = Object.keys(frontmatter);
331
+ if (keys.length === 0) return body;
332
+ const yamlStr = stringify(frontmatter, { lineWidth: 0 }).trimEnd();
333
+ return `---
334
+ ${yamlStr}
335
+ ---
336
+
337
+ ${body}`;
338
+ }
339
+ var init_markdown = __esm({
340
+ "src/utils/text/markdown.ts"() {
341
+ }
342
+ });
343
+
344
+ // src/targets/projection/projected-agent-skill.ts
345
+ function toStringArray(value) {
346
+ if (Array.isArray(value)) {
347
+ return value.filter((entry) => typeof entry === "string" && entry.length > 0);
348
+ }
349
+ if (typeof value === "string" && value.length > 0) {
350
+ return value.split(",").map((entry) => entry.trim()).filter(Boolean);
351
+ }
352
+ return [];
353
+ }
354
+ function toHooks(value) {
355
+ if (!value || typeof value !== "object" || Array.isArray(value)) return {};
356
+ const hooks = {};
357
+ for (const [event, entries] of Object.entries(value)) {
358
+ if (!Array.isArray(entries)) continue;
359
+ hooks[event] = entries.filter(
360
+ (entry) => entry !== null && typeof entry === "object" && typeof entry.matcher === "string" && typeof entry.command === "string"
361
+ );
362
+ }
363
+ return hooks;
364
+ }
365
+ function projectedAgentSkillDirName(name) {
366
+ return `${PROJECTED_AGENT_SKILL_PREFIX}${name}`;
367
+ }
368
+ function serializeProjectedAgentSkill(agent) {
369
+ const frontmatter = {
370
+ name: projectedAgentSkillDirName(agent.name),
371
+ description: agent.description || void 0,
372
+ "x-agentsmesh-kind": "agent",
373
+ "x-agentsmesh-name": agent.name,
374
+ "x-agentsmesh-tools": agent.tools.length > 0 ? agent.tools : void 0,
375
+ "x-agentsmesh-disallowed-tools": agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
376
+ "x-agentsmesh-model": agent.model || void 0,
377
+ "x-agentsmesh-permission-mode": agent.permissionMode || void 0,
378
+ "x-agentsmesh-max-turns": agent.maxTurns > 0 ? agent.maxTurns : void 0,
379
+ "x-agentsmesh-mcp-servers": agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
380
+ "x-agentsmesh-hooks": Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
381
+ "x-agentsmesh-skills": agent.skills.length > 0 ? agent.skills : void 0,
382
+ "x-agentsmesh-memory": agent.memory || void 0
383
+ };
384
+ Object.keys(frontmatter).forEach((key) => {
385
+ if (frontmatter[key] === void 0) delete frontmatter[key];
386
+ });
387
+ return serializeFrontmatter(frontmatter, agent.body.trim() || "");
388
+ }
389
+ function parseProjectedAgentSkillFrontmatter(frontmatter, dirName) {
390
+ if (frontmatter["x-agentsmesh-kind"] !== "agent") return null;
391
+ const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
392
+ const derivedName = dirName.startsWith(PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(PROJECTED_AGENT_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(LEGACY_PROJECTED_AGENT_SKILL_PREFIX.length) : "";
393
+ const name = (metadataName || derivedName).trim();
394
+ if (!name) return null;
395
+ return {
396
+ name,
397
+ description: typeof frontmatter.description === "string" ? frontmatter.description : "",
398
+ tools: toStringArray(frontmatter["x-agentsmesh-tools"]),
399
+ disallowedTools: toStringArray(frontmatter["x-agentsmesh-disallowed-tools"]),
400
+ model: typeof frontmatter["x-agentsmesh-model"] === "string" ? frontmatter["x-agentsmesh-model"] : "",
401
+ permissionMode: typeof frontmatter["x-agentsmesh-permission-mode"] === "string" ? frontmatter["x-agentsmesh-permission-mode"] : "",
402
+ maxTurns: typeof frontmatter["x-agentsmesh-max-turns"] === "number" ? frontmatter["x-agentsmesh-max-turns"] : Number(frontmatter["x-agentsmesh-max-turns"] ?? 0),
403
+ mcpServers: toStringArray(frontmatter["x-agentsmesh-mcp-servers"]),
404
+ hooks: toHooks(frontmatter["x-agentsmesh-hooks"]),
405
+ skills: toStringArray(frontmatter["x-agentsmesh-skills"]),
406
+ memory: typeof frontmatter["x-agentsmesh-memory"] === "string" ? frontmatter["x-agentsmesh-memory"] : ""
407
+ };
408
+ }
409
+ function serializeImportedAgent(agent, body) {
410
+ const frontmatter = {
411
+ name: agent.name,
412
+ description: agent.description,
413
+ tools: agent.tools,
414
+ disallowedTools: agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
415
+ model: agent.model || void 0,
416
+ permissionMode: agent.permissionMode || void 0,
417
+ maxTurns: agent.maxTurns > 0 ? agent.maxTurns : void 0,
418
+ mcpServers: agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
419
+ hooks: Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
420
+ skills: agent.skills.length > 0 ? agent.skills : void 0,
421
+ memory: agent.memory || void 0
422
+ };
423
+ Object.keys(frontmatter).forEach((key) => {
424
+ if (frontmatter[key] === void 0) delete frontmatter[key];
425
+ });
426
+ return serializeFrontmatter(frontmatter, body.trim() || "");
427
+ }
428
+ var PROJECTED_AGENT_SKILL_PREFIX, LEGACY_PROJECTED_AGENT_SKILL_PREFIX;
429
+ var init_projected_agent_skill = __esm({
430
+ "src/targets/projection/projected-agent-skill.ts"() {
431
+ init_markdown();
432
+ PROJECTED_AGENT_SKILL_PREFIX = "am-agent-";
433
+ LEGACY_PROJECTED_AGENT_SKILL_PREFIX = "ab-agent-";
434
+ }
435
+ });
308
436
 
309
437
  // src/core/errors.ts
310
438
  var AgentsMeshError, FileSystemError;
@@ -500,34 +628,6 @@ var init_fs = __esm({
500
628
  ]);
501
629
  }
502
630
  });
503
- function parseFrontmatter(content) {
504
- const open = content.indexOf("---");
505
- if (open !== 0) {
506
- return { frontmatter: {}, body: content.trim() };
507
- }
508
- const close = content.indexOf("---", 3);
509
- if (close === -1) {
510
- return { frontmatter: {}, body: content.trim() };
511
- }
512
- const yamlStr = content.slice(3, close).trim();
513
- const body = content.slice(close + 3).trim();
514
- const frontmatter = yamlStr === "" ? {} : parse(yamlStr) ?? {};
515
- return { frontmatter, body };
516
- }
517
- function serializeFrontmatter(frontmatter, body) {
518
- const keys = Object.keys(frontmatter);
519
- if (keys.length === 0) return body;
520
- const yamlStr = stringify(frontmatter, { lineWidth: 0 }).trimEnd();
521
- return `---
522
- ${yamlStr}
523
- ---
524
-
525
- ${body}`;
526
- }
527
- var init_markdown = __esm({
528
- "src/utils/text/markdown.ts"() {
529
- }
530
- });
531
631
  function escapeRegExp(value) {
532
632
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
533
633
  }
@@ -575,7 +675,7 @@ function appendEmbeddedRulesBlock(content, rules) {
575
675
 
576
676
  ${block}` : block;
577
677
  }
578
- function toStringArray(value) {
678
+ function toStringArray2(value) {
579
679
  return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
580
680
  }
581
681
  function parseMarker(value) {
@@ -587,8 +687,8 @@ function parseMarker(value) {
587
687
  return {
588
688
  source: record.source,
589
689
  description: typeof record.description === "string" ? record.description : "",
590
- globs: toStringArray(record.globs),
591
- targets: toStringArray(record.targets)
690
+ globs: toStringArray2(record.globs),
691
+ targets: toStringArray2(record.targets)
592
692
  };
593
693
  } catch {
594
694
  return null;
@@ -705,7 +805,7 @@ ${ROOT_CONTRACT_END}`;
705
805
  ];
706
806
  }
707
807
  });
708
- function toStringArray2(value) {
808
+ function toStringArray3(value) {
709
809
  if (Array.isArray(value)) {
710
810
  return value.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean);
711
811
  }
@@ -750,7 +850,7 @@ async function serializeImportedRuleWithFallback(destinationPath, importedFrontm
750
850
  description: typeof mergedFrontmatter.description === "string" ? mergedFrontmatter.description : ""
751
851
  };
752
852
  if (canonicalFrontmatter.root === false) {
753
- canonicalFrontmatter.globs = toStringArray2(mergedFrontmatter.globs);
853
+ canonicalFrontmatter.globs = toStringArray3(mergedFrontmatter.globs);
754
854
  }
755
855
  for (const [key, value] of Object.entries(mergedFrontmatter)) {
756
856
  if (key === "root" || key === "description" || key === "globs" || value === void 0) continue;
@@ -768,8 +868,8 @@ var init_import_metadata_core = __esm({
768
868
  async function serializeImportedCommandWithFallback(destinationPath, imported, body) {
769
869
  const existingFrontmatter = await readExistingFrontmatter(destinationPath);
770
870
  const existingAllowedTools = (() => {
771
- const fromCamel = toStringArray2(existingFrontmatter.allowedTools);
772
- return fromCamel.length > 0 ? fromCamel : toStringArray2(existingFrontmatter["allowed-tools"]);
871
+ const fromCamel = toStringArray3(existingFrontmatter.allowedTools);
872
+ return fromCamel.length > 0 ? fromCamel : toStringArray3(existingFrontmatter["allowed-tools"]);
773
873
  })();
774
874
  const description = imported.hasDescription ? imported.description ?? "" : typeof existingFrontmatter.description === "string" ? existingFrontmatter.description : "";
775
875
  const allowedTools = imported.hasAllowedTools ? imported.allowedTools ?? [] : existingAllowedTools;
@@ -790,16 +890,16 @@ async function serializeImportedSkillWithFallback(destinationPath, importedFront
790
890
  }
791
891
  async function serializeImportedAgentWithFallback(destinationPath, importedFrontmatter, body) {
792
892
  const existingFrontmatter = await readExistingFrontmatter(destinationPath);
793
- const tools = Object.prototype.hasOwnProperty.call(importedFrontmatter, "tools") ? toStringArray2(importedFrontmatter.tools) : (() => {
794
- const existingTools = toStringArray2(existingFrontmatter.tools);
893
+ const tools = Object.prototype.hasOwnProperty.call(importedFrontmatter, "tools") ? toStringArray3(importedFrontmatter.tools) : (() => {
894
+ const existingTools = toStringArray3(existingFrontmatter.tools);
795
895
  return existingTools.length > 0 ? existingTools : [];
796
896
  })();
797
897
  const disallowedTools = Object.prototype.hasOwnProperty.call(
798
898
  importedFrontmatter,
799
899
  "disallowedTools"
800
- ) ? toStringArray2(importedFrontmatter.disallowedTools) : Object.prototype.hasOwnProperty.call(importedFrontmatter, "disallowed-tools") ? toStringArray2(importedFrontmatter["disallowed-tools"]) : toStringArray2(existingFrontmatter.disallowedTools);
801
- const mcpServers = Object.prototype.hasOwnProperty.call(importedFrontmatter, "mcpServers") ? toStringArray2(importedFrontmatter.mcpServers) : Object.prototype.hasOwnProperty.call(importedFrontmatter, "mcp-servers") ? toStringArray2(importedFrontmatter["mcp-servers"]) : toStringArray2(existingFrontmatter.mcpServers);
802
- const skills = Object.prototype.hasOwnProperty.call(importedFrontmatter, "skills") ? toStringArray2(importedFrontmatter.skills) : toStringArray2(existingFrontmatter.skills);
900
+ ) ? toStringArray3(importedFrontmatter.disallowedTools) : Object.prototype.hasOwnProperty.call(importedFrontmatter, "disallowed-tools") ? toStringArray3(importedFrontmatter["disallowed-tools"]) : toStringArray3(existingFrontmatter.disallowedTools);
901
+ const mcpServers = Object.prototype.hasOwnProperty.call(importedFrontmatter, "mcpServers") ? toStringArray3(importedFrontmatter.mcpServers) : Object.prototype.hasOwnProperty.call(importedFrontmatter, "mcp-servers") ? toStringArray3(importedFrontmatter["mcp-servers"]) : toStringArray3(existingFrontmatter.mcpServers);
902
+ const skills = Object.prototype.hasOwnProperty.call(importedFrontmatter, "skills") ? toStringArray3(importedFrontmatter.skills) : toStringArray3(existingFrontmatter.skills);
803
903
  const maxTurnsRaw = importedFrontmatter.maxTurns ?? importedFrontmatter["max-turns"] ?? existingFrontmatter.maxTurns;
804
904
  const maxTurns = typeof maxTurnsRaw === "number" ? maxTurnsRaw : Number(maxTurnsRaw ?? 0);
805
905
  const hooks = readHooks(importedFrontmatter) ?? readHooks(existingFrontmatter);
@@ -835,6 +935,77 @@ var init_import_metadata = __esm({
835
935
  init_import_metadata_serialize();
836
936
  }
837
937
  });
938
+
939
+ // src/targets/codex-cli/command-skill.ts
940
+ function toStringArray4(value) {
941
+ if (Array.isArray(value)) {
942
+ return value.filter((entry) => typeof entry === "string" && entry.length > 0);
943
+ }
944
+ if (typeof value === "string" && value.length > 0) {
945
+ return value.split(",").map((entry) => entry.trim()).filter(Boolean);
946
+ }
947
+ return [];
948
+ }
949
+ function commandSkillDirName(name) {
950
+ return `${CODEX_COMMAND_SKILL_PREFIX}${name}`;
951
+ }
952
+ function serializeCommandSkill(command) {
953
+ const frontmatter = {
954
+ name: commandSkillDirName(command.name),
955
+ description: command.description || void 0,
956
+ "x-agentsmesh-kind": "command",
957
+ "x-agentsmesh-name": command.name,
958
+ "x-agentsmesh-allowed-tools": command.allowedTools.length > 0 ? command.allowedTools : void 0
959
+ };
960
+ if (frontmatter.description === void 0) delete frontmatter.description;
961
+ if (frontmatter["x-agentsmesh-allowed-tools"] === void 0) {
962
+ delete frontmatter["x-agentsmesh-allowed-tools"];
963
+ }
964
+ return serializeFrontmatter(frontmatter, command.body.trim() || "");
965
+ }
966
+ function parseCommandSkillFrontmatter(frontmatter, dirName) {
967
+ if (frontmatter["x-agentsmesh-kind"] !== "command") return null;
968
+ const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
969
+ const derivedName = dirName.startsWith(CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(CODEX_COMMAND_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(LEGACY_CODEX_COMMAND_SKILL_PREFIX.length) : "";
970
+ const name = (metadataName || derivedName).trim();
971
+ if (!name) return null;
972
+ return {
973
+ name,
974
+ description: typeof frontmatter.description === "string" ? frontmatter.description : "",
975
+ allowedTools: toStringArray4(frontmatter["x-agentsmesh-allowed-tools"])
976
+ };
977
+ }
978
+ function serializeImportedCommand(command, body) {
979
+ return serializeFrontmatter(
980
+ {
981
+ description: command.description,
982
+ "allowed-tools": command.allowedTools
983
+ },
984
+ body.trim() || ""
985
+ );
986
+ }
987
+ var CODEX_COMMAND_SKILL_PREFIX, LEGACY_CODEX_COMMAND_SKILL_PREFIX;
988
+ var init_command_skill = __esm({
989
+ "src/targets/codex-cli/command-skill.ts"() {
990
+ init_markdown();
991
+ CODEX_COMMAND_SKILL_PREFIX = "am-command-";
992
+ LEGACY_CODEX_COMMAND_SKILL_PREFIX = "ab-command-";
993
+ }
994
+ });
995
+ function shouldImportScopedAgentsRule(relDir) {
996
+ const segments = relDir.split("/").filter(Boolean);
997
+ if (segments.length === 0) return false;
998
+ if (segments.some((segment) => segment.startsWith("."))) return false;
999
+ const relPath = segments.join("/");
1000
+ return !relPath.startsWith("tests/e2e/fixtures/");
1001
+ }
1002
+ async function removePathIfExists(path) {
1003
+ await rm(path, { recursive: true, force: true });
1004
+ }
1005
+ var init_scoped_agents_import = __esm({
1006
+ "src/targets/import/scoped-agents-import.ts"() {
1007
+ }
1008
+ });
838
1009
  function generateEmbeddedSkills(canonical, skillsDir) {
839
1010
  const outputs = [];
840
1011
  for (const skill of canonical.skills) {
@@ -874,6 +1045,42 @@ async function importEmbeddedSkills(projectRoot, skillsDir, fromTool, results, n
874
1045
  const { frontmatter, body } = parseFrontmatter(
875
1046
  normalize(sourceSkillContent, sourceSkillFile, destinationSkillFile)
876
1047
  );
1048
+ const projectedCommand = parseCommandSkillFrontmatter(frontmatter, entry.name);
1049
+ if (projectedCommand) {
1050
+ await removePathIfExists(join(projectRoot, AB_SKILLS, entry.name));
1051
+ const destDir = join(projectRoot, AB_COMMANDS);
1052
+ await mkdirp(destDir);
1053
+ const commandPath = join(destDir, `${projectedCommand.name}.md`);
1054
+ await writeFileAtomic(
1055
+ commandPath,
1056
+ serializeImportedCommand(projectedCommand, normalize(body, sourceSkillFile, commandPath))
1057
+ );
1058
+ results.push({
1059
+ fromTool,
1060
+ fromPath: sourceSkillFile,
1061
+ toPath: `${AB_COMMANDS}/${projectedCommand.name}.md`,
1062
+ feature: "commands"
1063
+ });
1064
+ continue;
1065
+ }
1066
+ const projectedAgent = parseProjectedAgentSkillFrontmatter(frontmatter, entry.name);
1067
+ if (projectedAgent) {
1068
+ await removePathIfExists(join(projectRoot, AB_SKILLS, entry.name));
1069
+ const destDir = join(projectRoot, AB_AGENTS);
1070
+ await mkdirp(destDir);
1071
+ const agentPath = join(destDir, `${projectedAgent.name}.md`);
1072
+ await writeFileAtomic(
1073
+ agentPath,
1074
+ serializeImportedAgent(projectedAgent, normalize(body, sourceSkillFile, agentPath))
1075
+ );
1076
+ results.push({
1077
+ fromTool,
1078
+ fromPath: sourceSkillFile,
1079
+ toPath: `${AB_AGENTS}/${projectedAgent.name}.md`,
1080
+ feature: "agents"
1081
+ });
1082
+ continue;
1083
+ }
877
1084
  const output = await serializeImportedSkillWithFallback(
878
1085
  destinationSkillFile,
879
1086
  { ...frontmatter, name: entry.name },
@@ -905,13 +1112,18 @@ async function importEmbeddedSkills(projectRoot, skillsDir, fromTool, results, n
905
1112
  }
906
1113
  }
907
1114
  }
908
- var AB_SKILLS;
1115
+ var AB_SKILLS, AB_COMMANDS, AB_AGENTS;
909
1116
  var init_embedded_skill = __esm({
910
1117
  "src/targets/import/embedded-skill.ts"() {
911
1118
  init_fs();
912
1119
  init_markdown();
913
1120
  init_import_metadata();
1121
+ init_projected_agent_skill();
1122
+ init_command_skill();
1123
+ init_scoped_agents_import();
914
1124
  AB_SKILLS = ".agentsmesh/skills";
1125
+ AB_COMMANDS = ".agentsmesh/commands";
1126
+ AB_AGENTS = ".agentsmesh/agents";
915
1127
  }
916
1128
  });
917
1129
 
@@ -979,6 +1191,12 @@ function generateMcp(canonical) {
979
1191
  }
980
1192
  ];
981
1193
  }
1194
+ function generateAgents(canonical) {
1195
+ return canonical.agents.map((agent) => ({
1196
+ path: `${ANTIGRAVITY_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
1197
+ content: serializeProjectedAgentSkill(agent)
1198
+ }));
1199
+ }
982
1200
  function renderAntigravityGlobalInstructions(canonical) {
983
1201
  const root = canonical.rules.find((rule) => rule.root);
984
1202
  const nonRootRules = canonical.rules.filter((rule) => {
@@ -991,6 +1209,7 @@ var init_generator = __esm({
991
1209
  "src/targets/antigravity/generator.ts"() {
992
1210
  init_embedded_skill();
993
1211
  init_managed_blocks();
1212
+ init_projected_agent_skill();
994
1213
  init_constants();
995
1214
  }
996
1215
  });
@@ -1033,9 +1252,9 @@ var init_path_helpers = __esm({
1033
1252
  });
1034
1253
 
1035
1254
  // src/core/reference/import-map.ts
1036
- async function buildImportReferenceMap(target14, projectRoot, scope = "project") {
1255
+ async function buildImportReferenceMap(target16, projectRoot, scope = "project") {
1037
1256
  const refs = /* @__PURE__ */ new Map();
1038
- const def = getDescriptor(target14);
1257
+ const def = getDescriptor(target16);
1039
1258
  if (def) {
1040
1259
  await def.buildImportPaths(refs, projectRoot, scope);
1041
1260
  }
@@ -1048,12 +1267,12 @@ var init_import_map = __esm({
1048
1267
  });
1049
1268
 
1050
1269
  // src/core/reference/link-format-registry.ts
1051
- function topLevelDotfilePrefixes(descriptor14) {
1052
- const layouts = [descriptor14.project, descriptor14.globalSupport?.layout].filter(
1270
+ function topLevelDotfilePrefixes(descriptor16) {
1271
+ const layouts = [descriptor16.project, descriptor16.globalSupport?.layout].filter(
1053
1272
  (l) => l !== void 0
1054
1273
  );
1055
1274
  const candidates = [
1056
- ...descriptor14.detectionPaths,
1275
+ ...descriptor16.detectionPaths,
1057
1276
  ...layouts.flatMap((l) => l.managedOutputs?.dirs ?? []),
1058
1277
  ...layouts.flatMap((l) => l.managedOutputs?.files ?? [])
1059
1278
  ];
@@ -1066,8 +1285,8 @@ function topLevelDotfilePrefixes(descriptor14) {
1066
1285
  }
1067
1286
  function buildDefaultRootRelativePrefixes() {
1068
1287
  const set = /* @__PURE__ */ new Set([".agentsmesh/"]);
1069
- for (const descriptor14 of BUILTIN_TARGETS) {
1070
- for (const prefix of topLevelDotfilePrefixes(descriptor14)) set.add(prefix);
1288
+ for (const descriptor16 of BUILTIN_TARGETS) {
1289
+ for (const prefix of topLevelDotfilePrefixes(descriptor16)) set.add(prefix);
1071
1290
  }
1072
1291
  return Array.from(set);
1073
1292
  }
@@ -1300,21 +1519,21 @@ function formatLinkPathForDestinationLegacy(projectRoot, destinationFile, absolu
1300
1519
  const api = pathApi(projectRoot);
1301
1520
  const root = normalizeForProject(projectRoot, projectRoot);
1302
1521
  const destFile = normalizeForProject(projectRoot, destinationFile);
1303
- const target14 = normalizeForProject(projectRoot, absoluteTargetPath);
1304
- if (!isUnderProjectRoot(projectRoot, target14)) {
1305
- return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
1522
+ const target16 = normalizeForProject(projectRoot, absoluteTargetPath);
1523
+ if (!isUnderProjectRoot(projectRoot, target16)) {
1524
+ return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
1306
1525
  }
1307
1526
  const destDir = normalizeForProject(projectRoot, api.dirname(destFile));
1308
1527
  if (!isUnderProjectRoot(projectRoot, destDir) && destDir !== root) {
1309
- return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
1528
+ return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
1310
1529
  }
1311
- let rel2 = api.relative(destDir, target14).replace(/\\/g, "/");
1530
+ let rel2 = api.relative(destDir, target16).replace(/\\/g, "/");
1312
1531
  if (api.isAbsolute(rel2) || WINDOWS_ABSOLUTE_PATH.test(rel2)) {
1313
- return toProjectRootRelative(projectRoot, target14, keepSlash);
1532
+ return toProjectRootRelative(projectRoot, target16, keepSlash);
1314
1533
  }
1315
1534
  const joined = normalizeForProject(projectRoot, api.join(destDir, rel2));
1316
1535
  if (!isUnderProjectRoot(projectRoot, joined)) {
1317
- return toProjectRootRelative(projectRoot, target14, keepSlash);
1536
+ return toProjectRootRelative(projectRoot, target16, keepSlash);
1318
1537
  }
1319
1538
  if (rel2 === "" || rel2 === ".") {
1320
1539
  rel2 = ".";
@@ -1333,11 +1552,11 @@ var init_link_rebaser_formatting = __esm({
1333
1552
  // src/core/reference/link-rebaser-output.ts
1334
1553
  function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTargetPath, keepSlash, options = {}) {
1335
1554
  const scope = options.scope ?? "project";
1336
- const target14 = normalizeForProject(projectRoot, absoluteTargetPath);
1337
- if (isReadingContextOptions(options) && isUnderAgentsMesh(projectRoot, destinationFile) && isUnderAgentsMesh(projectRoot, target14)) {
1555
+ const target16 = normalizeForProject(projectRoot, absoluteTargetPath);
1556
+ if (isReadingContextOptions(options) && isUnderAgentsMesh(projectRoot, destinationFile) && isUnderAgentsMesh(projectRoot, target16)) {
1338
1557
  const api = pathApi(projectRoot);
1339
1558
  const root = normalizeForProject(projectRoot, projectRoot);
1340
- const rel2 = api.relative(root, target14).replace(/\\/g, "/");
1559
+ const rel2 = api.relative(root, target16).replace(/\\/g, "/");
1341
1560
  if (!rel2.startsWith("..") && rel2.length > 0) {
1342
1561
  return keepSlash && !rel2.endsWith("/") ? `${rel2}/` : rel2;
1343
1562
  }
@@ -1352,10 +1571,10 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
1352
1571
  );
1353
1572
  }
1354
1573
  if (scope === "global" && !isUnderAgentsMesh(projectRoot, destinationFile)) {
1355
- return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
1574
+ return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
1356
1575
  }
1357
1576
  const meshCanonicalForShape = (() => {
1358
- if (isUnderAgentsMesh(projectRoot, target14)) return target14;
1577
+ if (isUnderAgentsMesh(projectRoot, target16)) return target16;
1359
1578
  const logical = options.logicalMeshSourceAbsolute;
1360
1579
  if (logical && isUnderAgentsMesh(projectRoot, normalizeForProject(projectRoot, logical))) {
1361
1580
  return normalizeForProject(projectRoot, logical);
@@ -1363,9 +1582,9 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
1363
1582
  return null;
1364
1583
  })();
1365
1584
  if (!meshCanonicalForShape) {
1366
- return toProjectRootReference(projectRoot, target14, keepSlash)?.text ?? null;
1585
+ return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
1367
1586
  }
1368
- const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(target14) ?? false);
1587
+ const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(target16) ?? false);
1369
1588
  if (treatAsDirectory) {
1370
1589
  const meshRelative = toAgentsMeshRootRelative(projectRoot, meshCanonicalForShape, keepSlash);
1371
1590
  if (meshRelative !== null) return meshRelative;
@@ -1731,10 +1950,10 @@ function pathVariants(api, path) {
1731
1950
  }
1732
1951
  return variants;
1733
1952
  }
1734
- async function createImportReferenceNormalizer(target14, projectRoot, scope = "project") {
1953
+ async function createImportReferenceNormalizer(target16, projectRoot, scope = "project") {
1735
1954
  const api = pathApi(projectRoot);
1736
1955
  const refs = /* @__PURE__ */ new Map();
1737
- const targets = Array.from(/* @__PURE__ */ new Set([target14, ...TARGET_IDS]));
1956
+ const targets = Array.from(/* @__PURE__ */ new Set([target16, ...TARGET_IDS]));
1738
1957
  for (const candidate of targets) {
1739
1958
  const candidateRefs = await buildImportReferenceMap(candidate, projectRoot, scope);
1740
1959
  for (const [targetPath, canonicalPath] of candidateRefs.entries()) {
@@ -1833,7 +2052,7 @@ function toToolsArray(v) {
1833
2052
  }
1834
2053
  return [];
1835
2054
  }
1836
- function toStringArray3(value) {
2055
+ function toStringArray5(value) {
1837
2056
  return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
1838
2057
  }
1839
2058
  function toStringRecord(value) {
@@ -1923,7 +2142,7 @@ function commandMapper(spec) {
1923
2142
  hasDescription: true,
1924
2143
  description: pickString(remapped.description),
1925
2144
  hasAllowedTools: true,
1926
- allowedTools: toStringArray3(remapped["allowed-tools"])
2145
+ allowedTools: toStringArray5(remapped["allowed-tools"])
1927
2146
  },
1928
2147
  body
1929
2148
  );
@@ -2102,7 +2321,7 @@ function parseMcpJson(content) {
2102
2321
  out[name] = {
2103
2322
  type: typeof server.type === "string" ? server.type : "stdio",
2104
2323
  command: server.command,
2105
- args: toStringArray3(server.args),
2324
+ args: toStringArray5(server.args),
2106
2325
  env: toStringRecord(server.env),
2107
2326
  description
2108
2327
  };
@@ -2167,14 +2386,14 @@ function specsForFeature(importer, feature) {
2167
2386
  if (Array.isArray(value)) return value;
2168
2387
  return [value];
2169
2388
  }
2170
- async function runDescriptorImport(descriptor14, projectRoot, scope, options) {
2171
- const importer = descriptor14.importer;
2389
+ async function runDescriptorImport(descriptor16, projectRoot, scope, options) {
2390
+ const importer = descriptor16.importer;
2172
2391
  if (!importer) return [];
2173
- const normalize = options?.normalize ?? await createImportReferenceNormalizer(descriptor14.id, projectRoot, scope);
2392
+ const normalize = options?.normalize ?? await createImportReferenceNormalizer(descriptor16.id, projectRoot, scope);
2174
2393
  const results = [];
2175
2394
  for (const feature of IMPORT_FEATURE_ORDER) {
2176
2395
  for (const spec of specsForFeature(importer, feature)) {
2177
- results.push(...await runSpec(spec, scope, projectRoot, descriptor14.id, normalize));
2396
+ results.push(...await runSpec(spec, scope, projectRoot, descriptor16.id, normalize));
2178
2397
  }
2179
2398
  }
2180
2399
  return results;
@@ -2488,156 +2707,6 @@ var init_linter = __esm({
2488
2707
  init_constants();
2489
2708
  }
2490
2709
  });
2491
-
2492
- // src/targets/codex-cli/command-skill.ts
2493
- function toStringArray4(value) {
2494
- if (Array.isArray(value)) {
2495
- return value.filter((entry) => typeof entry === "string" && entry.length > 0);
2496
- }
2497
- if (typeof value === "string" && value.length > 0) {
2498
- return value.split(",").map((entry) => entry.trim()).filter(Boolean);
2499
- }
2500
- return [];
2501
- }
2502
- function commandSkillDirName(name) {
2503
- return `${CODEX_COMMAND_SKILL_PREFIX}${name}`;
2504
- }
2505
- function serializeCommandSkill(command) {
2506
- const frontmatter = {
2507
- name: commandSkillDirName(command.name),
2508
- description: command.description || void 0,
2509
- "x-agentsmesh-kind": "command",
2510
- "x-agentsmesh-name": command.name,
2511
- "x-agentsmesh-allowed-tools": command.allowedTools.length > 0 ? command.allowedTools : void 0
2512
- };
2513
- if (frontmatter.description === void 0) delete frontmatter.description;
2514
- if (frontmatter["x-agentsmesh-allowed-tools"] === void 0) {
2515
- delete frontmatter["x-agentsmesh-allowed-tools"];
2516
- }
2517
- return serializeFrontmatter(frontmatter, command.body.trim() || "");
2518
- }
2519
- function parseCommandSkillFrontmatter(frontmatter, dirName) {
2520
- if (frontmatter["x-agentsmesh-kind"] !== "command") return null;
2521
- const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
2522
- const derivedName = dirName.startsWith(CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(CODEX_COMMAND_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(LEGACY_CODEX_COMMAND_SKILL_PREFIX.length) : "";
2523
- const name = (metadataName || derivedName).trim();
2524
- if (!name) return null;
2525
- return {
2526
- name,
2527
- description: typeof frontmatter.description === "string" ? frontmatter.description : "",
2528
- allowedTools: toStringArray4(frontmatter["x-agentsmesh-allowed-tools"])
2529
- };
2530
- }
2531
- function serializeImportedCommand(command, body) {
2532
- return serializeFrontmatter(
2533
- {
2534
- description: command.description,
2535
- "allowed-tools": command.allowedTools
2536
- },
2537
- body.trim() || ""
2538
- );
2539
- }
2540
- var CODEX_COMMAND_SKILL_PREFIX, LEGACY_CODEX_COMMAND_SKILL_PREFIX;
2541
- var init_command_skill = __esm({
2542
- "src/targets/codex-cli/command-skill.ts"() {
2543
- init_markdown();
2544
- CODEX_COMMAND_SKILL_PREFIX = "am-command-";
2545
- LEGACY_CODEX_COMMAND_SKILL_PREFIX = "ab-command-";
2546
- }
2547
- });
2548
-
2549
- // src/targets/projection/projected-agent-skill.ts
2550
- function toStringArray5(value) {
2551
- if (Array.isArray(value)) {
2552
- return value.filter((entry) => typeof entry === "string" && entry.length > 0);
2553
- }
2554
- if (typeof value === "string" && value.length > 0) {
2555
- return value.split(",").map((entry) => entry.trim()).filter(Boolean);
2556
- }
2557
- return [];
2558
- }
2559
- function toHooks(value) {
2560
- if (!value || typeof value !== "object" || Array.isArray(value)) return {};
2561
- const hooks = {};
2562
- for (const [event, entries] of Object.entries(value)) {
2563
- if (!Array.isArray(entries)) continue;
2564
- hooks[event] = entries.filter(
2565
- (entry) => entry !== null && typeof entry === "object" && typeof entry.matcher === "string" && typeof entry.command === "string"
2566
- );
2567
- }
2568
- return hooks;
2569
- }
2570
- function projectedAgentSkillDirName(name) {
2571
- return `${PROJECTED_AGENT_SKILL_PREFIX}${name}`;
2572
- }
2573
- function serializeProjectedAgentSkill(agent) {
2574
- const frontmatter = {
2575
- name: projectedAgentSkillDirName(agent.name),
2576
- description: agent.description || void 0,
2577
- "x-agentsmesh-kind": "agent",
2578
- "x-agentsmesh-name": agent.name,
2579
- "x-agentsmesh-tools": agent.tools.length > 0 ? agent.tools : void 0,
2580
- "x-agentsmesh-disallowed-tools": agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
2581
- "x-agentsmesh-model": agent.model || void 0,
2582
- "x-agentsmesh-permission-mode": agent.permissionMode || void 0,
2583
- "x-agentsmesh-max-turns": agent.maxTurns > 0 ? agent.maxTurns : void 0,
2584
- "x-agentsmesh-mcp-servers": agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
2585
- "x-agentsmesh-hooks": Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
2586
- "x-agentsmesh-skills": agent.skills.length > 0 ? agent.skills : void 0,
2587
- "x-agentsmesh-memory": agent.memory || void 0
2588
- };
2589
- Object.keys(frontmatter).forEach((key) => {
2590
- if (frontmatter[key] === void 0) delete frontmatter[key];
2591
- });
2592
- return serializeFrontmatter(frontmatter, agent.body.trim() || "");
2593
- }
2594
- function parseProjectedAgentSkillFrontmatter(frontmatter, dirName) {
2595
- if (frontmatter["x-agentsmesh-kind"] !== "agent") return null;
2596
- const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
2597
- const derivedName = dirName.startsWith(PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(PROJECTED_AGENT_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(LEGACY_PROJECTED_AGENT_SKILL_PREFIX.length) : "";
2598
- const name = (metadataName || derivedName).trim();
2599
- if (!name) return null;
2600
- return {
2601
- name,
2602
- description: typeof frontmatter.description === "string" ? frontmatter.description : "",
2603
- tools: toStringArray5(frontmatter["x-agentsmesh-tools"]),
2604
- disallowedTools: toStringArray5(frontmatter["x-agentsmesh-disallowed-tools"]),
2605
- model: typeof frontmatter["x-agentsmesh-model"] === "string" ? frontmatter["x-agentsmesh-model"] : "",
2606
- permissionMode: typeof frontmatter["x-agentsmesh-permission-mode"] === "string" ? frontmatter["x-agentsmesh-permission-mode"] : "",
2607
- maxTurns: typeof frontmatter["x-agentsmesh-max-turns"] === "number" ? frontmatter["x-agentsmesh-max-turns"] : Number(frontmatter["x-agentsmesh-max-turns"] ?? 0),
2608
- mcpServers: toStringArray5(frontmatter["x-agentsmesh-mcp-servers"]),
2609
- hooks: toHooks(frontmatter["x-agentsmesh-hooks"]),
2610
- skills: toStringArray5(frontmatter["x-agentsmesh-skills"]),
2611
- memory: typeof frontmatter["x-agentsmesh-memory"] === "string" ? frontmatter["x-agentsmesh-memory"] : ""
2612
- };
2613
- }
2614
- function serializeImportedAgent(agent, body) {
2615
- const frontmatter = {
2616
- name: agent.name,
2617
- description: agent.description,
2618
- tools: agent.tools,
2619
- disallowedTools: agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
2620
- model: agent.model || void 0,
2621
- permissionMode: agent.permissionMode || void 0,
2622
- maxTurns: agent.maxTurns > 0 ? agent.maxTurns : void 0,
2623
- mcpServers: agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
2624
- hooks: Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
2625
- skills: agent.skills.length > 0 ? agent.skills : void 0,
2626
- memory: agent.memory || void 0
2627
- };
2628
- Object.keys(frontmatter).forEach((key) => {
2629
- if (frontmatter[key] === void 0) delete frontmatter[key];
2630
- });
2631
- return serializeFrontmatter(frontmatter, body.trim() || "");
2632
- }
2633
- var PROJECTED_AGENT_SKILL_PREFIX, LEGACY_PROJECTED_AGENT_SKILL_PREFIX;
2634
- var init_projected_agent_skill = __esm({
2635
- "src/targets/projection/projected-agent-skill.ts"() {
2636
- init_markdown();
2637
- PROJECTED_AGENT_SKILL_PREFIX = "am-agent-";
2638
- LEGACY_PROJECTED_AGENT_SKILL_PREFIX = "ab-agent-";
2639
- }
2640
- });
2641
2710
  function rel(projectRoot, absPath) {
2642
2711
  return pathApi(projectRoot).relative(projectRoot, absPath).replace(/\\/g, "/");
2643
2712
  }
@@ -2675,12 +2744,12 @@ function addSkillLikeMapping(refs, relPath, skillsDir) {
2675
2744
  if (!dirName || !filePath) return;
2676
2745
  const commandPrefix = dirName.startsWith(CODEX_COMMAND_SKILL_PREFIX) ? CODEX_COMMAND_SKILL_PREFIX : dirName.startsWith(LEGACY_CODEX_COMMAND_SKILL_PREFIX) ? LEGACY_CODEX_COMMAND_SKILL_PREFIX : null;
2677
2746
  if (commandPrefix && filePath === "SKILL.md") {
2678
- refs.set(relPath, `${AB_COMMANDS}/${dirName.slice(commandPrefix.length)}.md`);
2747
+ refs.set(relPath, `${AB_COMMANDS2}/${dirName.slice(commandPrefix.length)}.md`);
2679
2748
  return;
2680
2749
  }
2681
2750
  const agentPrefix = dirName.startsWith(PROJECTED_AGENT_SKILL_PREFIX) ? PROJECTED_AGENT_SKILL_PREFIX : dirName.startsWith(LEGACY_PROJECTED_AGENT_SKILL_PREFIX) ? LEGACY_PROJECTED_AGENT_SKILL_PREFIX : null;
2682
2751
  if (agentPrefix && filePath === "SKILL.md") {
2683
- refs.set(relPath, `${AB_AGENTS}/${dirName.slice(agentPrefix.length)}.md`);
2752
+ refs.set(relPath, `${AB_AGENTS2}/${dirName.slice(agentPrefix.length)}.md`);
2684
2753
  return;
2685
2754
  }
2686
2755
  const canonicalBase = `${AB_SKILLS2}/${dirName}`;
@@ -2698,18 +2767,18 @@ async function targetRootSegments() {
2698
2767
  if (targetRootSegmentsCache !== void 0) return targetRootSegmentsCache;
2699
2768
  const { BUILTIN_TARGETS: BUILTIN_TARGETS2 } = await Promise.resolve().then(() => (init_builtin_targets(), builtin_targets_exports));
2700
2769
  const roots = /* @__PURE__ */ new Set();
2701
- for (const descriptor14 of BUILTIN_TARGETS2) {
2770
+ for (const descriptor16 of BUILTIN_TARGETS2) {
2702
2771
  for (const path of [
2703
- descriptor14.project.rootInstructionPath,
2704
- descriptor14.project.skillDir,
2705
- ...descriptor14.project.managedOutputs?.dirs ?? [],
2706
- ...descriptor14.project.managedOutputs?.files ?? [],
2707
- ...descriptor14.detectionPaths,
2708
- descriptor14.globalSupport?.layout.rootInstructionPath,
2709
- descriptor14.globalSupport?.layout.skillDir,
2710
- ...descriptor14.globalSupport?.layout.managedOutputs?.dirs ?? [],
2711
- ...descriptor14.globalSupport?.layout.managedOutputs?.files ?? [],
2712
- ...descriptor14.globalSupport?.detectionPaths ?? []
2772
+ descriptor16.project.rootInstructionPath,
2773
+ descriptor16.project.skillDir,
2774
+ ...descriptor16.project.managedOutputs?.dirs ?? [],
2775
+ ...descriptor16.project.managedOutputs?.files ?? [],
2776
+ ...descriptor16.detectionPaths,
2777
+ descriptor16.globalSupport?.layout.rootInstructionPath,
2778
+ descriptor16.globalSupport?.layout.skillDir,
2779
+ ...descriptor16.globalSupport?.layout.managedOutputs?.dirs ?? [],
2780
+ ...descriptor16.globalSupport?.layout.managedOutputs?.files ?? [],
2781
+ ...descriptor16.globalSupport?.detectionPaths ?? []
2713
2782
  ]) {
2714
2783
  if (path !== void 0) {
2715
2784
  const segment = firstPathSegment(path);
@@ -2766,7 +2835,7 @@ async function addScopedAgentsMappings(refs, projectRoot) {
2766
2835
  refs.set(relPath, `${AB_RULES}/${ruleName}.md`);
2767
2836
  }
2768
2837
  }
2769
- var AB_RULES, AB_COMMANDS, AB_AGENTS, AB_SKILLS2, targetRootSegmentsCache;
2838
+ var AB_RULES, AB_COMMANDS2, AB_AGENTS2, AB_SKILLS2, targetRootSegmentsCache;
2770
2839
  var init_import_map_shared = __esm({
2771
2840
  "src/core/reference/import-map-shared.ts"() {
2772
2841
  init_path_helpers();
@@ -2774,19 +2843,19 @@ var init_import_map_shared = __esm({
2774
2843
  init_command_skill();
2775
2844
  init_projected_agent_skill();
2776
2845
  AB_RULES = ".agentsmesh/rules";
2777
- AB_COMMANDS = ".agentsmesh/commands";
2778
- AB_AGENTS = ".agentsmesh/agents";
2846
+ AB_COMMANDS2 = ".agentsmesh/commands";
2847
+ AB_AGENTS2 = ".agentsmesh/agents";
2779
2848
  AB_SKILLS2 = ".agentsmesh/skills";
2780
2849
  }
2781
2850
  });
2782
2851
 
2783
2852
  // src/core/reference/import-maps/constants.ts
2784
- var AB_RULES2, AB_COMMANDS2, AB_AGENTS2;
2853
+ var AB_RULES2, AB_COMMANDS3, AB_AGENTS3;
2785
2854
  var init_constants2 = __esm({
2786
2855
  "src/core/reference/import-maps/constants.ts"() {
2787
2856
  AB_RULES2 = ".agentsmesh/rules";
2788
- AB_COMMANDS2 = ".agentsmesh/commands";
2789
- AB_AGENTS2 = ".agentsmesh/agents";
2857
+ AB_COMMANDS3 = ".agentsmesh/commands";
2858
+ AB_AGENTS3 = ".agentsmesh/agents";
2790
2859
  }
2791
2860
  });
2792
2861
 
@@ -2808,7 +2877,7 @@ async function buildAntigravityImportPaths(refs, projectRoot, scope = "project")
2808
2877
  addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
2809
2878
  }
2810
2879
  for (const absPath of await listFiles(projectRoot, ANTIGRAVITY_WORKFLOWS_DIR)) {
2811
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
2880
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
2812
2881
  }
2813
2882
  for (const absPath of await listFiles(projectRoot, ANTIGRAVITY_SKILLS_DIR)) {
2814
2883
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ANTIGRAVITY_SKILLS_DIR);
@@ -2866,10 +2935,10 @@ async function buildClaudeCodeImportPaths(refs, projectRoot, scope = "project")
2866
2935
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
2867
2936
  }
2868
2937
  for (const absPath of await listFiles(projectRoot, ".claude/commands")) {
2869
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
2938
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
2870
2939
  }
2871
2940
  for (const absPath of await listFiles(projectRoot, ".claude/agents")) {
2872
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
2941
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
2873
2942
  }
2874
2943
  for (const absPath of await listFiles(projectRoot, ".claude/skills")) {
2875
2944
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".claude/skills");
@@ -2914,7 +2983,7 @@ async function buildClineImportPaths(refs, projectRoot, scope = "project") {
2914
2983
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
2915
2984
  }
2916
2985
  for (const absPath of await listFiles(projectRoot, CLINE_GLOBAL_WORKFLOWS_DIR)) {
2917
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
2986
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
2918
2987
  }
2919
2988
  for (const absPath of await listFiles(projectRoot, CLINE_SKILLS_DIR)) {
2920
2989
  addSkillLikeMapping(refs, rel(projectRoot, absPath), CLINE_SKILLS_DIR);
@@ -2931,7 +3000,7 @@ async function buildClineImportPaths(refs, projectRoot, scope = "project") {
2931
3000
  addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
2932
3001
  }
2933
3002
  for (const absPath of await listFiles(projectRoot, ".clinerules/workflows")) {
2934
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3003
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
2935
3004
  }
2936
3005
  for (const absPath of await listFiles(projectRoot, ".cline/skills")) {
2937
3006
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".cline/skills");
@@ -2969,7 +3038,7 @@ async function buildCodexCliImportPaths(refs, projectRoot, scope = "project") {
2969
3038
  }
2970
3039
  }
2971
3040
  for (const absPath of await listFiles(projectRoot, ".codex/agents")) {
2972
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".toml");
3041
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".toml");
2973
3042
  }
2974
3043
  for (const absPath of await listFiles(projectRoot, ".agents/skills")) {
2975
3044
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".agents/skills");
@@ -3010,7 +3079,7 @@ async function buildContinueImportPaths(refs, projectRoot, scope = "project") {
3010
3079
  addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
3011
3080
  }
3012
3081
  for (const absPath of await listFiles(projectRoot, ".continue/prompts")) {
3013
- refs.set(rel(projectRoot, absPath), `${AB_COMMANDS2}/${basename(absPath, ".md")}.md`);
3082
+ refs.set(rel(projectRoot, absPath), `${AB_COMMANDS3}/${basename(absPath, ".md")}.md`);
3014
3083
  }
3015
3084
  for (const absPath of await listFiles(projectRoot, ".continue/skills")) {
3016
3085
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".continue/skills");
@@ -3044,10 +3113,10 @@ async function buildCopilotImportPaths(refs, projectRoot) {
3044
3113
  addCopilotInstructionMapping(refs, rel(projectRoot, absPath));
3045
3114
  }
3046
3115
  for (const absPath of await listFiles(projectRoot, ".github/prompts")) {
3047
- refs.set(rel(projectRoot, absPath), `${AB_COMMANDS2}/${basename(absPath, ".prompt.md")}.md`);
3116
+ refs.set(rel(projectRoot, absPath), `${AB_COMMANDS3}/${basename(absPath, ".prompt.md")}.md`);
3048
3117
  }
3049
3118
  for (const absPath of await listFiles(projectRoot, ".github/agents")) {
3050
- refs.set(rel(projectRoot, absPath), `${AB_AGENTS2}/${basename(absPath, ".agent.md")}.md`);
3119
+ refs.set(rel(projectRoot, absPath), `${AB_AGENTS3}/${basename(absPath, ".agent.md")}.md`);
3051
3120
  }
3052
3121
  for (const absPath of await listFiles(projectRoot, ".github/skills")) {
3053
3122
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".github/skills");
@@ -3103,10 +3172,10 @@ async function buildCursorImportPaths(refs, projectRoot, scope = "project") {
3103
3172
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".mdc");
3104
3173
  }
3105
3174
  for (const absPath of await listFiles(projectRoot, ".cursor/commands")) {
3106
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3175
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3107
3176
  }
3108
3177
  for (const absPath of await listFiles(projectRoot, ".cursor/agents")) {
3109
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3178
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3110
3179
  }
3111
3180
  for (const absPath of await listFiles(projectRoot, ".cursor/skills")) {
3112
3181
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".cursor/skills");
@@ -3118,10 +3187,10 @@ async function buildCursorImportPaths(refs, projectRoot, scope = "project") {
3118
3187
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".mdc");
3119
3188
  }
3120
3189
  for (const absPath of await listFiles(projectRoot, ".cursor/commands")) {
3121
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3190
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3122
3191
  }
3123
3192
  for (const absPath of await listFiles(projectRoot, ".cursor/agents")) {
3124
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3193
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3125
3194
  }
3126
3195
  for (const absPath of await listFiles(projectRoot, ".cursor/skills")) {
3127
3196
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".cursor/skills");
@@ -3148,10 +3217,10 @@ async function buildGeminiCliImportPaths(refs, projectRoot) {
3148
3217
  const relativeNoExt = noExt.startsWith(commandsPrefix) ? noExt.slice(commandsPrefix.length) : noExt;
3149
3218
  const segments = relativeNoExt.split("/").filter(Boolean);
3150
3219
  const canonicalName = segments.join(":");
3151
- refs.set(relPath, `${AB_COMMANDS2}/${canonicalName}.md`);
3220
+ refs.set(relPath, `${AB_COMMANDS3}/${canonicalName}.md`);
3152
3221
  }
3153
3222
  for (const absPath of await listFiles(projectRoot, ".gemini/agents")) {
3154
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3223
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3155
3224
  }
3156
3225
  for (const absPath of await listFiles(projectRoot, ".gemini/skills")) {
3157
3226
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".gemini/skills");
@@ -3164,9 +3233,50 @@ var init_gemini_cli = __esm({
3164
3233
  }
3165
3234
  });
3166
3235
 
3236
+ // src/targets/goose/constants.ts
3237
+ var GOOSE_TARGET, GOOSE_ROOT_FILE, GOOSE_SKILLS_DIR, GOOSE_IGNORE, GOOSE_GLOBAL_DIR, GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE, GOOSE_GLOBAL_SKILLS_DIR, GOOSE_CANONICAL_RULES_DIR, GOOSE_CANONICAL_IGNORE;
3238
+ var init_constants7 = __esm({
3239
+ "src/targets/goose/constants.ts"() {
3240
+ GOOSE_TARGET = "goose";
3241
+ GOOSE_ROOT_FILE = ".goosehints";
3242
+ GOOSE_SKILLS_DIR = ".agents/skills";
3243
+ GOOSE_IGNORE = ".gooseignore";
3244
+ GOOSE_GLOBAL_DIR = ".config/goose";
3245
+ GOOSE_GLOBAL_ROOT_FILE = `${GOOSE_GLOBAL_DIR}/.goosehints`;
3246
+ GOOSE_GLOBAL_IGNORE = `${GOOSE_GLOBAL_DIR}/.gooseignore`;
3247
+ GOOSE_GLOBAL_SKILLS_DIR = ".agents/skills";
3248
+ GOOSE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
3249
+ GOOSE_CANONICAL_IGNORE = ".agentsmesh/ignore";
3250
+ }
3251
+ });
3252
+
3253
+ // src/core/reference/import-maps/goose.ts
3254
+ async function buildGooseImportPaths(refs, projectRoot, scope = "project") {
3255
+ if (scope === "global") {
3256
+ refs.set(GOOSE_GLOBAL_ROOT_FILE, `${AB_RULES2}/_root.md`);
3257
+ for (const absPath of await listFiles(projectRoot, GOOSE_GLOBAL_SKILLS_DIR)) {
3258
+ addSkillLikeMapping(refs, rel(projectRoot, absPath), GOOSE_GLOBAL_SKILLS_DIR);
3259
+ }
3260
+ refs.set(GOOSE_GLOBAL_IGNORE, ".agentsmesh/ignore");
3261
+ return;
3262
+ }
3263
+ refs.set(GOOSE_ROOT_FILE, `${AB_RULES2}/_root.md`);
3264
+ for (const absPath of await listFiles(projectRoot, GOOSE_SKILLS_DIR)) {
3265
+ addSkillLikeMapping(refs, rel(projectRoot, absPath), GOOSE_SKILLS_DIR);
3266
+ }
3267
+ refs.set(GOOSE_IGNORE, ".agentsmesh/ignore");
3268
+ }
3269
+ var init_goose = __esm({
3270
+ "src/core/reference/import-maps/goose.ts"() {
3271
+ init_import_map_shared();
3272
+ init_constants7();
3273
+ init_constants2();
3274
+ }
3275
+ });
3276
+
3167
3277
  // src/targets/junie/constants.ts
3168
3278
  var JUNIE_TARGET, JUNIE_DIR, JUNIE_GUIDELINES, JUNIE_CI_GUIDELINES, JUNIE_DOT_AGENTS, JUNIE_AGENTS_FALLBACK, JUNIE_MCP_DIR, JUNIE_MCP_FILE, JUNIE_SKILLS_DIR, JUNIE_RULES_DIR, JUNIE_COMMANDS_DIR, JUNIE_AGENTS_DIR, JUNIE_IGNORE, JUNIE_GLOBAL_DIR, JUNIE_GLOBAL_SKILLS_DIR, JUNIE_GLOBAL_AGENTS_DIR, JUNIE_GLOBAL_COMMANDS_DIR, JUNIE_GLOBAL_MCP_DIR, JUNIE_GLOBAL_MCP_FILE, JUNIE_GLOBAL_AGENTS_MD, JUNIE_GLOBAL_AGENTS_SKILLS_DIR, JUNIE_CANONICAL_ROOT_RULE, JUNIE_CANONICAL_RULES_DIR, JUNIE_CANONICAL_COMMANDS_DIR, JUNIE_CANONICAL_AGENTS_DIR, JUNIE_CANONICAL_MCP, JUNIE_CANONICAL_IGNORE;
3169
- var init_constants7 = __esm({
3279
+ var init_constants8 = __esm({
3170
3280
  "src/targets/junie/constants.ts"() {
3171
3281
  JUNIE_TARGET = "junie";
3172
3282
  JUNIE_DIR = ".junie";
@@ -3207,10 +3317,10 @@ async function buildJunieImportPaths(refs, projectRoot) {
3207
3317
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
3208
3318
  }
3209
3319
  for (const absPath of await listFiles(projectRoot, ".junie/commands")) {
3210
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3320
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3211
3321
  }
3212
3322
  for (const absPath of await listFiles(projectRoot, ".junie/agents")) {
3213
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3323
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3214
3324
  }
3215
3325
  for (const absPath of await listFiles(projectRoot, ".junie/skills")) {
3216
3326
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".junie/skills");
@@ -3219,14 +3329,14 @@ async function buildJunieImportPaths(refs, projectRoot) {
3219
3329
  var init_junie = __esm({
3220
3330
  "src/core/reference/import-maps/junie.ts"() {
3221
3331
  init_import_map_shared();
3222
- init_constants7();
3332
+ init_constants8();
3223
3333
  init_constants2();
3224
3334
  }
3225
3335
  });
3226
3336
 
3227
3337
  // src/targets/kilo-code/constants.ts
3228
3338
  var KILO_CODE_TARGET, KILO_CODE_DIR, KILO_CODE_ROOT_RULE, KILO_CODE_RULES_DIR, KILO_CODE_COMMANDS_DIR, KILO_CODE_AGENTS_DIR, KILO_CODE_SKILLS_DIR, KILO_CODE_MCP_FILE, KILO_CODE_IGNORE, KILO_CODE_LEGACY_DIR, KILO_CODE_LEGACY_RULES_DIR, KILO_CODE_LEGACY_WORKFLOWS_DIR, KILO_CODE_LEGACY_SKILLS_DIR, KILO_CODE_LEGACY_MCP_FILE, KILO_CODE_LEGACY_MODES_FILE, KILO_CODE_GLOBAL_DIR, KILO_CODE_GLOBAL_AGENTS_MD, KILO_CODE_GLOBAL_RULES_DIR, KILO_CODE_GLOBAL_COMMANDS_DIR, KILO_CODE_GLOBAL_AGENTS_DIR, KILO_CODE_GLOBAL_SKILLS_DIR, KILO_CODE_GLOBAL_MCP_FILE, KILO_CODE_GLOBAL_IGNORE, KILO_CODE_GLOBAL_AGENTS_SKILLS_DIR, KILO_CODE_CANONICAL_RULES_DIR, KILO_CODE_CANONICAL_COMMANDS_DIR, KILO_CODE_CANONICAL_AGENTS_DIR, KILO_CODE_CANONICAL_MCP, KILO_CODE_CANONICAL_IGNORE;
3229
- var init_constants8 = __esm({
3339
+ var init_constants9 = __esm({
3230
3340
  "src/targets/kilo-code/constants.ts"() {
3231
3341
  KILO_CODE_TARGET = "kilo-code";
3232
3342
  KILO_CODE_DIR = ".kilo";
@@ -3266,10 +3376,10 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
3266
3376
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
3267
3377
  }
3268
3378
  for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_COMMANDS_DIR)) {
3269
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3379
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3270
3380
  }
3271
3381
  for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_AGENTS_DIR)) {
3272
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3382
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3273
3383
  }
3274
3384
  for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_SKILLS_DIR)) {
3275
3385
  addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_GLOBAL_SKILLS_DIR);
@@ -3282,10 +3392,10 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
3282
3392
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
3283
3393
  }
3284
3394
  for (const absPath of await listFiles(projectRoot, KILO_CODE_COMMANDS_DIR)) {
3285
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3395
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3286
3396
  }
3287
3397
  for (const absPath of await listFiles(projectRoot, KILO_CODE_AGENTS_DIR)) {
3288
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3398
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3289
3399
  }
3290
3400
  for (const absPath of await listFiles(projectRoot, KILO_CODE_SKILLS_DIR)) {
3291
3401
  addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_SKILLS_DIR);
@@ -3300,7 +3410,7 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
3300
3410
  addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
3301
3411
  }
3302
3412
  for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_WORKFLOWS_DIR)) {
3303
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3413
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3304
3414
  }
3305
3415
  for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_SKILLS_DIR)) {
3306
3416
  addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_LEGACY_SKILLS_DIR);
@@ -3310,14 +3420,14 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
3310
3420
  var init_kilo_code = __esm({
3311
3421
  "src/core/reference/import-maps/kilo-code.ts"() {
3312
3422
  init_import_map_shared();
3313
- init_constants8();
3423
+ init_constants9();
3314
3424
  init_constants2();
3315
3425
  }
3316
3426
  });
3317
3427
 
3318
3428
  // src/targets/kiro/constants.ts
3319
3429
  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;
3320
- var init_constants9 = __esm({
3430
+ var init_constants10 = __esm({
3321
3431
  "src/targets/kiro/constants.ts"() {
3322
3432
  KIRO_TARGET = "kiro";
3323
3433
  KIRO_AGENTS_MD = "AGENTS.md";
@@ -3358,7 +3468,7 @@ async function buildKiroImportPaths(refs, projectRoot, scope = "project") {
3358
3468
  addSkillLikeMapping(refs, rel(projectRoot, absPath), KIRO_GLOBAL_SKILLS_DIR);
3359
3469
  }
3360
3470
  for (const absPath of await listFiles(projectRoot, KIRO_GLOBAL_AGENTS_DIR)) {
3361
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3471
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3362
3472
  }
3363
3473
  return;
3364
3474
  }
@@ -3370,20 +3480,89 @@ async function buildKiroImportPaths(refs, projectRoot, scope = "project") {
3370
3480
  addSkillLikeMapping(refs, rel(projectRoot, absPath), KIRO_SKILLS_DIR);
3371
3481
  }
3372
3482
  for (const absPath of await listFiles(projectRoot, KIRO_AGENTS_DIR)) {
3373
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS2, ".md");
3483
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3374
3484
  }
3375
3485
  }
3376
3486
  var init_kiro = __esm({
3377
3487
  "src/core/reference/import-maps/kiro.ts"() {
3378
3488
  init_import_map_shared();
3379
- init_constants9();
3489
+ init_constants10();
3490
+ init_constants2();
3491
+ }
3492
+ });
3493
+
3494
+ // src/targets/opencode/constants.ts
3495
+ var OPENCODE_TARGET, OPENCODE_DIR, OPENCODE_ROOT_RULE, OPENCODE_RULES_DIR, OPENCODE_COMMANDS_DIR, OPENCODE_AGENTS_DIR, OPENCODE_SKILLS_DIR, OPENCODE_CONFIG_FILE, OPENCODE_GLOBAL_DIR, OPENCODE_GLOBAL_AGENTS_MD, OPENCODE_GLOBAL_RULES_DIR, OPENCODE_GLOBAL_COMMANDS_DIR, OPENCODE_GLOBAL_AGENTS_DIR, OPENCODE_GLOBAL_SKILLS_DIR, OPENCODE_GLOBAL_CONFIG_FILE, OPENCODE_GLOBAL_AGENTS_SKILLS_DIR, OPENCODE_CANONICAL_RULES_DIR, OPENCODE_CANONICAL_COMMANDS_DIR, OPENCODE_CANONICAL_AGENTS_DIR, OPENCODE_CANONICAL_MCP;
3496
+ var init_constants11 = __esm({
3497
+ "src/targets/opencode/constants.ts"() {
3498
+ OPENCODE_TARGET = "opencode";
3499
+ OPENCODE_DIR = ".opencode";
3500
+ OPENCODE_ROOT_RULE = "AGENTS.md";
3501
+ OPENCODE_RULES_DIR = `${OPENCODE_DIR}/rules`;
3502
+ OPENCODE_COMMANDS_DIR = `${OPENCODE_DIR}/commands`;
3503
+ OPENCODE_AGENTS_DIR = `${OPENCODE_DIR}/agents`;
3504
+ OPENCODE_SKILLS_DIR = `${OPENCODE_DIR}/skills`;
3505
+ OPENCODE_CONFIG_FILE = "opencode.json";
3506
+ OPENCODE_GLOBAL_DIR = ".config/opencode";
3507
+ OPENCODE_GLOBAL_AGENTS_MD = `${OPENCODE_GLOBAL_DIR}/AGENTS.md`;
3508
+ OPENCODE_GLOBAL_RULES_DIR = `${OPENCODE_GLOBAL_DIR}/rules`;
3509
+ OPENCODE_GLOBAL_COMMANDS_DIR = `${OPENCODE_GLOBAL_DIR}/commands`;
3510
+ OPENCODE_GLOBAL_AGENTS_DIR = `${OPENCODE_GLOBAL_DIR}/agents`;
3511
+ OPENCODE_GLOBAL_SKILLS_DIR = `${OPENCODE_GLOBAL_DIR}/skills`;
3512
+ OPENCODE_GLOBAL_CONFIG_FILE = `${OPENCODE_GLOBAL_DIR}/opencode.json`;
3513
+ OPENCODE_GLOBAL_AGENTS_SKILLS_DIR = ".agents/skills";
3514
+ OPENCODE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
3515
+ OPENCODE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
3516
+ OPENCODE_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
3517
+ OPENCODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
3518
+ }
3519
+ });
3520
+
3521
+ // src/core/reference/import-maps/opencode.ts
3522
+ async function buildOpencodeImportPaths(refs, projectRoot, scope = "project") {
3523
+ if (scope === "global") {
3524
+ refs.set(OPENCODE_GLOBAL_AGENTS_MD, `${AB_RULES2}/_root.md`);
3525
+ for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_RULES_DIR)) {
3526
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
3527
+ }
3528
+ for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_COMMANDS_DIR)) {
3529
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3530
+ }
3531
+ for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_AGENTS_DIR)) {
3532
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3533
+ }
3534
+ for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_SKILLS_DIR)) {
3535
+ addSkillLikeMapping(refs, rel(projectRoot, absPath), OPENCODE_GLOBAL_SKILLS_DIR);
3536
+ }
3537
+ refs.set(OPENCODE_GLOBAL_CONFIG_FILE, ".agentsmesh/mcp.json");
3538
+ return;
3539
+ }
3540
+ refs.set(OPENCODE_ROOT_RULE, `${AB_RULES2}/_root.md`);
3541
+ for (const absPath of await listFiles(projectRoot, OPENCODE_RULES_DIR)) {
3542
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
3543
+ }
3544
+ for (const absPath of await listFiles(projectRoot, OPENCODE_COMMANDS_DIR)) {
3545
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3546
+ }
3547
+ for (const absPath of await listFiles(projectRoot, OPENCODE_AGENTS_DIR)) {
3548
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
3549
+ }
3550
+ for (const absPath of await listFiles(projectRoot, OPENCODE_SKILLS_DIR)) {
3551
+ addSkillLikeMapping(refs, rel(projectRoot, absPath), OPENCODE_SKILLS_DIR);
3552
+ }
3553
+ refs.set(OPENCODE_CONFIG_FILE, ".agentsmesh/mcp.json");
3554
+ }
3555
+ var init_opencode = __esm({
3556
+ "src/core/reference/import-maps/opencode.ts"() {
3557
+ init_import_map_shared();
3558
+ init_constants11();
3380
3559
  init_constants2();
3381
3560
  }
3382
3561
  });
3383
3562
 
3384
3563
  // src/targets/roo-code/constants.ts
3385
3564
  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;
3386
- var init_constants10 = __esm({
3565
+ var init_constants12 = __esm({
3387
3566
  "src/targets/roo-code/constants.ts"() {
3388
3567
  ROO_CODE_TARGET = "roo-code";
3389
3568
  ROO_CODE_DIR = ".roo";
@@ -3419,7 +3598,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
3419
3598
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
3420
3599
  }
3421
3600
  for (const absPath of await listFiles(projectRoot, ROO_CODE_GLOBAL_COMMANDS_DIR)) {
3422
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3601
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3423
3602
  }
3424
3603
  for (const absPath of await listFiles(projectRoot, ROO_CODE_GLOBAL_SKILLS_DIR)) {
3425
3604
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ROO_CODE_GLOBAL_SKILLS_DIR);
@@ -3441,7 +3620,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
3441
3620
  }
3442
3621
  }
3443
3622
  for (const absPath of await listFiles(projectRoot, ROO_CODE_COMMANDS_DIR)) {
3444
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3623
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3445
3624
  }
3446
3625
  for (const absPath of await listFiles(projectRoot, ROO_CODE_SKILLS_DIR)) {
3447
3626
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ROO_CODE_SKILLS_DIR);
@@ -3450,7 +3629,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
3450
3629
  var init_roo_code = __esm({
3451
3630
  "src/core/reference/import-maps/roo-code.ts"() {
3452
3631
  init_import_map_shared();
3453
- init_constants10();
3632
+ init_constants12();
3454
3633
  init_constants2();
3455
3634
  }
3456
3635
  });
@@ -3464,7 +3643,7 @@ async function buildWindsurfImportPaths(refs, projectRoot) {
3464
3643
  addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
3465
3644
  }
3466
3645
  for (const absPath of await listFiles(projectRoot, ".windsurf/workflows")) {
3467
- addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS2, ".md");
3646
+ addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
3468
3647
  }
3469
3648
  for (const absPath of await listFiles(projectRoot, ".windsurf/skills")) {
3470
3649
  addSkillLikeMapping(refs, rel(projectRoot, absPath), ".windsurf/skills");
@@ -3488,9 +3667,11 @@ var init_import_maps = __esm({
3488
3667
  init_copilot();
3489
3668
  init_cursor();
3490
3669
  init_gemini_cli();
3670
+ init_goose();
3491
3671
  init_junie();
3492
3672
  init_kilo_code();
3493
3673
  init_kiro();
3674
+ init_opencode();
3494
3675
  init_roo_code();
3495
3676
  init_windsurf();
3496
3677
  }
@@ -3508,6 +3689,7 @@ var target, project, global, globalCapabilities, descriptor;
3508
3689
  var init_antigravity2 = __esm({
3509
3690
  "src/targets/antigravity/index.ts"() {
3510
3691
  init_capabilities();
3692
+ init_projected_agent_skill();
3511
3693
  init_generator();
3512
3694
  init_constants();
3513
3695
  init_importer();
@@ -3519,6 +3701,7 @@ var init_antigravity2 = __esm({
3519
3701
  primaryRootInstructionPath: ANTIGRAVITY_RULES_ROOT,
3520
3702
  generateRules,
3521
3703
  generateCommands,
3704
+ generateAgents,
3522
3705
  generateSkills,
3523
3706
  generateMcp,
3524
3707
  importFrom: importFromAntigravity
@@ -3537,8 +3720,8 @@ var init_antigravity2 = __esm({
3537
3720
  commandPath(name, _config) {
3538
3721
  return `${ANTIGRAVITY_WORKFLOWS_DIR}/${name}.md`;
3539
3722
  },
3540
- agentPath(_name, _config) {
3541
- return null;
3723
+ agentPath(name) {
3724
+ return `${ANTIGRAVITY_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
3542
3725
  }
3543
3726
  }
3544
3727
  };
@@ -3569,8 +3752,8 @@ var init_antigravity2 = __esm({
3569
3752
  commandPath(name, _config) {
3570
3753
  return `${ANTIGRAVITY_GLOBAL_WORKFLOWS_DIR}/${name}.md`;
3571
3754
  },
3572
- agentPath(_name, _config) {
3573
- return null;
3755
+ agentPath(name) {
3756
+ return `${ANTIGRAVITY_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
3574
3757
  }
3575
3758
  }
3576
3759
  };
@@ -3600,6 +3783,7 @@ var init_antigravity2 = __esm({
3600
3783
  permissions: "none"
3601
3784
  },
3602
3785
  emptyImportMessage: "No Antigravity config found (.agents/rules/, .agents/skills/, or .agents/workflows/).",
3786
+ supportsConversion: { agents: true },
3603
3787
  lintRules,
3604
3788
  project,
3605
3789
  globalSupport: {
@@ -3743,7 +3927,7 @@ function generateCommands2(canonical) {
3743
3927
  return { path: `${CLAUDE_COMMANDS_DIR}/${cmd.name}.md`, content };
3744
3928
  });
3745
3929
  }
3746
- function generateAgents(canonical) {
3930
+ function generateAgents2(canonical) {
3747
3931
  return canonical.agents.map((agent) => {
3748
3932
  const frontmatter = {
3749
3933
  name: agent.name,
@@ -4195,7 +4379,7 @@ var init_claude_code2 = __esm({
4195
4379
  primaryRootInstructionPath: CLAUDE_ROOT,
4196
4380
  generateRules: generateRules2,
4197
4381
  generateCommands: generateCommands2,
4198
- generateAgents,
4382
+ generateAgents: generateAgents2,
4199
4383
  generateSkills: generateSkills2,
4200
4384
  generateMcp: generateMcp2,
4201
4385
  generatePermissions,
@@ -4401,7 +4585,7 @@ function generateMcp3(canonical) {
4401
4585
  const content = JSON.stringify({ mcpServers: canonical.mcp.mcpServers }, null, 2);
4402
4586
  return [{ path: CLINE_MCP_SETTINGS, content }];
4403
4587
  }
4404
- function generateAgents2(canonical) {
4588
+ function generateAgents3(canonical) {
4405
4589
  return canonical.agents.map((agent) => ({
4406
4590
  path: `${CLINE_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
4407
4591
  content: serializeProjectedAgentSkill(agent)
@@ -4990,11 +5174,11 @@ var init_linter3 = __esm({
4990
5174
  });
4991
5175
 
4992
5176
  // src/core/lint/shared/helpers.ts
4993
- function createWarning(file, target14, message) {
5177
+ function createWarning(file, target16, message) {
4994
5178
  return {
4995
5179
  level: "warning",
4996
5180
  file,
4997
- target: target14,
5181
+ target: target16,
4998
5182
  message
4999
5183
  };
5000
5184
  }
@@ -5004,12 +5188,12 @@ function formatOxfordComma(items) {
5004
5188
  if (items.length === 2) return `${items[0]} and ${items[1]}`;
5005
5189
  return `${items.slice(0, -1).join(", ")}, and ${items[items.length - 1]}`;
5006
5190
  }
5007
- function createUnsupportedHookWarning(event, target14, supportedEvents, options) {
5008
- const by = options?.unsupportedBy ?? target14;
5191
+ function createUnsupportedHookWarning(event, target16, supportedEvents, options) {
5192
+ const by = options?.unsupportedBy ?? target16;
5009
5193
  const supported = formatOxfordComma(supportedEvents);
5010
5194
  return createWarning(
5011
5195
  ".agentsmesh/hooks.yaml",
5012
- target14,
5196
+ target16,
5013
5197
  `${event} is not supported by ${by}; only ${supported} are projected.`
5014
5198
  );
5015
5199
  }
@@ -5066,7 +5250,7 @@ var init_cline2 = __esm({
5066
5250
  primaryRootInstructionPath: CLINE_AGENTS_MD,
5067
5251
  generateRules: generateRules3,
5068
5252
  generateCommands: generateCommands3,
5069
- generateAgents: generateAgents2,
5253
+ generateAgents: generateAgents3,
5070
5254
  generateSkills: generateSkills3,
5071
5255
  generateMcp: generateMcp3,
5072
5256
  generateHooks: generateHooks2,
@@ -5193,7 +5377,7 @@ var init_cline2 = __esm({
5193
5377
 
5194
5378
  // src/targets/codex-cli/constants.ts
5195
5379
  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;
5196
- var init_constants11 = __esm({
5380
+ var init_constants13 = __esm({
5197
5381
  "src/targets/codex-cli/constants.ts"() {
5198
5382
  CODEX_TARGET = "codex-cli";
5199
5383
  CODEX_MD = "codex.md";
@@ -5256,7 +5440,7 @@ function summarizeRule(rule) {
5256
5440
  scopes.push(`Enforced in \`${CODEX_RULES_DIR}/${ruleSlug2(rule.source)}.rules\`.`);
5257
5441
  }
5258
5442
  if (rule.targets.length > 0) {
5259
- scopes.push(`Targeted to ${rule.targets.map((target14) => `\`${target14}\``).join(", ")}.`);
5443
+ scopes.push(`Targeted to ${rule.targets.map((target16) => `\`${target16}\``).join(", ")}.`);
5260
5444
  }
5261
5445
  return scopes.join(" ");
5262
5446
  }
@@ -5286,7 +5470,7 @@ function stripCodexRuleIndex(content) {
5286
5470
  var init_instruction_mirror = __esm({
5287
5471
  "src/targets/codex-cli/instruction-mirror.ts"() {
5288
5472
  init_markdown();
5289
- init_constants11();
5473
+ init_constants13();
5290
5474
  }
5291
5475
  });
5292
5476
  function looksLikeCodexRulesDsl(body) {
@@ -5352,7 +5536,7 @@ function renderCodexGlobalInstructions(canonical) {
5352
5536
  var init_rules = __esm({
5353
5537
  "src/targets/codex-cli/generator/rules.ts"() {
5354
5538
  init_managed_blocks();
5355
- init_constants11();
5539
+ init_constants13();
5356
5540
  init_instruction_mirror();
5357
5541
  }
5358
5542
  });
@@ -5393,13 +5577,13 @@ function generateCommands4(canonical) {
5393
5577
  var init_skills = __esm({
5394
5578
  "src/targets/codex-cli/generator/skills.ts"() {
5395
5579
  init_markdown();
5396
- init_constants11();
5580
+ init_constants13();
5397
5581
  init_command_skill();
5398
5582
  }
5399
5583
  });
5400
5584
 
5401
5585
  // src/targets/codex-cli/generator/agents.ts
5402
- function generateAgents3(canonical) {
5586
+ function generateAgents4(canonical) {
5403
5587
  return canonical.agents.map((agent) => ({
5404
5588
  path: `${CODEX_AGENTS_DIR}/${agent.name}.toml`,
5405
5589
  content: serializeAgentToCodexToml(agent)
@@ -5434,7 +5618,7 @@ ${body}
5434
5618
  }
5435
5619
  var init_agents = __esm({
5436
5620
  "src/targets/codex-cli/generator/agents.ts"() {
5437
- init_constants11();
5621
+ init_constants13();
5438
5622
  }
5439
5623
  });
5440
5624
 
@@ -5486,7 +5670,7 @@ function needsTomlQuoting(key) {
5486
5670
  var init_mcp = __esm({
5487
5671
  "src/targets/codex-cli/generator/mcp.ts"() {
5488
5672
  init_mcp_servers();
5489
- init_constants11();
5673
+ init_constants13();
5490
5674
  }
5491
5675
  });
5492
5676
 
@@ -5557,21 +5741,7 @@ var init_mcp_helpers = __esm({
5557
5741
  "src/targets/codex-cli/mcp-helpers.ts"() {
5558
5742
  init_fs();
5559
5743
  init_mcp_merge();
5560
- init_constants11();
5561
- }
5562
- });
5563
- function shouldImportScopedAgentsRule(relDir) {
5564
- const segments = relDir.split("/").filter(Boolean);
5565
- if (segments.length === 0) return false;
5566
- if (segments.some((segment) => segment.startsWith("."))) return false;
5567
- const relPath = segments.join("/");
5568
- return !relPath.startsWith("tests/e2e/fixtures/");
5569
- }
5570
- async function removePathIfExists(path) {
5571
- await rm(path, { recursive: true, force: true });
5572
- }
5573
- var init_scoped_agents_import = __esm({
5574
- "src/targets/import/scoped-agents-import.ts"() {
5744
+ init_constants13();
5575
5745
  }
5576
5746
  });
5577
5747
  async function importSkills(projectRoot, results, normalize) {
@@ -5651,7 +5821,7 @@ var init_skills_adapter2 = __esm({
5651
5821
  init_projected_agent_skill();
5652
5822
  init_scoped_agents_import();
5653
5823
  init_skill_import_pipeline();
5654
- init_constants11();
5824
+ init_constants13();
5655
5825
  }
5656
5826
  });
5657
5827
  async function importCodexAgentsFromToml(projectRoot, results, normalize) {
@@ -5704,7 +5874,7 @@ var init_importer_agents = __esm({
5704
5874
  "src/targets/codex-cli/importer-agents.ts"() {
5705
5875
  init_fs();
5706
5876
  init_projected_agent_skill();
5707
- init_constants11();
5877
+ init_constants13();
5708
5878
  }
5709
5879
  });
5710
5880
  function tryParseEmbeddedCanonicalFromCodexRules(content) {
@@ -5747,7 +5917,7 @@ function tryParseEmbeddedCanonicalFromCodexRules(content) {
5747
5917
  }
5748
5918
  var init_codex_rules_embed = __esm({
5749
5919
  "src/targets/codex-cli/codex-rules-embed.ts"() {
5750
- init_constants11();
5920
+ init_constants13();
5751
5921
  }
5752
5922
  });
5753
5923
  async function importCodexNonRootRuleFiles(projectRoot, destDir, normalize) {
@@ -5821,7 +5991,7 @@ var init_import_codex_non_root_rules = __esm({
5821
5991
  init_fs();
5822
5992
  init_markdown();
5823
5993
  init_import_metadata();
5824
- init_constants11();
5994
+ init_constants13();
5825
5995
  init_codex_rules_embed();
5826
5996
  }
5827
5997
  });
@@ -5943,7 +6113,7 @@ var init_importer_rules2 = __esm({
5943
6113
  init_embedded_rules();
5944
6114
  init_import_orchestrator();
5945
6115
  init_scoped_agents_import();
5946
- init_constants11();
6116
+ init_constants13();
5947
6117
  init_import_codex_non_root_rules();
5948
6118
  init_instruction_mirror();
5949
6119
  }
@@ -5968,7 +6138,7 @@ async function importFromCodex(projectRoot, options) {
5968
6138
  var init_importer4 = __esm({
5969
6139
  "src/targets/codex-cli/importer.ts"() {
5970
6140
  init_import_rewriter();
5971
- init_constants11();
6141
+ init_constants13();
5972
6142
  init_mcp_helpers();
5973
6143
  init_skills_adapter2();
5974
6144
  init_importer_agents();
@@ -5993,7 +6163,7 @@ function lintRules4(canonical, projectRoot, _projectFiles) {
5993
6163
  }
5994
6164
  var init_linter4 = __esm({
5995
6165
  "src/targets/codex-cli/linter.ts"() {
5996
- init_constants11();
6166
+ init_constants13();
5997
6167
  }
5998
6168
  });
5999
6169
 
@@ -6043,7 +6213,7 @@ var target4, project4, global3, globalCapabilities4, descriptor4;
6043
6213
  var init_codex_cli2 = __esm({
6044
6214
  "src/targets/codex-cli/index.ts"() {
6045
6215
  init_generator5();
6046
- init_constants11();
6216
+ init_constants13();
6047
6217
  init_importer4();
6048
6218
  init_linter4();
6049
6219
  init_lint2();
@@ -6056,7 +6226,7 @@ var init_codex_cli2 = __esm({
6056
6226
  primaryRootInstructionPath: AGENTS_MD,
6057
6227
  generateRules: generateRules4,
6058
6228
  generateCommands: generateCommands4,
6059
- generateAgents: generateAgents3,
6229
+ generateAgents: generateAgents4,
6060
6230
  generateSkills: generateSkills4,
6061
6231
  generateMcp: generateMcp4,
6062
6232
  importFrom: importFromCodex
@@ -6264,12 +6434,19 @@ function generateMcp5(canonical) {
6264
6434
  }
6265
6435
  ];
6266
6436
  }
6437
+ function generateAgents5(canonical) {
6438
+ return canonical.agents.map((agent) => ({
6439
+ path: `${CONTINUE_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
6440
+ content: serializeProjectedAgentSkill(agent)
6441
+ }));
6442
+ }
6267
6443
  function generateSkills5(canonical) {
6268
6444
  return generateEmbeddedSkills(canonical, CONTINUE_SKILLS_DIR);
6269
6445
  }
6270
6446
  var init_generator6 = __esm({
6271
6447
  "src/targets/continue/generator.ts"() {
6272
6448
  init_embedded_skill();
6449
+ init_projected_agent_skill();
6273
6450
  init_markdown();
6274
6451
  init_command_rule();
6275
6452
  init_constants5();
@@ -6287,7 +6464,7 @@ function readMcpServers(content, extension) {
6287
6464
  servers[name] = {
6288
6465
  type: typeof server.type === "string" ? server.type : "stdio",
6289
6466
  command: server.command,
6290
- args: toStringArray3(server.args),
6467
+ args: toStringArray5(server.args),
6291
6468
  env: toStringRecord(server.env),
6292
6469
  description: typeof server.description === "string" ? server.description : void 0
6293
6470
  };
@@ -6529,6 +6706,7 @@ var init_scope_extras = __esm({
6529
6706
  var target5, project5, globalLayout2, globalCapabilities5, descriptor5;
6530
6707
  var init_continue2 = __esm({
6531
6708
  "src/targets/continue/index.ts"() {
6709
+ init_projected_agent_skill();
6532
6710
  init_generator6();
6533
6711
  init_constants5();
6534
6712
  init_importer5();
@@ -6543,6 +6721,7 @@ var init_continue2 = __esm({
6543
6721
  primaryRootInstructionPath: CONTINUE_ROOT_RULE,
6544
6722
  generateRules: generateRules5,
6545
6723
  generateCommands: generateCommands5,
6724
+ generateAgents: generateAgents5,
6546
6725
  generateSkills: generateSkills5,
6547
6726
  generateMcp: generateMcp5,
6548
6727
  importFrom: importFromContinue
@@ -6561,8 +6740,8 @@ var init_continue2 = __esm({
6561
6740
  commandPath(name, _config) {
6562
6741
  return continueCommandRulePath(name);
6563
6742
  },
6564
- agentPath(_name, _config) {
6565
- return null;
6743
+ agentPath(name) {
6744
+ return `${CONTINUE_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
6566
6745
  }
6567
6746
  }
6568
6747
  };
@@ -6589,8 +6768,8 @@ var init_continue2 = __esm({
6589
6768
  commandPath(name, _config) {
6590
6769
  return `${CONTINUE_PROMPTS_DIR}/${name}.md`;
6591
6770
  },
6592
- agentPath(_name, _config) {
6593
- return null;
6771
+ agentPath(name) {
6772
+ return `${CONTINUE_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
6594
6773
  }
6595
6774
  }
6596
6775
  };
@@ -6620,6 +6799,7 @@ var init_continue2 = __esm({
6620
6799
  permissions: "none"
6621
6800
  },
6622
6801
  emptyImportMessage: "No Continue config found (.continue/rules/*.md, .continue/skills, or .continue/mcpServers/*).",
6802
+ supportsConversion: { agents: true },
6623
6803
  lintRules: lintRules5,
6624
6804
  lint: {
6625
6805
  commands: lintCommands2
@@ -6662,7 +6842,7 @@ var init_continue2 = __esm({
6662
6842
 
6663
6843
  // src/targets/copilot/constants.ts
6664
6844
  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;
6665
- var init_constants12 = __esm({
6845
+ var init_constants14 = __esm({
6666
6846
  "src/targets/copilot/constants.ts"() {
6667
6847
  COPILOT_TARGET = "copilot";
6668
6848
  COPILOT_INSTRUCTIONS = ".github/copilot-instructions.md";
@@ -6727,7 +6907,7 @@ function parseCommandPromptFrontmatter(frontmatter, promptPath) {
6727
6907
  var init_command_prompt = __esm({
6728
6908
  "src/targets/copilot/command-prompt.ts"() {
6729
6909
  init_markdown();
6730
- init_constants12();
6910
+ init_constants14();
6731
6911
  }
6732
6912
  });
6733
6913
 
@@ -6830,7 +7010,7 @@ function generateSkills6(canonical) {
6830
7010
  }
6831
7011
  return outputs;
6832
7012
  }
6833
- function generateAgents4(canonical) {
7013
+ function generateAgents6(canonical) {
6834
7014
  return canonical.agents.map((agent) => {
6835
7015
  const frontmatter = {
6836
7016
  name: agent.name,
@@ -6879,7 +7059,7 @@ function generateHooks3(canonical) {
6879
7059
  var init_generator7 = __esm({
6880
7060
  "src/targets/copilot/generator.ts"() {
6881
7061
  init_markdown();
6882
- init_constants12();
7062
+ init_constants14();
6883
7063
  init_command_prompt();
6884
7064
  init_hook_entry();
6885
7065
  }
@@ -6973,7 +7153,7 @@ async function importHooks(projectRoot, results) {
6973
7153
  var init_hook_parser = __esm({
6974
7154
  "src/targets/copilot/hook-parser.ts"() {
6975
7155
  init_fs();
6976
- init_constants12();
7156
+ init_constants14();
6977
7157
  }
6978
7158
  });
6979
7159
  async function importSkills2(projectRoot, results, normalize, skillsDirRel = COPILOT_SKILLS_DIR) {
@@ -6994,7 +7174,7 @@ async function importSkills2(projectRoot, results, normalize, skillsDirRel = COP
6994
7174
  var init_skills_adapter3 = __esm({
6995
7175
  "src/targets/copilot/skills-adapter.ts"() {
6996
7176
  init_skill_import_pipeline();
6997
- init_constants12();
7177
+ init_constants14();
6998
7178
  }
6999
7179
  });
7000
7180
 
@@ -7017,7 +7197,7 @@ var init_importer6 = __esm({
7017
7197
  "src/targets/copilot/importer.ts"() {
7018
7198
  init_import_rewriter();
7019
7199
  init_descriptor_import_runner();
7020
- init_constants12();
7200
+ init_constants14();
7021
7201
  init_hook_parser();
7022
7202
  init_skills_adapter3();
7023
7203
  init_copilot2();
@@ -7036,7 +7216,7 @@ var init_import_mappers4 = __esm({
7036
7216
  init_import_metadata();
7037
7217
  init_shared_import_helpers();
7038
7218
  init_command_prompt();
7039
- init_constants12();
7219
+ init_constants14();
7040
7220
  copilotLegacyRuleMapper = async ({
7041
7221
  relativePath,
7042
7222
  normalizeTo,
@@ -7153,7 +7333,7 @@ function lintRules6(canonical, projectRoot, projectFiles, options) {
7153
7333
  var init_linter6 = __esm({
7154
7334
  "src/targets/copilot/linter.ts"() {
7155
7335
  init_validate_rules();
7156
- init_constants12();
7336
+ init_constants14();
7157
7337
  }
7158
7338
  });
7159
7339
 
@@ -7270,7 +7450,7 @@ var SCRIPT_PREFIX_RE;
7270
7450
  var init_hook_assets = __esm({
7271
7451
  "src/targets/copilot/hook-assets.ts"() {
7272
7452
  init_fs();
7273
- init_constants12();
7453
+ init_constants14();
7274
7454
  init_hook_entry();
7275
7455
  SCRIPT_PREFIX_RE = /^(?<prefix>\s*(?:(?:bash|sh|zsh)\s+)?)["']?(?<path>(?:\.\.\/|\.\/|[^/\s"'`]+\/)[^\s"'`]+)["']?(?<suffix>(?:\s.*)?)$/;
7276
7456
  }
@@ -7284,7 +7464,7 @@ var generateCopilotGlobalExtras;
7284
7464
  var init_scope_extras2 = __esm({
7285
7465
  "src/targets/copilot/scope-extras.ts"() {
7286
7466
  init_fs();
7287
- init_constants12();
7467
+ init_constants14();
7288
7468
  generateCopilotGlobalExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
7289
7469
  if (scope !== "global" || !enabledFeatures.has("rules")) return [];
7290
7470
  const root = canonical.rules.find((r) => r.root);
@@ -7307,7 +7487,7 @@ var target6, project6, global4, globalCapabilities6, descriptor6;
7307
7487
  var init_copilot2 = __esm({
7308
7488
  "src/targets/copilot/index.ts"() {
7309
7489
  init_generator7();
7310
- init_constants12();
7490
+ init_constants14();
7311
7491
  init_importer6();
7312
7492
  init_import_mappers4();
7313
7493
  init_linter6();
@@ -7321,7 +7501,7 @@ var init_copilot2 = __esm({
7321
7501
  primaryRootInstructionPath: COPILOT_INSTRUCTIONS,
7322
7502
  generateRules: generateRules6,
7323
7503
  generateCommands: generateCommands6,
7324
- generateAgents: generateAgents4,
7504
+ generateAgents: generateAgents6,
7325
7505
  generateSkills: generateSkills6,
7326
7506
  generateHooks: generateHooks3,
7327
7507
  importFrom: importFromCopilot
@@ -7625,7 +7805,7 @@ var init_skills2 = __esm({
7625
7805
  });
7626
7806
 
7627
7807
  // src/targets/cursor/generator/agents.ts
7628
- function generateAgents5(canonical) {
7808
+ function generateAgents7(canonical) {
7629
7809
  return canonical.agents.map((agent) => {
7630
7810
  const frontmatter = {
7631
7811
  name: agent.name,
@@ -8398,7 +8578,7 @@ var init_cursor2 = __esm({
8398
8578
  primaryRootInstructionPath: CURSOR_GENERAL_RULE,
8399
8579
  generateRules: generateRules7,
8400
8580
  generateCommands: generateCommands7,
8401
- generateAgents: generateAgents5,
8581
+ generateAgents: generateAgents7,
8402
8582
  generateSkills: generateSkills7,
8403
8583
  generateMcp: generateMcp6,
8404
8584
  generatePermissions: generatePermissions2,
@@ -8565,7 +8745,7 @@ var init_cursor2 = __esm({
8565
8745
 
8566
8746
  // src/targets/gemini-cli/constants.ts
8567
8747
  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;
8568
- var init_constants13 = __esm({
8748
+ var init_constants15 = __esm({
8569
8749
  "src/targets/gemini-cli/constants.ts"() {
8570
8750
  GEMINI_TARGET = "gemini-cli";
8571
8751
  GEMINI_ROOT = "GEMINI.md";
@@ -8617,7 +8797,7 @@ function generateRules8(canonical) {
8617
8797
  var init_rules3 = __esm({
8618
8798
  "src/targets/gemini-cli/generator/rules.ts"() {
8619
8799
  init_managed_blocks();
8620
- init_constants13();
8800
+ init_constants15();
8621
8801
  }
8622
8802
  });
8623
8803
  function canonicalCommandNameToGeminiTomlPath(cmdName, commandsDir) {
@@ -8657,13 +8837,13 @@ function generateCommands8(canonical) {
8657
8837
  }
8658
8838
  var init_commands2 = __esm({
8659
8839
  "src/targets/gemini-cli/generator/commands.ts"() {
8660
- init_constants13();
8840
+ init_constants15();
8661
8841
  init_command_namespace();
8662
8842
  }
8663
8843
  });
8664
8844
 
8665
8845
  // src/targets/gemini-cli/generator/agents.ts
8666
- function generateAgents6(canonical) {
8846
+ function generateAgents8(canonical) {
8667
8847
  return canonical.agents.map((agent) => {
8668
8848
  const frontmatter = {
8669
8849
  name: agent.name,
@@ -8685,7 +8865,7 @@ function generateAgents6(canonical) {
8685
8865
  var init_agents3 = __esm({
8686
8866
  "src/targets/gemini-cli/generator/agents.ts"() {
8687
8867
  init_markdown();
8688
- init_constants13();
8868
+ init_constants15();
8689
8869
  }
8690
8870
  });
8691
8871
 
@@ -8716,7 +8896,7 @@ function generateSkills8(canonical) {
8716
8896
  var init_skills3 = __esm({
8717
8897
  "src/targets/gemini-cli/generator/skills.ts"() {
8718
8898
  init_markdown();
8719
- init_constants13();
8899
+ init_constants15();
8720
8900
  }
8721
8901
  });
8722
8902
 
@@ -8777,7 +8957,7 @@ function generateGeminiSettingsFiles(canonical) {
8777
8957
  var init_settings = __esm({
8778
8958
  "src/targets/gemini-cli/generator/settings.ts"() {
8779
8959
  init_hook_command();
8780
- init_constants13();
8960
+ init_constants15();
8781
8961
  }
8782
8962
  });
8783
8963
 
@@ -8788,7 +8968,7 @@ function generateIgnore4(canonical) {
8788
8968
  }
8789
8969
  var init_ignore2 = __esm({
8790
8970
  "src/targets/gemini-cli/generator/ignore.ts"() {
8791
- init_constants13();
8971
+ init_constants15();
8792
8972
  }
8793
8973
  });
8794
8974
 
@@ -8889,7 +9069,7 @@ function generateGeminiPermissionsPolicies(canonical) {
8889
9069
  }
8890
9070
  var init_policies_generator = __esm({
8891
9071
  "src/targets/gemini-cli/policies-generator.ts"() {
8892
- init_constants13();
9072
+ init_constants15();
8893
9073
  }
8894
9074
  });
8895
9075
  function mapGeminiHookEvent(event) {
@@ -9017,7 +9197,7 @@ var init_format_helpers_settings = __esm({
9017
9197
  "src/targets/gemini-cli/format-helpers-settings.ts"() {
9018
9198
  init_hook_command();
9019
9199
  init_fs();
9020
- init_constants13();
9200
+ init_constants15();
9021
9201
  init_format_helpers_shared();
9022
9202
  }
9023
9203
  });
@@ -9042,7 +9222,7 @@ async function importGeminiIgnore(projectRoot, results) {
9042
9222
  var init_format_helpers = __esm({
9043
9223
  "src/targets/gemini-cli/format-helpers.ts"() {
9044
9224
  init_fs();
9045
- init_constants13();
9225
+ init_constants15();
9046
9226
  init_format_helpers_shared();
9047
9227
  init_format_helpers_settings();
9048
9228
  }
@@ -9150,7 +9330,7 @@ async function importGeminiPolicies(projectRoot) {
9150
9330
  var init_policies_importer = __esm({
9151
9331
  "src/targets/gemini-cli/policies-importer.ts"() {
9152
9332
  init_fs();
9153
- init_constants13();
9333
+ init_constants15();
9154
9334
  }
9155
9335
  });
9156
9336
  function stripProjectRootCanonicalPrefix(content, projectRoot) {
@@ -9276,7 +9456,7 @@ var init_importer_skills_agents = __esm({
9276
9456
  init_markdown();
9277
9457
  init_import_metadata();
9278
9458
  init_projected_agent_skill();
9279
- init_constants13();
9459
+ init_constants15();
9280
9460
  }
9281
9461
  });
9282
9462
  async function importRootRule2(projectRoot, results, normalize) {
@@ -9352,7 +9532,7 @@ var init_importer8 = __esm({
9352
9532
  init_import_metadata();
9353
9533
  init_embedded_rules();
9354
9534
  init_descriptor_import_runner();
9355
- init_constants13();
9535
+ init_constants15();
9356
9536
  init_gemini_cli2();
9357
9537
  init_format_helpers();
9358
9538
  init_policies_importer();
@@ -9420,7 +9600,7 @@ var init_importer_mappers3 = __esm({
9420
9600
  init_import_metadata();
9421
9601
  init_shared_import_helpers();
9422
9602
  init_format_helpers();
9423
- init_constants13();
9603
+ init_constants15();
9424
9604
  }
9425
9605
  });
9426
9606
 
@@ -9444,7 +9624,7 @@ function lintRules8(canonical, projectRoot, projectFiles, options) {
9444
9624
  var init_linter8 = __esm({
9445
9625
  "src/targets/gemini-cli/linter.ts"() {
9446
9626
  init_validate_rules();
9447
- init_constants13();
9627
+ init_constants15();
9448
9628
  }
9449
9629
  });
9450
9630
 
@@ -9525,7 +9705,7 @@ var init_gemini_cli2 = __esm({
9525
9705
  init_generator11();
9526
9706
  init_capabilities();
9527
9707
  init_policies_generator();
9528
- init_constants13();
9708
+ init_constants15();
9529
9709
  init_importer8();
9530
9710
  init_import_mappers6();
9531
9711
  init_linter8();
@@ -9541,7 +9721,7 @@ var init_gemini_cli2 = __esm({
9541
9721
  primaryRootInstructionPath: GEMINI_ROOT,
9542
9722
  generateRules: generateRules8,
9543
9723
  generateCommands: generateCommands8,
9544
- generateAgents: generateAgents6,
9724
+ generateAgents: generateAgents8,
9545
9725
  generateSkills: generateSkills8,
9546
9726
  generateIgnore: generateIgnore4,
9547
9727
  generatePermissions: generateGeminiPermissionsPolicies,
@@ -9719,7 +9899,261 @@ var init_gemini_cli2 = __esm({
9719
9899
  };
9720
9900
  }
9721
9901
  });
9902
+
9903
+ // src/targets/goose/generator.ts
9722
9904
  function generateRules9(canonical) {
9905
+ const root = canonical.rules.find((rule) => rule.root);
9906
+ const nonRootRules = canonical.rules.filter((rule) => {
9907
+ if (rule.root) return false;
9908
+ return rule.targets.length === 0 || rule.targets.includes(GOOSE_TARGET);
9909
+ });
9910
+ const rootBody = root?.body.trim() ?? "";
9911
+ const content = appendEmbeddedRulesBlock(rootBody, nonRootRules);
9912
+ if (!content) return [];
9913
+ return [{ path: GOOSE_ROOT_FILE, content }];
9914
+ }
9915
+ function generateSkills9(canonical) {
9916
+ return generateEmbeddedSkills(canonical, GOOSE_SKILLS_DIR);
9917
+ }
9918
+ function generateCommands9(canonical) {
9919
+ return canonical.commands.map((command) => ({
9920
+ path: `${GOOSE_SKILLS_DIR}/${commandSkillDirName(command.name)}/SKILL.md`,
9921
+ content: serializeCommandSkill(command)
9922
+ }));
9923
+ }
9924
+ function generateAgents9(canonical) {
9925
+ return canonical.agents.map((agent) => ({
9926
+ path: `${GOOSE_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
9927
+ content: serializeProjectedAgentSkill(agent)
9928
+ }));
9929
+ }
9930
+ function generateIgnore5(canonical) {
9931
+ if (canonical.ignore.length === 0) return [];
9932
+ return [{ path: GOOSE_IGNORE, content: canonical.ignore.join("\n") }];
9933
+ }
9934
+ var init_generator12 = __esm({
9935
+ "src/targets/goose/generator.ts"() {
9936
+ init_embedded_skill();
9937
+ init_managed_blocks();
9938
+ init_projected_agent_skill();
9939
+ init_command_skill();
9940
+ init_constants7();
9941
+ }
9942
+ });
9943
+
9944
+ // src/targets/goose/importer.ts
9945
+ async function importFromGoose(projectRoot, options = {}) {
9946
+ const scope = options.scope ?? "project";
9947
+ const results = [];
9948
+ const normalize = await createImportReferenceNormalizer(GOOSE_TARGET, projectRoot, scope);
9949
+ results.push(...await runDescriptorImport(descriptor9, projectRoot, scope, { normalize }));
9950
+ const skillsDir = scope === "global" ? GOOSE_GLOBAL_SKILLS_DIR : GOOSE_SKILLS_DIR;
9951
+ await importEmbeddedSkills(projectRoot, skillsDir, GOOSE_TARGET, results, normalize);
9952
+ return results;
9953
+ }
9954
+ var init_importer9 = __esm({
9955
+ "src/targets/goose/importer.ts"() {
9956
+ init_import_rewriter();
9957
+ init_embedded_skill();
9958
+ init_descriptor_import_runner();
9959
+ init_constants7();
9960
+ init_goose2();
9961
+ }
9962
+ });
9963
+
9964
+ // src/targets/goose/linter.ts
9965
+ function lintRules9(canonical, projectRoot, projectFiles, options) {
9966
+ return validateRules(canonical, projectRoot, projectFiles, {
9967
+ checkGlobMatches: options?.scope !== "global"
9968
+ }).map((diagnostic) => ({
9969
+ ...diagnostic,
9970
+ target: GOOSE_TARGET
9971
+ }));
9972
+ }
9973
+ var init_linter9 = __esm({
9974
+ "src/targets/goose/linter.ts"() {
9975
+ init_validate_rules();
9976
+ init_constants7();
9977
+ }
9978
+ });
9979
+
9980
+ // src/targets/goose/lint.ts
9981
+ function lintHooks4(canonical) {
9982
+ if (!canonical.hooks) return [];
9983
+ const hasEntries = Object.values(canonical.hooks).some(
9984
+ (entries) => Array.isArray(entries) && entries.length > 0
9985
+ );
9986
+ if (!hasEntries) return [];
9987
+ return [
9988
+ createWarning(
9989
+ ".agentsmesh/hooks.yaml",
9990
+ "goose",
9991
+ "Goose has no lifecycle hook system; canonical hooks are not projected."
9992
+ )
9993
+ ];
9994
+ }
9995
+ function lintPermissions2(canonical) {
9996
+ if (!canonical.permissions) return [];
9997
+ const { allow, deny } = canonical.permissions;
9998
+ const ask = canonical.permissions.ask ?? [];
9999
+ if (allow.length === 0 && deny.length === 0 && ask.length === 0) return [];
10000
+ return [
10001
+ createWarning(
10002
+ ".agentsmesh/permissions.yaml",
10003
+ "goose",
10004
+ "Goose permissions are managed at runtime via permission.yaml in ~/.config/goose/; canonical permissions are not projected."
10005
+ )
10006
+ ];
10007
+ }
10008
+ function lintMcp3(canonical) {
10009
+ if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
10010
+ return [
10011
+ createWarning(
10012
+ ".agentsmesh/mcp.json",
10013
+ "goose",
10014
+ "Goose MCP extensions are configured globally in ~/.config/goose/config.yaml; project-level MCP is not projected."
10015
+ )
10016
+ ];
10017
+ }
10018
+ var init_lint7 = __esm({
10019
+ "src/targets/goose/lint.ts"() {
10020
+ init_helpers();
10021
+ }
10022
+ });
10023
+
10024
+ // src/targets/goose/index.ts
10025
+ var target9, project9, globalLayout3, capabilities, descriptor9;
10026
+ var init_goose2 = __esm({
10027
+ "src/targets/goose/index.ts"() {
10028
+ init_command_skill();
10029
+ init_projected_agent_skill();
10030
+ init_generator12();
10031
+ init_skill_mirror();
10032
+ init_importer9();
10033
+ init_linter9();
10034
+ init_lint7();
10035
+ init_import_map_builders();
10036
+ init_constants7();
10037
+ target9 = {
10038
+ name: GOOSE_TARGET,
10039
+ primaryRootInstructionPath: GOOSE_ROOT_FILE,
10040
+ generateRules: generateRules9,
10041
+ generateCommands: generateCommands9,
10042
+ generateAgents: generateAgents9,
10043
+ generateSkills: generateSkills9,
10044
+ generateIgnore: generateIgnore5,
10045
+ importFrom: importFromGoose
10046
+ };
10047
+ project9 = {
10048
+ rootInstructionPath: GOOSE_ROOT_FILE,
10049
+ skillDir: GOOSE_SKILLS_DIR,
10050
+ managedOutputs: {
10051
+ dirs: [GOOSE_SKILLS_DIR],
10052
+ files: [GOOSE_ROOT_FILE, GOOSE_IGNORE]
10053
+ },
10054
+ paths: {
10055
+ rulePath(_slug) {
10056
+ return GOOSE_ROOT_FILE;
10057
+ },
10058
+ commandPath(name) {
10059
+ return `${GOOSE_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
10060
+ },
10061
+ agentPath(name) {
10062
+ return `${GOOSE_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
10063
+ }
10064
+ }
10065
+ };
10066
+ globalLayout3 = {
10067
+ rootInstructionPath: GOOSE_GLOBAL_ROOT_FILE,
10068
+ skillDir: GOOSE_GLOBAL_SKILLS_DIR,
10069
+ managedOutputs: {
10070
+ dirs: [GOOSE_GLOBAL_SKILLS_DIR],
10071
+ files: [GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE]
10072
+ },
10073
+ rewriteGeneratedPath(path) {
10074
+ if (path === GOOSE_ROOT_FILE) return GOOSE_GLOBAL_ROOT_FILE;
10075
+ if (path === GOOSE_IGNORE) return GOOSE_GLOBAL_IGNORE;
10076
+ if (path.startsWith(`${GOOSE_SKILLS_DIR}/`)) {
10077
+ return path;
10078
+ }
10079
+ return path;
10080
+ },
10081
+ mirrorGlobalPath(path, activeTargets) {
10082
+ return mirrorSkillsToAgents(path, GOOSE_GLOBAL_SKILLS_DIR, activeTargets);
10083
+ },
10084
+ paths: {
10085
+ rulePath(_slug) {
10086
+ return GOOSE_GLOBAL_ROOT_FILE;
10087
+ },
10088
+ commandPath(name) {
10089
+ return `${GOOSE_GLOBAL_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
10090
+ },
10091
+ agentPath(name) {
10092
+ return `${GOOSE_GLOBAL_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
10093
+ }
10094
+ }
10095
+ };
10096
+ capabilities = {
10097
+ rules: "native",
10098
+ additionalRules: "embedded",
10099
+ commands: "none",
10100
+ agents: "none",
10101
+ skills: "native",
10102
+ mcp: "none",
10103
+ hooks: "none",
10104
+ ignore: "native",
10105
+ permissions: "none"
10106
+ };
10107
+ descriptor9 = {
10108
+ id: GOOSE_TARGET,
10109
+ generators: target9,
10110
+ capabilities,
10111
+ emptyImportMessage: "No Goose config found (.goosehints, .agents/skills, or .gooseignore).",
10112
+ lintRules: lintRules9,
10113
+ lint: {
10114
+ hooks: lintHooks4,
10115
+ permissions: lintPermissions2,
10116
+ mcp: lintMcp3
10117
+ },
10118
+ supportsConversion: { commands: true, agents: true },
10119
+ project: project9,
10120
+ globalSupport: {
10121
+ capabilities,
10122
+ detectionPaths: [GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE, GOOSE_GLOBAL_SKILLS_DIR],
10123
+ layout: globalLayout3
10124
+ },
10125
+ importer: {
10126
+ rules: {
10127
+ feature: "rules",
10128
+ mode: "singleFile",
10129
+ source: {
10130
+ project: [GOOSE_ROOT_FILE],
10131
+ global: [GOOSE_GLOBAL_ROOT_FILE]
10132
+ },
10133
+ canonicalDir: GOOSE_CANONICAL_RULES_DIR,
10134
+ canonicalRootFilename: "_root.md",
10135
+ markAsRoot: true
10136
+ },
10137
+ ignore: {
10138
+ feature: "ignore",
10139
+ mode: "flatFile",
10140
+ source: {
10141
+ project: [GOOSE_IGNORE],
10142
+ global: [GOOSE_GLOBAL_IGNORE]
10143
+ },
10144
+ canonicalDir: ".agentsmesh",
10145
+ canonicalFilename: GOOSE_CANONICAL_IGNORE
10146
+ }
10147
+ },
10148
+ sharedArtifacts: {
10149
+ ".agents/skills/": "consumer"
10150
+ },
10151
+ buildImportPaths: buildGooseImportPaths,
10152
+ detectionPaths: [GOOSE_ROOT_FILE, GOOSE_IGNORE]
10153
+ };
10154
+ }
10155
+ });
10156
+ function generateRules10(canonical) {
9723
10157
  const outputs = [];
9724
10158
  const root = canonical.rules.find((rule) => rule.root);
9725
10159
  if (root) {
@@ -9760,7 +10194,7 @@ function generateMcp7(canonical) {
9760
10194
  );
9761
10195
  return [{ path: JUNIE_MCP_FILE, content: JSON.stringify({ mcpServers: servers }, null, 2) }];
9762
10196
  }
9763
- function generateCommands9(canonical) {
10197
+ function generateCommands10(canonical) {
9764
10198
  return canonical.commands.map((command) => {
9765
10199
  const frontmatter = {
9766
10200
  description: command.description || void 0
@@ -9772,7 +10206,7 @@ function generateCommands9(canonical) {
9772
10206
  };
9773
10207
  });
9774
10208
  }
9775
- function generateAgents7(canonical) {
10209
+ function generateAgents10(canonical) {
9776
10210
  return canonical.agents.map((agent) => {
9777
10211
  const frontmatter = {
9778
10212
  name: agent.name,
@@ -9791,11 +10225,11 @@ function generateAgents7(canonical) {
9791
10225
  };
9792
10226
  });
9793
10227
  }
9794
- function generateIgnore5(canonical) {
10228
+ function generateIgnore6(canonical) {
9795
10229
  if (canonical.ignore.length === 0) return [];
9796
10230
  return [{ path: JUNIE_IGNORE, content: canonical.ignore.join("\n") }];
9797
10231
  }
9798
- function generateSkills9(canonical) {
10232
+ function generateSkills10(canonical) {
9799
10233
  return generateEmbeddedSkills(canonical, JUNIE_SKILLS_DIR);
9800
10234
  }
9801
10235
  function renderJunieGlobalInstructions(canonical) {
@@ -9806,13 +10240,13 @@ function renderJunieGlobalInstructions(canonical) {
9806
10240
  });
9807
10241
  return appendEmbeddedRulesBlock(root?.body.trim() ?? "", nonRootRules);
9808
10242
  }
9809
- var init_generator12 = __esm({
10243
+ var init_generator13 = __esm({
9810
10244
  "src/targets/junie/generator.ts"() {
9811
10245
  init_mcp_servers();
9812
10246
  init_embedded_skill();
9813
10247
  init_managed_blocks();
9814
10248
  init_markdown();
9815
- init_constants7();
10249
+ init_constants8();
9816
10250
  }
9817
10251
  });
9818
10252
  async function importRootRule3(projectRoot, results, normalize) {
@@ -9855,11 +10289,11 @@ async function importFromJunie(projectRoot) {
9855
10289
  const results = [];
9856
10290
  const normalize = await createImportReferenceNormalizer(JUNIE_TARGET, projectRoot);
9857
10291
  await importRootRule3(projectRoot, results, normalize);
9858
- results.push(...await runDescriptorImport(descriptor9, projectRoot, "project", { normalize }));
10292
+ results.push(...await runDescriptorImport(descriptor10, projectRoot, "project", { normalize }));
9859
10293
  await importEmbeddedSkills(projectRoot, JUNIE_SKILLS_DIR, JUNIE_TARGET, results, normalize);
9860
10294
  return results;
9861
10295
  }
9862
- var init_importer9 = __esm({
10296
+ var init_importer10 = __esm({
9863
10297
  "src/targets/junie/importer.ts"() {
9864
10298
  init_import_rewriter();
9865
10299
  init_fs();
@@ -9868,13 +10302,13 @@ var init_importer9 = __esm({
9868
10302
  init_embedded_rules();
9869
10303
  init_import_metadata();
9870
10304
  init_descriptor_import_runner();
9871
- init_constants7();
10305
+ init_constants8();
9872
10306
  init_junie2();
9873
10307
  }
9874
10308
  });
9875
10309
 
9876
10310
  // src/targets/junie/linter.ts
9877
- function lintRules9(canonical, projectRoot, projectFiles, options) {
10311
+ function lintRules10(canonical, projectRoot, projectFiles, options) {
9878
10312
  return validateRules(canonical, projectRoot, projectFiles, {
9879
10313
  checkGlobMatches: options?.scope !== "global"
9880
10314
  }).map((diagnostic) => ({
@@ -9882,15 +10316,15 @@ function lintRules9(canonical, projectRoot, projectFiles, options) {
9882
10316
  target: JUNIE_TARGET
9883
10317
  }));
9884
10318
  }
9885
- var init_linter9 = __esm({
10319
+ var init_linter10 = __esm({
9886
10320
  "src/targets/junie/linter.ts"() {
9887
10321
  init_validate_rules();
9888
- init_constants7();
10322
+ init_constants8();
9889
10323
  }
9890
10324
  });
9891
10325
 
9892
10326
  // src/targets/junie/lint.ts
9893
- function lintMcp3(canonical) {
10327
+ function lintMcp4(canonical) {
9894
10328
  if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
9895
10329
  const diagnostics = [];
9896
10330
  for (const [name, server] of Object.entries(canonical.mcp.mcpServers)) {
@@ -9906,7 +10340,7 @@ function lintMcp3(canonical) {
9906
10340
  }
9907
10341
  return diagnostics;
9908
10342
  }
9909
- var init_lint7 = __esm({
10343
+ var init_lint8 = __esm({
9910
10344
  "src/targets/junie/lint.ts"() {
9911
10345
  init_mcp_servers();
9912
10346
  init_helpers();
@@ -9914,28 +10348,28 @@ var init_lint7 = __esm({
9914
10348
  });
9915
10349
 
9916
10350
  // src/targets/junie/index.ts
9917
- var target9, project9, global7, globalCapabilities9, descriptor9;
10351
+ var target10, project10, global7, globalCapabilities9, descriptor10;
9918
10352
  var init_junie2 = __esm({
9919
10353
  "src/targets/junie/index.ts"() {
9920
- init_generator12();
9921
- init_constants7();
10354
+ init_generator13();
10355
+ init_constants8();
9922
10356
  init_skill_mirror();
9923
- init_importer9();
9924
- init_linter9();
9925
- init_lint7();
10357
+ init_importer10();
10358
+ init_linter10();
10359
+ init_lint8();
9926
10360
  init_import_map_builders();
9927
- target9 = {
10361
+ target10 = {
9928
10362
  name: "junie",
9929
10363
  primaryRootInstructionPath: JUNIE_DOT_AGENTS,
9930
- generateRules: generateRules9,
9931
- generateCommands: generateCommands9,
9932
- generateAgents: generateAgents7,
9933
- generateSkills: generateSkills9,
10364
+ generateRules: generateRules10,
10365
+ generateCommands: generateCommands10,
10366
+ generateAgents: generateAgents10,
10367
+ generateSkills: generateSkills10,
9934
10368
  generateMcp: generateMcp7,
9935
- generateIgnore: generateIgnore5,
10369
+ generateIgnore: generateIgnore6,
9936
10370
  importFrom: importFromJunie
9937
10371
  };
9938
- project9 = {
10372
+ project10 = {
9939
10373
  rootInstructionPath: JUNIE_DOT_AGENTS,
9940
10374
  skillDir: ".junie/skills",
9941
10375
  managedOutputs: {
@@ -10017,9 +10451,9 @@ var init_junie2 = __esm({
10017
10451
  ignore: "none",
10018
10452
  permissions: "none"
10019
10453
  };
10020
- descriptor9 = {
10454
+ descriptor10 = {
10021
10455
  id: "junie",
10022
- generators: target9,
10456
+ generators: target10,
10023
10457
  capabilities: {
10024
10458
  rules: "native",
10025
10459
  additionalRules: "native",
@@ -10032,11 +10466,11 @@ var init_junie2 = __esm({
10032
10466
  permissions: "none"
10033
10467
  },
10034
10468
  emptyImportMessage: "No Junie config found (.junie/guidelines.md, .junie/AGENTS.md, .junie/skills, .junie/mcp/mcp.json, or .aiignore).",
10035
- lintRules: lintRules9,
10469
+ lintRules: lintRules10,
10036
10470
  lint: {
10037
- mcp: lintMcp3
10471
+ mcp: lintMcp4
10038
10472
  },
10039
- project: project9,
10473
+ project: project10,
10040
10474
  globalSupport: {
10041
10475
  capabilities: globalCapabilities9,
10042
10476
  detectionPaths: [
@@ -10099,7 +10533,7 @@ var init_junie2 = __esm({
10099
10533
  };
10100
10534
  }
10101
10535
  });
10102
- function generateRules10(canonical) {
10536
+ function generateRules11(canonical) {
10103
10537
  const outputs = [];
10104
10538
  const root = canonical.rules.find((rule) => rule.root);
10105
10539
  if (root) {
@@ -10123,7 +10557,7 @@ function generateRules10(canonical) {
10123
10557
  }
10124
10558
  return outputs;
10125
10559
  }
10126
- function generateCommands10(canonical) {
10560
+ function generateCommands11(canonical) {
10127
10561
  return canonical.commands.map((command) => {
10128
10562
  const frontmatter = {};
10129
10563
  if (command.description) frontmatter.description = command.description;
@@ -10133,7 +10567,7 @@ function generateCommands10(canonical) {
10133
10567
  };
10134
10568
  });
10135
10569
  }
10136
- function generateAgents8(canonical) {
10570
+ function generateAgents11(canonical) {
10137
10571
  return canonical.agents.map((agent) => {
10138
10572
  const slug = basename(agent.source, ".md");
10139
10573
  const frontmatter = { mode: "subagent" };
@@ -10156,18 +10590,18 @@ function generateMcp8(canonical) {
10156
10590
  }
10157
10591
  ];
10158
10592
  }
10159
- function generateIgnore6(canonical) {
10593
+ function generateIgnore7(canonical) {
10160
10594
  if (canonical.ignore.length === 0) return [];
10161
10595
  return [{ path: KILO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
10162
10596
  }
10163
- function generateSkills10(canonical) {
10597
+ function generateSkills11(canonical) {
10164
10598
  return generateEmbeddedSkills(canonical, KILO_CODE_SKILLS_DIR);
10165
10599
  }
10166
- var init_generator13 = __esm({
10600
+ var init_generator14 = __esm({
10167
10601
  "src/targets/kilo-code/generator.ts"() {
10168
10602
  init_embedded_skill();
10169
10603
  init_markdown();
10170
- init_constants8();
10604
+ init_constants9();
10171
10605
  }
10172
10606
  });
10173
10607
  var kiloNonRootRuleMapper, kiloCommandMapper, kiloAgentMapper;
@@ -10175,7 +10609,7 @@ var init_import_mappers7 = __esm({
10175
10609
  "src/targets/kilo-code/import-mappers.ts"() {
10176
10610
  init_markdown();
10177
10611
  init_import_metadata();
10178
- init_constants8();
10612
+ init_constants9();
10179
10613
  kiloNonRootRuleMapper = async ({
10180
10614
  relativePath,
10181
10615
  normalizeTo,
@@ -10352,7 +10786,7 @@ async function importFromKiloCode(projectRoot, options = {}) {
10352
10786
  const scope = options.scope ?? "project";
10353
10787
  const results = [];
10354
10788
  const normalize = await createImportReferenceNormalizer(KILO_CODE_TARGET, projectRoot, scope);
10355
- results.push(...await runDescriptorImport(descriptor10, projectRoot, scope, { normalize }));
10789
+ results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
10356
10790
  await importEmbeddedSkills(
10357
10791
  projectRoot,
10358
10792
  KILO_CODE_SKILLS_DIR,
@@ -10375,7 +10809,7 @@ async function importFromKiloCode(projectRoot, options = {}) {
10375
10809
  return results;
10376
10810
  }
10377
10811
  var CANONICAL_ROOT_RULE_PATH, LEGACY_ROOT_RULE_FILE;
10378
- var init_importer10 = __esm({
10812
+ var init_importer11 = __esm({
10379
10813
  "src/targets/kilo-code/importer.ts"() {
10380
10814
  init_import_rewriter();
10381
10815
  init_embedded_skill();
@@ -10385,7 +10819,7 @@ var init_importer10 = __esm({
10385
10819
  init_import_metadata();
10386
10820
  init_markdown();
10387
10821
  init_import_mappers7();
10388
- init_constants8();
10822
+ init_constants9();
10389
10823
  init_kilo_code2();
10390
10824
  CANONICAL_ROOT_RULE_PATH = `${KILO_CODE_CANONICAL_RULES_DIR}/_root.md`;
10391
10825
  LEGACY_ROOT_RULE_FILE = "00-root.md";
@@ -10393,7 +10827,7 @@ var init_importer10 = __esm({
10393
10827
  });
10394
10828
 
10395
10829
  // src/targets/kilo-code/linter.ts
10396
- function lintRules10(canonical, projectRoot, projectFiles, options) {
10830
+ function lintRules11(canonical, projectRoot, projectFiles, options) {
10397
10831
  return validateRules(canonical, projectRoot, projectFiles, {
10398
10832
  checkGlobMatches: options?.scope !== "global"
10399
10833
  }).map((diagnostic) => ({
@@ -10401,15 +10835,15 @@ function lintRules10(canonical, projectRoot, projectFiles, options) {
10401
10835
  target: KILO_CODE_TARGET
10402
10836
  }));
10403
10837
  }
10404
- var init_linter10 = __esm({
10838
+ var init_linter11 = __esm({
10405
10839
  "src/targets/kilo-code/linter.ts"() {
10406
10840
  init_validate_rules();
10407
- init_constants8();
10841
+ init_constants9();
10408
10842
  }
10409
10843
  });
10410
10844
 
10411
10845
  // src/targets/kilo-code/lint.ts
10412
- function lintHooks4(canonical) {
10846
+ function lintHooks5(canonical) {
10413
10847
  if (!canonical.hooks) return [];
10414
10848
  const hasEntries = Object.values(canonical.hooks).some(
10415
10849
  (entries) => Array.isArray(entries) && entries.length > 0
@@ -10423,7 +10857,7 @@ function lintHooks4(canonical) {
10423
10857
  )
10424
10858
  ];
10425
10859
  }
10426
- function lintPermissions2(canonical) {
10860
+ function lintPermissions3(canonical) {
10427
10861
  if (!canonical.permissions) return [];
10428
10862
  const { allow, deny } = canonical.permissions;
10429
10863
  const ask = canonical.permissions.ask ?? [];
@@ -10436,36 +10870,36 @@ function lintPermissions2(canonical) {
10436
10870
  )
10437
10871
  ];
10438
10872
  }
10439
- var init_lint8 = __esm({
10873
+ var init_lint9 = __esm({
10440
10874
  "src/targets/kilo-code/lint.ts"() {
10441
10875
  init_helpers();
10442
10876
  }
10443
10877
  });
10444
10878
 
10445
10879
  // src/targets/kilo-code/index.ts
10446
- var target10, project10, globalLayout3, capabilities, descriptor10;
10880
+ var target11, project11, globalLayout4, capabilities2, descriptor11;
10447
10881
  var init_kilo_code2 = __esm({
10448
10882
  "src/targets/kilo-code/index.ts"() {
10449
- init_generator13();
10450
- init_constants8();
10883
+ init_generator14();
10884
+ init_constants9();
10451
10885
  init_skill_mirror();
10452
- init_importer10();
10886
+ init_importer11();
10453
10887
  init_import_mappers7();
10454
- init_linter10();
10455
- init_lint8();
10888
+ init_linter11();
10889
+ init_lint9();
10456
10890
  init_import_map_builders();
10457
- target10 = {
10891
+ target11 = {
10458
10892
  name: KILO_CODE_TARGET,
10459
10893
  primaryRootInstructionPath: KILO_CODE_ROOT_RULE,
10460
- generateRules: generateRules10,
10461
- generateCommands: generateCommands10,
10462
- generateAgents: generateAgents8,
10463
- generateSkills: generateSkills10,
10894
+ generateRules: generateRules11,
10895
+ generateCommands: generateCommands11,
10896
+ generateAgents: generateAgents11,
10897
+ generateSkills: generateSkills11,
10464
10898
  generateMcp: generateMcp8,
10465
- generateIgnore: generateIgnore6,
10899
+ generateIgnore: generateIgnore7,
10466
10900
  importFrom: importFromKiloCode
10467
10901
  };
10468
- project10 = {
10902
+ project11 = {
10469
10903
  rootInstructionPath: KILO_CODE_ROOT_RULE,
10470
10904
  skillDir: KILO_CODE_SKILLS_DIR,
10471
10905
  managedOutputs: {
@@ -10484,7 +10918,7 @@ var init_kilo_code2 = __esm({
10484
10918
  }
10485
10919
  }
10486
10920
  };
10487
- globalLayout3 = {
10921
+ globalLayout4 = {
10488
10922
  rootInstructionPath: KILO_CODE_GLOBAL_AGENTS_MD,
10489
10923
  skillDir: KILO_CODE_GLOBAL_SKILLS_DIR,
10490
10924
  managedOutputs: {
@@ -10516,7 +10950,7 @@ var init_kilo_code2 = __esm({
10516
10950
  }
10517
10951
  }
10518
10952
  };
10519
- capabilities = {
10953
+ capabilities2 = {
10520
10954
  rules: "native",
10521
10955
  additionalRules: "native",
10522
10956
  commands: "native",
@@ -10527,19 +10961,19 @@ var init_kilo_code2 = __esm({
10527
10961
  ignore: "native",
10528
10962
  permissions: "none"
10529
10963
  };
10530
- descriptor10 = {
10964
+ descriptor11 = {
10531
10965
  id: KILO_CODE_TARGET,
10532
- generators: target10,
10533
- capabilities,
10966
+ generators: target11,
10967
+ capabilities: capabilities2,
10534
10968
  emptyImportMessage: "No Kilo Code config found (AGENTS.md, .kilo/rules, .kilo/commands, .kilo/agents, .kilo/skills, .kilo/mcp.json, .kilocodeignore, .kilocode/, or .kilocodemodes).",
10535
- lintRules: lintRules10,
10969
+ lintRules: lintRules11,
10536
10970
  lint: {
10537
- hooks: lintHooks4,
10538
- permissions: lintPermissions2
10971
+ hooks: lintHooks5,
10972
+ permissions: lintPermissions3
10539
10973
  },
10540
- project: project10,
10974
+ project: project11,
10541
10975
  globalSupport: {
10542
- capabilities,
10976
+ capabilities: capabilities2,
10543
10977
  detectionPaths: [
10544
10978
  KILO_CODE_GLOBAL_AGENTS_MD,
10545
10979
  KILO_CODE_GLOBAL_RULES_DIR,
@@ -10549,7 +10983,7 @@ var init_kilo_code2 = __esm({
10549
10983
  KILO_CODE_GLOBAL_MCP_FILE,
10550
10984
  KILO_CODE_GLOBAL_IGNORE
10551
10985
  ],
10552
- layout: globalLayout3
10986
+ layout: globalLayout4
10553
10987
  },
10554
10988
  importer: {
10555
10989
  rules: [
@@ -10750,7 +11184,7 @@ function steeringFrontmatter(rule) {
10750
11184
  if (rule.description) frontmatter.description = rule.description;
10751
11185
  return frontmatter;
10752
11186
  }
10753
- function generateRules11(canonical) {
11187
+ function generateRules12(canonical) {
10754
11188
  const outputs = [];
10755
11189
  const root = canonical.rules.find((rule) => rule.root);
10756
11190
  if (root) {
@@ -10767,7 +11201,13 @@ function generateRules11(canonical) {
10767
11201
  }
10768
11202
  return outputs;
10769
11203
  }
10770
- function generateSkills11(canonical) {
11204
+ function generateCommands12(canonical) {
11205
+ return canonical.commands.map((command) => ({
11206
+ path: `${KIRO_SKILLS_DIR}/${commandSkillDirName(command.name)}/SKILL.md`,
11207
+ content: serializeCommandSkill(command)
11208
+ }));
11209
+ }
11210
+ function generateSkills12(canonical) {
10771
11211
  return generateEmbeddedSkills(canonical, KIRO_SKILLS_DIR);
10772
11212
  }
10773
11213
  function generateMcp9(canonical) {
@@ -10786,7 +11226,7 @@ function generateHooks5(canonical) {
10786
11226
  content: hook.content
10787
11227
  }));
10788
11228
  }
10789
- function generateAgents9(canonical) {
11229
+ function generateAgents12(canonical) {
10790
11230
  return canonical.agents.map((agent) => {
10791
11231
  const frontmatter = {
10792
11232
  name: agent.name,
@@ -10801,16 +11241,17 @@ function generateAgents9(canonical) {
10801
11241
  return { path: `${KIRO_AGENTS_DIR}/${agent.name}.md`, content };
10802
11242
  });
10803
11243
  }
10804
- function generateIgnore7(canonical) {
11244
+ function generateIgnore8(canonical) {
10805
11245
  if (canonical.ignore.length === 0) return [];
10806
11246
  return [{ path: KIRO_IGNORE, content: canonical.ignore.join("\n") }];
10807
11247
  }
10808
- var init_generator14 = __esm({
11248
+ var init_generator15 = __esm({
10809
11249
  "src/targets/kiro/generator.ts"() {
10810
11250
  init_embedded_skill();
11251
+ init_command_skill();
10811
11252
  init_markdown();
10812
11253
  init_hook_format();
10813
- init_constants9();
11254
+ init_constants10();
10814
11255
  }
10815
11256
  });
10816
11257
  function canonicalRuleMeta(frontmatter) {
@@ -10899,12 +11340,12 @@ async function importFromKiro(projectRoot, options = {}) {
10899
11340
  const normalize = await createImportReferenceNormalizer(KIRO_TARGET, projectRoot, scope);
10900
11341
  await importRoot(projectRoot, results, normalize, scope);
10901
11342
  await importNonRootRules(projectRoot, results, normalize);
10902
- results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
11343
+ results.push(...await runDescriptorImport(descriptor12, projectRoot, scope, { normalize }));
10903
11344
  await importEmbeddedSkills(projectRoot, KIRO_SKILLS_DIR, KIRO_TARGET, results, normalize);
10904
11345
  if (scope === "project") await importHooks2(projectRoot, results);
10905
11346
  return results;
10906
11347
  }
10907
- var init_importer11 = __esm({
11348
+ var init_importer12 = __esm({
10908
11349
  "src/targets/kiro/importer.ts"() {
10909
11350
  init_import_rewriter();
10910
11351
  init_embedded_skill();
@@ -10915,13 +11356,13 @@ var init_importer11 = __esm({
10915
11356
  init_fs();
10916
11357
  init_markdown();
10917
11358
  init_hook_format();
10918
- init_constants9();
11359
+ init_constants10();
10919
11360
  init_kiro2();
10920
11361
  }
10921
11362
  });
10922
11363
 
10923
11364
  // src/targets/kiro/linter.ts
10924
- function lintRules11(canonical, projectRoot, projectFiles, options) {
11365
+ function lintRules12(canonical, projectRoot, projectFiles, options) {
10925
11366
  return validateRules(canonical, projectRoot, projectFiles, {
10926
11367
  checkGlobMatches: options?.scope !== "global"
10927
11368
  }).map((diagnostic) => ({
@@ -10929,15 +11370,15 @@ function lintRules11(canonical, projectRoot, projectFiles, options) {
10929
11370
  target: KIRO_TARGET
10930
11371
  }));
10931
11372
  }
10932
- var init_linter11 = __esm({
11373
+ var init_linter12 = __esm({
10933
11374
  "src/targets/kiro/linter.ts"() {
10934
11375
  init_validate_rules();
10935
- init_constants9();
11376
+ init_constants10();
10936
11377
  }
10937
11378
  });
10938
11379
 
10939
11380
  // src/targets/kiro/lint.ts
10940
- function lintHooks5(canonical) {
11381
+ function lintHooks6(canonical) {
10941
11382
  if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
10942
11383
  const supported = ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SubagentStop"];
10943
11384
  const supportedSet = new Set(supported);
@@ -10945,184 +11386,652 @@ function lintHooks5(canonical) {
10945
11386
  (event) => createUnsupportedHookWarning(event, "kiro", supported, { unsupportedBy: "Kiro hooks" })
10946
11387
  );
10947
11388
  }
10948
- var init_lint9 = __esm({
10949
- "src/targets/kiro/lint.ts"() {
11389
+ var init_lint10 = __esm({
11390
+ "src/targets/kiro/lint.ts"() {
11391
+ init_helpers();
11392
+ }
11393
+ });
11394
+
11395
+ // src/targets/kiro/index.ts
11396
+ var target12, project12, global8, globalCapabilities10, descriptor12;
11397
+ var init_kiro2 = __esm({
11398
+ "src/targets/kiro/index.ts"() {
11399
+ init_command_skill();
11400
+ init_generator15();
11401
+ init_skill_mirror();
11402
+ init_importer12();
11403
+ init_linter12();
11404
+ init_lint10();
11405
+ init_import_map_builders();
11406
+ init_constants10();
11407
+ target12 = {
11408
+ name: KIRO_TARGET,
11409
+ primaryRootInstructionPath: KIRO_AGENTS_MD,
11410
+ generateRules: generateRules12,
11411
+ generateCommands: generateCommands12,
11412
+ generateAgents: generateAgents12,
11413
+ generateSkills: generateSkills12,
11414
+ generateMcp: generateMcp9,
11415
+ generateHooks: generateHooks5,
11416
+ generateIgnore: generateIgnore8,
11417
+ importFrom: importFromKiro
11418
+ };
11419
+ project12 = {
11420
+ rootInstructionPath: KIRO_AGENTS_MD,
11421
+ skillDir: KIRO_SKILLS_DIR,
11422
+ managedOutputs: {
11423
+ dirs: [".kiro/hooks", ".kiro/skills", ".kiro/steering", ".kiro/agents"],
11424
+ files: ["AGENTS.md", ".kiro/settings/mcp.json", ".kiroignore"]
11425
+ },
11426
+ paths: {
11427
+ rulePath(slug, _rule) {
11428
+ return `${KIRO_STEERING_DIR}/${slug}.md`;
11429
+ },
11430
+ commandPath(name) {
11431
+ return `${KIRO_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
11432
+ },
11433
+ agentPath(name, _config) {
11434
+ return `${KIRO_AGENTS_DIR}/${name}.md`;
11435
+ }
11436
+ }
11437
+ };
11438
+ global8 = {
11439
+ rootInstructionPath: KIRO_GLOBAL_STEERING_AGENTS_MD,
11440
+ skillDir: KIRO_GLOBAL_SKILLS_DIR,
11441
+ managedOutputs: {
11442
+ dirs: [
11443
+ KIRO_GLOBAL_STEERING_DIR,
11444
+ KIRO_GLOBAL_SKILLS_DIR,
11445
+ KIRO_GLOBAL_AGENTS_DIR,
11446
+ KIRO_GLOBAL_AGENTS_SKILLS_DIR
11447
+ ],
11448
+ files: [KIRO_GLOBAL_STEERING_AGENTS_MD, KIRO_GLOBAL_MCP_FILE, KIRO_GLOBAL_IGNORE]
11449
+ },
11450
+ rewriteGeneratedPath(path) {
11451
+ if (path === KIRO_AGENTS_MD) {
11452
+ return KIRO_GLOBAL_STEERING_AGENTS_MD;
11453
+ }
11454
+ if (path.startsWith(`${KIRO_STEERING_DIR}/`)) {
11455
+ return path.replace(`${KIRO_STEERING_DIR}/`, `${KIRO_GLOBAL_STEERING_DIR}/`);
11456
+ }
11457
+ if (path.startsWith(`${KIRO_SKILLS_DIR}/`)) {
11458
+ return path.replace(`${KIRO_SKILLS_DIR}/`, `${KIRO_GLOBAL_SKILLS_DIR}/`);
11459
+ }
11460
+ if (path.startsWith(`${KIRO_AGENTS_DIR}/`)) {
11461
+ return path.replace(`${KIRO_AGENTS_DIR}/`, `${KIRO_GLOBAL_AGENTS_DIR}/`);
11462
+ }
11463
+ if (path === KIRO_MCP_FILE) {
11464
+ return KIRO_GLOBAL_MCP_FILE;
11465
+ }
11466
+ if (path === KIRO_IGNORE) {
11467
+ return KIRO_GLOBAL_IGNORE;
11468
+ }
11469
+ if (path.startsWith(`${KIRO_HOOKS_DIR}/`)) {
11470
+ return null;
11471
+ }
11472
+ return path;
11473
+ },
11474
+ mirrorGlobalPath(path, activeTargets) {
11475
+ return mirrorSkillsToAgents(path, ".kiro/skills", activeTargets);
11476
+ },
11477
+ paths: {
11478
+ rulePath(slug, _rule) {
11479
+ return `${KIRO_GLOBAL_STEERING_DIR}/${slug}.md`;
11480
+ },
11481
+ commandPath(name) {
11482
+ return `${KIRO_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
11483
+ },
11484
+ agentPath(name, _config) {
11485
+ return `${KIRO_GLOBAL_AGENTS_DIR}/${name}.md`;
11486
+ }
11487
+ }
11488
+ };
11489
+ globalCapabilities10 = {
11490
+ rules: "native",
11491
+ additionalRules: "native",
11492
+ commands: "none",
11493
+ agents: "native",
11494
+ skills: "native",
11495
+ mcp: "native",
11496
+ hooks: "none",
11497
+ ignore: "native",
11498
+ permissions: "none"
11499
+ };
11500
+ descriptor12 = {
11501
+ id: KIRO_TARGET,
11502
+ generators: target12,
11503
+ capabilities: {
11504
+ rules: "native",
11505
+ additionalRules: "native",
11506
+ commands: "none",
11507
+ agents: "native",
11508
+ skills: "native",
11509
+ mcp: "native",
11510
+ hooks: "native",
11511
+ ignore: "native",
11512
+ permissions: "none"
11513
+ },
11514
+ emptyImportMessage: "No Kiro config found (AGENTS.md, .kiro/steering, .kiro/skills, .kiro/agents, .kiro/hooks, .kiro/settings/mcp.json, or .kiroignore).",
11515
+ supportsConversion: { commands: true },
11516
+ lintRules: lintRules12,
11517
+ lint: {
11518
+ hooks: lintHooks6
11519
+ },
11520
+ project: project12,
11521
+ globalSupport: {
11522
+ capabilities: globalCapabilities10,
11523
+ detectionPaths: [
11524
+ KIRO_GLOBAL_STEERING_DIR,
11525
+ KIRO_GLOBAL_STEERING_AGENTS_MD,
11526
+ KIRO_GLOBAL_SKILLS_DIR,
11527
+ KIRO_GLOBAL_AGENTS_DIR,
11528
+ KIRO_GLOBAL_MCP_FILE,
11529
+ KIRO_GLOBAL_IGNORE
11530
+ ],
11531
+ layout: global8
11532
+ },
11533
+ importer: {
11534
+ agents: {
11535
+ feature: "agents",
11536
+ mode: "directory",
11537
+ source: { project: [KIRO_AGENTS_DIR], global: [KIRO_AGENTS_DIR] },
11538
+ canonicalDir: KIRO_CANONICAL_AGENTS_DIR,
11539
+ extensions: [".md"],
11540
+ preset: "agent"
11541
+ },
11542
+ mcp: {
11543
+ feature: "mcp",
11544
+ mode: "mcpJson",
11545
+ source: { project: [KIRO_MCP_FILE], global: [KIRO_GLOBAL_MCP_FILE] },
11546
+ canonicalDir: ".agentsmesh",
11547
+ canonicalFilename: KIRO_CANONICAL_MCP
11548
+ },
11549
+ ignore: {
11550
+ feature: "ignore",
11551
+ mode: "flatFile",
11552
+ source: { project: [KIRO_IGNORE], global: [KIRO_GLOBAL_IGNORE] },
11553
+ canonicalDir: ".agentsmesh",
11554
+ canonicalFilename: KIRO_CANONICAL_IGNORE
11555
+ }
11556
+ },
11557
+ buildImportPaths: buildKiroImportPaths,
11558
+ detectionPaths: [
11559
+ KIRO_STEERING_DIR,
11560
+ KIRO_SKILLS_DIR,
11561
+ KIRO_AGENTS_DIR,
11562
+ KIRO_HOOKS_DIR,
11563
+ KIRO_MCP_FILE,
11564
+ KIRO_IGNORE
11565
+ ]
11566
+ };
11567
+ }
11568
+ });
11569
+ function generateRules13(canonical) {
11570
+ const outputs = [];
11571
+ const root = canonical.rules.find((rule) => rule.root);
11572
+ if (root) {
11573
+ outputs.push({
11574
+ path: OPENCODE_ROOT_RULE,
11575
+ content: root.body.trim() ? root.body : ""
11576
+ });
11577
+ }
11578
+ for (const rule of canonical.rules) {
11579
+ if (rule.root) continue;
11580
+ if (rule.targets.length > 0 && !rule.targets.includes(OPENCODE_TARGET)) continue;
11581
+ const slug = basename(rule.source, ".md");
11582
+ const frontmatter = {};
11583
+ if (rule.description) frontmatter.description = rule.description;
11584
+ if (rule.globs.length > 0) frontmatter.globs = rule.globs;
11585
+ const content = Object.keys(frontmatter).length > 0 ? serializeFrontmatter(frontmatter, rule.body.trim() || "") : rule.body.trim() || "";
11586
+ outputs.push({
11587
+ path: `${OPENCODE_RULES_DIR}/${slug}.md`,
11588
+ content
11589
+ });
11590
+ }
11591
+ return outputs;
11592
+ }
11593
+ function generateCommands13(canonical) {
11594
+ return canonical.commands.map((command) => {
11595
+ const frontmatter = {};
11596
+ if (command.description) frontmatter.description = command.description;
11597
+ return {
11598
+ path: `${OPENCODE_COMMANDS_DIR}/${command.name}.md`,
11599
+ content: serializeFrontmatter(frontmatter, command.body.trim() || "")
11600
+ };
11601
+ });
11602
+ }
11603
+ function generateAgents13(canonical) {
11604
+ return canonical.agents.map((agent) => {
11605
+ const slug = basename(agent.source, ".md");
11606
+ const frontmatter = { mode: "subagent" };
11607
+ if (agent.description) frontmatter.description = agent.description;
11608
+ if (agent.model) frontmatter.model = agent.model;
11609
+ if (agent.tools.length > 0) frontmatter.tools = agent.tools;
11610
+ if (agent.disallowedTools.length > 0) frontmatter.disallowedTools = agent.disallowedTools;
11611
+ return {
11612
+ path: `${OPENCODE_AGENTS_DIR}/${slug}.md`,
11613
+ content: serializeFrontmatter(frontmatter, agent.body.trim() || "")
11614
+ };
11615
+ });
11616
+ }
11617
+ function toOpenCodeMcpServer(server) {
11618
+ if ("url" in server) {
11619
+ const entry2 = { type: "remote", url: server.url };
11620
+ if (Object.keys(server.headers).length > 0) entry2.headers = server.headers;
11621
+ if (server.description) entry2.description = server.description;
11622
+ return entry2;
11623
+ }
11624
+ const entry = {
11625
+ type: "local",
11626
+ command: [server.command, ...server.args]
11627
+ };
11628
+ if (Object.keys(server.env).length > 0) entry.environment = server.env;
11629
+ if (server.description) entry.description = server.description;
11630
+ return entry;
11631
+ }
11632
+ function generateMcp10(canonical) {
11633
+ if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
11634
+ const mcpEntries = {};
11635
+ for (const [name, server] of Object.entries(canonical.mcp.mcpServers)) {
11636
+ mcpEntries[name] = toOpenCodeMcpServer(server);
11637
+ }
11638
+ return [
11639
+ {
11640
+ path: OPENCODE_CONFIG_FILE,
11641
+ content: JSON.stringify({ mcp: mcpEntries }, null, 2)
11642
+ }
11643
+ ];
11644
+ }
11645
+ function generateSkills13(canonical) {
11646
+ return generateEmbeddedSkills(canonical, OPENCODE_SKILLS_DIR);
11647
+ }
11648
+ var init_generator16 = __esm({
11649
+ "src/targets/opencode/generator.ts"() {
11650
+ init_embedded_skill();
11651
+ init_markdown();
11652
+ init_constants11();
11653
+ }
11654
+ });
11655
+ function toStringRecord2(value) {
11656
+ if (!value || typeof value !== "object" || Array.isArray(value)) return {};
11657
+ const out = {};
11658
+ for (const [k, v] of Object.entries(value)) {
11659
+ if (typeof v === "string") out[k] = v;
11660
+ }
11661
+ return out;
11662
+ }
11663
+ function parseOpenCodeMcp(content) {
11664
+ let parsed;
11665
+ try {
11666
+ parsed = JSON.parse(content);
11667
+ } catch {
11668
+ return {};
11669
+ }
11670
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
11671
+ const raw = parsed.mcp;
11672
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
11673
+ const out = {};
11674
+ for (const [name, value] of Object.entries(raw)) {
11675
+ if (!value || typeof value !== "object" || Array.isArray(value)) continue;
11676
+ const entry = value;
11677
+ if (typeof entry.url === "string") {
11678
+ out[name] = {
11679
+ type: "url",
11680
+ url: entry.url,
11681
+ headers: toStringRecord2(entry.headers),
11682
+ env: toStringRecord2(entry.environment),
11683
+ ...typeof entry.description === "string" ? { description: entry.description } : {}
11684
+ };
11685
+ continue;
11686
+ }
11687
+ if (Array.isArray(entry.command) && entry.command.length > 0) {
11688
+ const cmdArr = entry.command;
11689
+ const command = cmdArr[0];
11690
+ if (command === void 0) continue;
11691
+ const args = cmdArr.slice(1);
11692
+ out[name] = {
11693
+ type: "stdio",
11694
+ command,
11695
+ args,
11696
+ env: toStringRecord2(entry.environment),
11697
+ ...typeof entry.description === "string" ? { description: entry.description } : {}
11698
+ };
11699
+ }
11700
+ }
11701
+ return out;
11702
+ }
11703
+ async function importMcp4(projectRoot, scope, results) {
11704
+ const configFile = scope === "global" ? OPENCODE_GLOBAL_CONFIG_FILE : OPENCODE_CONFIG_FILE;
11705
+ const srcPath = join(projectRoot, configFile);
11706
+ const content = await readFileSafe(srcPath);
11707
+ if (content === null) return;
11708
+ const imported = parseOpenCodeMcp(content);
11709
+ if (Object.keys(imported).length === 0) return;
11710
+ await writeMcpWithMerge(projectRoot, OPENCODE_CANONICAL_MCP, imported);
11711
+ results.push({
11712
+ feature: "mcp",
11713
+ fromTool: OPENCODE_TARGET,
11714
+ fromPath: srcPath,
11715
+ toPath: OPENCODE_CANONICAL_MCP
11716
+ });
11717
+ }
11718
+ async function importFromOpenCode(projectRoot, options = {}) {
11719
+ const scope = options.scope ?? "project";
11720
+ const results = [];
11721
+ const normalize = await createImportReferenceNormalizer(OPENCODE_TARGET, projectRoot, scope);
11722
+ results.push(...await runDescriptorImport(descriptor13, projectRoot, scope, { normalize }));
11723
+ await importEmbeddedSkills(projectRoot, OPENCODE_SKILLS_DIR, OPENCODE_TARGET, results, normalize);
11724
+ await importMcp4(projectRoot, scope, results);
11725
+ return results;
11726
+ }
11727
+ var init_importer13 = __esm({
11728
+ "src/targets/opencode/importer.ts"() {
11729
+ init_import_rewriter();
11730
+ init_embedded_skill();
11731
+ init_descriptor_import_runner();
11732
+ init_mcp_merge();
11733
+ init_fs();
11734
+ init_constants11();
11735
+ init_opencode2();
11736
+ }
11737
+ });
11738
+ var opencodeNonRootRuleMapper, opencodeCommandMapper, opencodeAgentMapper;
11739
+ var init_import_mappers8 = __esm({
11740
+ "src/targets/opencode/import-mappers.ts"() {
11741
+ init_markdown();
11742
+ init_import_metadata();
11743
+ init_constants11();
11744
+ opencodeNonRootRuleMapper = async ({
11745
+ relativePath,
11746
+ normalizeTo,
11747
+ destDir
11748
+ }) => {
11749
+ const destPath = join(destDir, relativePath);
11750
+ const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
11751
+ return {
11752
+ destPath,
11753
+ toPath: `${OPENCODE_CANONICAL_RULES_DIR}/${relativePath}`,
11754
+ content: await serializeImportedRuleWithFallback(
11755
+ destPath,
11756
+ {
11757
+ root: false,
11758
+ description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
11759
+ globs: Array.isArray(frontmatter.globs) ? frontmatter.globs : void 0
11760
+ },
11761
+ body
11762
+ )
11763
+ };
11764
+ };
11765
+ opencodeCommandMapper = async ({
11766
+ relativePath,
11767
+ normalizeTo,
11768
+ destDir
11769
+ }) => {
11770
+ const destPath = join(destDir, relativePath);
11771
+ const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
11772
+ return {
11773
+ destPath,
11774
+ toPath: `${OPENCODE_CANONICAL_COMMANDS_DIR}/${relativePath}`,
11775
+ content: await serializeImportedCommandWithFallback(
11776
+ destPath,
11777
+ {
11778
+ hasDescription: Object.prototype.hasOwnProperty.call(frontmatter, "description"),
11779
+ description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
11780
+ hasAllowedTools: false,
11781
+ allowedTools: []
11782
+ },
11783
+ body
11784
+ )
11785
+ };
11786
+ };
11787
+ opencodeAgentMapper = async ({
11788
+ relativePath,
11789
+ normalizeTo,
11790
+ destDir
11791
+ }) => {
11792
+ const destPath = join(destDir, relativePath);
11793
+ const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
11794
+ return {
11795
+ destPath,
11796
+ toPath: `${OPENCODE_CANONICAL_AGENTS_DIR}/${relativePath}`,
11797
+ content: await serializeImportedAgentWithFallback(destPath, frontmatter, body)
11798
+ };
11799
+ };
11800
+ }
11801
+ });
11802
+
11803
+ // src/targets/opencode/linter.ts
11804
+ function lintRules13(canonical, projectRoot, projectFiles, options) {
11805
+ return validateRules(canonical, projectRoot, projectFiles, {
11806
+ checkGlobMatches: options?.scope !== "global"
11807
+ }).map((diagnostic) => ({
11808
+ ...diagnostic,
11809
+ target: OPENCODE_TARGET
11810
+ }));
11811
+ }
11812
+ var init_linter13 = __esm({
11813
+ "src/targets/opencode/linter.ts"() {
11814
+ init_validate_rules();
11815
+ init_constants11();
11816
+ }
11817
+ });
11818
+
11819
+ // src/targets/opencode/lint.ts
11820
+ function lintHooks7(canonical) {
11821
+ if (!canonical.hooks) return [];
11822
+ const hasEntries = Object.values(canonical.hooks).some(
11823
+ (entries) => Array.isArray(entries) && entries.length > 0
11824
+ );
11825
+ if (!hasEntries) return [];
11826
+ return [
11827
+ createWarning(
11828
+ ".agentsmesh/hooks.yaml",
11829
+ "opencode",
11830
+ "opencode hooks are plugin-based (TypeScript/JavaScript); canonical config hooks are not projected."
11831
+ )
11832
+ ];
11833
+ }
11834
+ function lintPermissions4(canonical) {
11835
+ if (!canonical.permissions) return [];
11836
+ const { allow, deny } = canonical.permissions;
11837
+ const ask = canonical.permissions.ask ?? [];
11838
+ if (allow.length === 0 && deny.length === 0 && ask.length === 0) return [];
11839
+ return [
11840
+ createWarning(
11841
+ ".agentsmesh/permissions.yaml",
11842
+ "opencode",
11843
+ "opencode permissions live in opencode.json, which agentsmesh does not generate in v1; canonical permissions are not projected."
11844
+ )
11845
+ ];
11846
+ }
11847
+ function lintIgnore(canonical) {
11848
+ if (canonical.ignore.length === 0) return [];
11849
+ return [
11850
+ createWarning(
11851
+ ".agentsmesh/ignore",
11852
+ "opencode",
11853
+ "opencode has no dedicated ignore file; canonical ignore patterns are not projected. Configure watcher.ignore in opencode.json manually."
11854
+ )
11855
+ ];
11856
+ }
11857
+ var init_lint11 = __esm({
11858
+ "src/targets/opencode/lint.ts"() {
10950
11859
  init_helpers();
10951
11860
  }
10952
11861
  });
10953
11862
 
10954
- // src/targets/kiro/index.ts
10955
- var target11, project11, global8, globalCapabilities10, descriptor11;
10956
- var init_kiro2 = __esm({
10957
- "src/targets/kiro/index.ts"() {
10958
- init_generator14();
11863
+ // src/targets/opencode/index.ts
11864
+ var target13, project13, globalLayout5, capabilities3, descriptor13;
11865
+ var init_opencode2 = __esm({
11866
+ "src/targets/opencode/index.ts"() {
11867
+ init_generator16();
11868
+ init_constants11();
10959
11869
  init_skill_mirror();
10960
- init_importer11();
10961
- init_linter11();
10962
- init_lint9();
11870
+ init_importer13();
11871
+ init_import_mappers8();
11872
+ init_linter13();
11873
+ init_lint11();
10963
11874
  init_import_map_builders();
10964
- init_constants9();
10965
- target11 = {
10966
- name: KIRO_TARGET,
10967
- primaryRootInstructionPath: KIRO_AGENTS_MD,
10968
- generateRules: generateRules11,
10969
- generateAgents: generateAgents9,
10970
- generateSkills: generateSkills11,
10971
- generateMcp: generateMcp9,
10972
- generateHooks: generateHooks5,
10973
- generateIgnore: generateIgnore7,
10974
- importFrom: importFromKiro
11875
+ target13 = {
11876
+ name: OPENCODE_TARGET,
11877
+ primaryRootInstructionPath: OPENCODE_ROOT_RULE,
11878
+ generateRules: generateRules13,
11879
+ generateCommands: generateCommands13,
11880
+ generateAgents: generateAgents13,
11881
+ generateSkills: generateSkills13,
11882
+ generateMcp: generateMcp10,
11883
+ importFrom: importFromOpenCode
10975
11884
  };
10976
- project11 = {
10977
- rootInstructionPath: KIRO_AGENTS_MD,
10978
- skillDir: KIRO_SKILLS_DIR,
11885
+ project13 = {
11886
+ rootInstructionPath: OPENCODE_ROOT_RULE,
11887
+ skillDir: OPENCODE_SKILLS_DIR,
10979
11888
  managedOutputs: {
10980
- dirs: [".kiro/hooks", ".kiro/skills", ".kiro/steering", ".kiro/agents"],
10981
- files: ["AGENTS.md", ".kiro/settings/mcp.json", ".kiroignore"]
11889
+ dirs: [OPENCODE_RULES_DIR, OPENCODE_COMMANDS_DIR, OPENCODE_AGENTS_DIR, OPENCODE_SKILLS_DIR],
11890
+ files: [OPENCODE_ROOT_RULE, OPENCODE_CONFIG_FILE]
10982
11891
  },
10983
11892
  paths: {
10984
- rulePath(slug, _rule) {
10985
- return `${KIRO_STEERING_DIR}/${slug}.md`;
11893
+ rulePath(slug) {
11894
+ return `${OPENCODE_RULES_DIR}/${slug}.md`;
10986
11895
  },
10987
- commandPath(_name, _config) {
10988
- return null;
11896
+ commandPath(name) {
11897
+ return `${OPENCODE_COMMANDS_DIR}/${name}.md`;
10989
11898
  },
10990
- agentPath(name, _config) {
10991
- return `${KIRO_AGENTS_DIR}/${name}.md`;
11899
+ agentPath(name) {
11900
+ return `${OPENCODE_AGENTS_DIR}/${name}.md`;
10992
11901
  }
10993
11902
  }
10994
11903
  };
10995
- global8 = {
10996
- rootInstructionPath: KIRO_GLOBAL_STEERING_AGENTS_MD,
10997
- skillDir: KIRO_GLOBAL_SKILLS_DIR,
11904
+ globalLayout5 = {
11905
+ rootInstructionPath: OPENCODE_GLOBAL_AGENTS_MD,
11906
+ skillDir: OPENCODE_GLOBAL_SKILLS_DIR,
10998
11907
  managedOutputs: {
10999
11908
  dirs: [
11000
- KIRO_GLOBAL_STEERING_DIR,
11001
- KIRO_GLOBAL_SKILLS_DIR,
11002
- KIRO_GLOBAL_AGENTS_DIR,
11003
- KIRO_GLOBAL_AGENTS_SKILLS_DIR
11909
+ OPENCODE_GLOBAL_RULES_DIR,
11910
+ OPENCODE_GLOBAL_COMMANDS_DIR,
11911
+ OPENCODE_GLOBAL_AGENTS_DIR,
11912
+ OPENCODE_GLOBAL_SKILLS_DIR,
11913
+ OPENCODE_GLOBAL_AGENTS_SKILLS_DIR
11004
11914
  ],
11005
- files: [KIRO_GLOBAL_STEERING_AGENTS_MD, KIRO_GLOBAL_MCP_FILE, KIRO_GLOBAL_IGNORE]
11915
+ files: [OPENCODE_GLOBAL_AGENTS_MD, OPENCODE_GLOBAL_CONFIG_FILE]
11006
11916
  },
11007
11917
  rewriteGeneratedPath(path) {
11008
- if (path === KIRO_AGENTS_MD) {
11009
- return KIRO_GLOBAL_STEERING_AGENTS_MD;
11010
- }
11011
- if (path.startsWith(`${KIRO_STEERING_DIR}/`)) {
11012
- return path.replace(`${KIRO_STEERING_DIR}/`, `${KIRO_GLOBAL_STEERING_DIR}/`);
11013
- }
11014
- if (path.startsWith(`${KIRO_SKILLS_DIR}/`)) {
11015
- return path.replace(`${KIRO_SKILLS_DIR}/`, `${KIRO_GLOBAL_SKILLS_DIR}/`);
11016
- }
11017
- if (path.startsWith(`${KIRO_AGENTS_DIR}/`)) {
11018
- return path.replace(`${KIRO_AGENTS_DIR}/`, `${KIRO_GLOBAL_AGENTS_DIR}/`);
11019
- }
11020
- if (path === KIRO_MCP_FILE) {
11021
- return KIRO_GLOBAL_MCP_FILE;
11022
- }
11023
- if (path === KIRO_IGNORE) {
11024
- return KIRO_GLOBAL_IGNORE;
11025
- }
11026
- if (path.startsWith(`${KIRO_HOOKS_DIR}/`)) {
11027
- return null;
11028
- }
11918
+ if (path === OPENCODE_ROOT_RULE) return OPENCODE_GLOBAL_AGENTS_MD;
11919
+ if (path === OPENCODE_CONFIG_FILE) return OPENCODE_GLOBAL_CONFIG_FILE;
11029
11920
  return path;
11030
11921
  },
11031
11922
  mirrorGlobalPath(path, activeTargets) {
11032
- return mirrorSkillsToAgents(path, ".kiro/skills", activeTargets);
11923
+ return mirrorSkillsToAgents(path, OPENCODE_GLOBAL_SKILLS_DIR, activeTargets);
11033
11924
  },
11034
11925
  paths: {
11035
- rulePath(slug, _rule) {
11036
- return `${KIRO_GLOBAL_STEERING_DIR}/${slug}.md`;
11926
+ rulePath(slug) {
11927
+ return `${OPENCODE_GLOBAL_RULES_DIR}/${slug}.md`;
11037
11928
  },
11038
- commandPath(_name, _config) {
11039
- return null;
11929
+ commandPath(name) {
11930
+ return `${OPENCODE_GLOBAL_COMMANDS_DIR}/${name}.md`;
11040
11931
  },
11041
- agentPath(name, _config) {
11042
- return `${KIRO_GLOBAL_AGENTS_DIR}/${name}.md`;
11932
+ agentPath(name) {
11933
+ return `${OPENCODE_GLOBAL_AGENTS_DIR}/${name}.md`;
11043
11934
  }
11044
11935
  }
11045
11936
  };
11046
- globalCapabilities10 = {
11937
+ capabilities3 = {
11047
11938
  rules: "native",
11048
11939
  additionalRules: "native",
11049
- commands: "none",
11940
+ commands: "native",
11050
11941
  agents: "native",
11051
11942
  skills: "native",
11052
11943
  mcp: "native",
11053
11944
  hooks: "none",
11054
- ignore: "native",
11945
+ ignore: "none",
11055
11946
  permissions: "none"
11056
11947
  };
11057
- descriptor11 = {
11058
- id: KIRO_TARGET,
11059
- generators: target11,
11060
- capabilities: {
11061
- rules: "native",
11062
- additionalRules: "native",
11063
- commands: "none",
11064
- agents: "native",
11065
- skills: "native",
11066
- mcp: "native",
11067
- hooks: "native",
11068
- ignore: "native",
11069
- permissions: "none"
11070
- },
11071
- emptyImportMessage: "No Kiro config found (AGENTS.md, .kiro/steering, .kiro/skills, .kiro/agents, .kiro/hooks, .kiro/settings/mcp.json, or .kiroignore).",
11072
- lintRules: lintRules11,
11948
+ descriptor13 = {
11949
+ id: OPENCODE_TARGET,
11950
+ generators: target13,
11951
+ capabilities: capabilities3,
11952
+ emptyImportMessage: "No OpenCode config found (AGENTS.md, .opencode/rules, .opencode/commands, .opencode/agents, .opencode/skills, or opencode.json).",
11953
+ lintRules: lintRules13,
11073
11954
  lint: {
11074
- hooks: lintHooks5
11955
+ hooks: lintHooks7,
11956
+ permissions: lintPermissions4,
11957
+ ignore: lintIgnore
11075
11958
  },
11076
- project: project11,
11959
+ project: project13,
11077
11960
  globalSupport: {
11078
- capabilities: globalCapabilities10,
11961
+ capabilities: capabilities3,
11079
11962
  detectionPaths: [
11080
- KIRO_GLOBAL_STEERING_DIR,
11081
- KIRO_GLOBAL_STEERING_AGENTS_MD,
11082
- KIRO_GLOBAL_SKILLS_DIR,
11083
- KIRO_GLOBAL_AGENTS_DIR,
11084
- KIRO_GLOBAL_MCP_FILE,
11085
- KIRO_GLOBAL_IGNORE
11963
+ OPENCODE_GLOBAL_AGENTS_MD,
11964
+ OPENCODE_GLOBAL_RULES_DIR,
11965
+ OPENCODE_GLOBAL_COMMANDS_DIR,
11966
+ OPENCODE_GLOBAL_AGENTS_DIR,
11967
+ OPENCODE_GLOBAL_SKILLS_DIR,
11968
+ OPENCODE_GLOBAL_CONFIG_FILE
11086
11969
  ],
11087
- layout: global8
11970
+ layout: globalLayout5
11088
11971
  },
11089
11972
  importer: {
11973
+ rules: [
11974
+ {
11975
+ feature: "rules",
11976
+ mode: "singleFile",
11977
+ source: {
11978
+ project: [OPENCODE_ROOT_RULE],
11979
+ global: [OPENCODE_GLOBAL_AGENTS_MD]
11980
+ },
11981
+ canonicalDir: OPENCODE_CANONICAL_RULES_DIR,
11982
+ canonicalRootFilename: "_root.md",
11983
+ markAsRoot: true
11984
+ },
11985
+ {
11986
+ feature: "rules",
11987
+ mode: "directory",
11988
+ source: {
11989
+ project: [OPENCODE_RULES_DIR],
11990
+ global: [OPENCODE_GLOBAL_RULES_DIR]
11991
+ },
11992
+ canonicalDir: OPENCODE_CANONICAL_RULES_DIR,
11993
+ extensions: [".md"],
11994
+ map: opencodeNonRootRuleMapper
11995
+ }
11996
+ ],
11997
+ commands: {
11998
+ feature: "commands",
11999
+ mode: "directory",
12000
+ source: {
12001
+ project: [OPENCODE_COMMANDS_DIR],
12002
+ global: [OPENCODE_GLOBAL_COMMANDS_DIR]
12003
+ },
12004
+ canonicalDir: OPENCODE_CANONICAL_COMMANDS_DIR,
12005
+ extensions: [".md"],
12006
+ map: opencodeCommandMapper
12007
+ },
11090
12008
  agents: {
11091
12009
  feature: "agents",
11092
12010
  mode: "directory",
11093
- source: { project: [KIRO_AGENTS_DIR], global: [KIRO_AGENTS_DIR] },
11094
- canonicalDir: KIRO_CANONICAL_AGENTS_DIR,
12011
+ source: {
12012
+ project: [OPENCODE_AGENTS_DIR],
12013
+ global: [OPENCODE_GLOBAL_AGENTS_DIR]
12014
+ },
12015
+ canonicalDir: OPENCODE_CANONICAL_AGENTS_DIR,
11095
12016
  extensions: [".md"],
11096
- preset: "agent"
11097
- },
11098
- mcp: {
11099
- feature: "mcp",
11100
- mode: "mcpJson",
11101
- source: { project: [KIRO_MCP_FILE], global: [KIRO_GLOBAL_MCP_FILE] },
11102
- canonicalDir: ".agentsmesh",
11103
- canonicalFilename: KIRO_CANONICAL_MCP
11104
- },
11105
- ignore: {
11106
- feature: "ignore",
11107
- mode: "flatFile",
11108
- source: { project: [KIRO_IGNORE], global: [KIRO_GLOBAL_IGNORE] },
11109
- canonicalDir: ".agentsmesh",
11110
- canonicalFilename: KIRO_CANONICAL_IGNORE
12017
+ map: opencodeAgentMapper
11111
12018
  }
12019
+ // MCP is imported manually in importer.ts because OpenCode uses `mcp`
12020
+ // key (not `mcpServers`) with a different server format.
11112
12021
  },
11113
- buildImportPaths: buildKiroImportPaths,
12022
+ buildImportPaths: buildOpencodeImportPaths,
11114
12023
  detectionPaths: [
11115
- KIRO_STEERING_DIR,
11116
- KIRO_SKILLS_DIR,
11117
- KIRO_AGENTS_DIR,
11118
- KIRO_HOOKS_DIR,
11119
- KIRO_MCP_FILE,
11120
- KIRO_IGNORE
12024
+ OPENCODE_RULES_DIR,
12025
+ OPENCODE_COMMANDS_DIR,
12026
+ OPENCODE_AGENTS_DIR,
12027
+ OPENCODE_SKILLS_DIR,
12028
+ OPENCODE_CONFIG_FILE,
12029
+ "opencode.jsonc"
11121
12030
  ]
11122
12031
  };
11123
12032
  }
11124
12033
  });
11125
- function generateRules12(canonical) {
12034
+ function generateRules14(canonical) {
11126
12035
  const outputs = [];
11127
12036
  const root = canonical.rules.find((rule) => rule.root);
11128
12037
  if (root) {
@@ -11142,7 +12051,7 @@ function generateRules12(canonical) {
11142
12051
  }
11143
12052
  return outputs;
11144
12053
  }
11145
- function generateCommands11(canonical) {
12054
+ function generateCommands14(canonical) {
11146
12055
  return canonical.commands.map((command) => {
11147
12056
  const frontmatter = {};
11148
12057
  if (command.description) frontmatter.description = command.description;
@@ -11152,7 +12061,7 @@ function generateCommands11(canonical) {
11152
12061
  };
11153
12062
  });
11154
12063
  }
11155
- function generateMcp10(canonical) {
12064
+ function generateMcp11(canonical) {
11156
12065
  if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
11157
12066
  return [
11158
12067
  {
@@ -11161,14 +12070,14 @@ function generateMcp10(canonical) {
11161
12070
  }
11162
12071
  ];
11163
12072
  }
11164
- function generateIgnore8(canonical) {
12073
+ function generateIgnore9(canonical) {
11165
12074
  if (canonical.ignore.length === 0) return [];
11166
12075
  return [{ path: ROO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
11167
12076
  }
11168
- function generateSkills12(canonical) {
12077
+ function generateSkills14(canonical) {
11169
12078
  return generateEmbeddedSkills(canonical, ROO_CODE_SKILLS_DIR);
11170
12079
  }
11171
- function generateAgents10(canonical) {
12080
+ function generateAgents14(canonical) {
11172
12081
  if (canonical.agents.length === 0) return [];
11173
12082
  const customModes = canonical.agents.map((agent) => {
11174
12083
  const slug = basename(agent.source, ".md");
@@ -11179,19 +12088,19 @@ function generateAgents10(canonical) {
11179
12088
  });
11180
12089
  return [{ path: ROO_CODE_MODES_FILE, content: stringify({ customModes }) }];
11181
12090
  }
11182
- var init_generator15 = __esm({
12091
+ var init_generator17 = __esm({
11183
12092
  "src/targets/roo-code/generator.ts"() {
11184
12093
  init_embedded_skill();
11185
12094
  init_markdown();
11186
- init_constants10();
12095
+ init_constants12();
11187
12096
  }
11188
12097
  });
11189
12098
  var rooNonRootRuleMapper, rooCommandMapper;
11190
- var init_import_mappers8 = __esm({
12099
+ var init_import_mappers9 = __esm({
11191
12100
  "src/targets/roo-code/import-mappers.ts"() {
11192
12101
  init_markdown();
11193
12102
  init_import_metadata();
11194
- init_constants10();
12103
+ init_constants12();
11195
12104
  rooNonRootRuleMapper = async ({
11196
12105
  relativePath,
11197
12106
  normalizeTo,
@@ -11275,25 +12184,25 @@ async function importFromRooCode(projectRoot, options = {}) {
11275
12184
  const scope = options.scope ?? "project";
11276
12185
  const results = [];
11277
12186
  const normalize = await createImportReferenceNormalizer(ROO_CODE_TARGET, projectRoot, scope);
11278
- results.push(...await runDescriptorImport(descriptor12, projectRoot, scope, { normalize }));
12187
+ results.push(...await runDescriptorImport(descriptor14, projectRoot, scope, { normalize }));
11279
12188
  await importPerModeRules(projectRoot, results, normalize);
11280
12189
  await importEmbeddedSkills(projectRoot, ROO_CODE_SKILLS_DIR, ROO_CODE_TARGET, results, normalize);
11281
12190
  return results;
11282
12191
  }
11283
- var init_importer12 = __esm({
12192
+ var init_importer14 = __esm({
11284
12193
  "src/targets/roo-code/importer.ts"() {
11285
12194
  init_import_rewriter();
11286
12195
  init_embedded_skill();
11287
12196
  init_import_orchestrator();
11288
12197
  init_descriptor_import_runner();
11289
- init_import_mappers8();
11290
- init_constants10();
12198
+ init_import_mappers9();
12199
+ init_constants12();
11291
12200
  init_roo_code2();
11292
12201
  }
11293
12202
  });
11294
12203
 
11295
12204
  // src/targets/roo-code/linter.ts
11296
- function lintRules12(canonical, projectRoot, projectFiles, options) {
12205
+ function lintRules14(canonical, projectRoot, projectFiles, options) {
11297
12206
  return validateRules(canonical, projectRoot, projectFiles, {
11298
12207
  checkGlobMatches: options?.scope !== "global"
11299
12208
  }).map((diagnostic) => ({
@@ -11301,10 +12210,10 @@ function lintRules12(canonical, projectRoot, projectFiles, options) {
11301
12210
  target: ROO_CODE_TARGET
11302
12211
  }));
11303
12212
  }
11304
- var init_linter12 = __esm({
12213
+ var init_linter14 = __esm({
11305
12214
  "src/targets/roo-code/linter.ts"() {
11306
12215
  init_validate_rules();
11307
- init_constants10();
12216
+ init_constants12();
11308
12217
  }
11309
12218
  });
11310
12219
  function computeStatus5(existing, content) {
@@ -11312,29 +12221,29 @@ function computeStatus5(existing, content) {
11312
12221
  if (existing !== content) return "updated";
11313
12222
  return "unchanged";
11314
12223
  }
11315
- var target12, project12, generateRooGlobalExtras, global9, globalCapabilities11, descriptor12;
12224
+ var target14, project14, generateRooGlobalExtras, global9, globalCapabilities11, descriptor14;
11316
12225
  var init_roo_code2 = __esm({
11317
12226
  "src/targets/roo-code/index.ts"() {
11318
12227
  init_fs();
11319
- init_generator15();
11320
- init_constants10();
12228
+ init_generator17();
12229
+ init_constants12();
11321
12230
  init_skill_mirror();
11322
- init_importer12();
11323
- init_import_mappers8();
11324
- init_linter12();
12231
+ init_importer14();
12232
+ init_import_mappers9();
12233
+ init_linter14();
11325
12234
  init_import_map_builders();
11326
- target12 = {
12235
+ target14 = {
11327
12236
  name: "roo-code",
11328
12237
  primaryRootInstructionPath: ROO_CODE_ROOT_RULE,
11329
- generateRules: generateRules12,
11330
- generateCommands: generateCommands11,
11331
- generateSkills: generateSkills12,
11332
- generateMcp: generateMcp10,
11333
- generateIgnore: generateIgnore8,
11334
- generateAgents: generateAgents10,
12238
+ generateRules: generateRules14,
12239
+ generateCommands: generateCommands14,
12240
+ generateSkills: generateSkills14,
12241
+ generateMcp: generateMcp11,
12242
+ generateIgnore: generateIgnore9,
12243
+ generateAgents: generateAgents14,
11335
12244
  importFrom: importFromRooCode
11336
12245
  };
11337
- project12 = {
12246
+ project14 = {
11338
12247
  rootInstructionPath: ROO_CODE_ROOT_RULE,
11339
12248
  skillDir: ".roo/skills",
11340
12249
  managedOutputs: {
@@ -11442,9 +12351,9 @@ var init_roo_code2 = __esm({
11442
12351
  ignore: "native",
11443
12352
  permissions: "none"
11444
12353
  };
11445
- descriptor12 = {
12354
+ descriptor14 = {
11446
12355
  id: "roo-code",
11447
- generators: target12,
12356
+ generators: target14,
11448
12357
  capabilities: {
11449
12358
  rules: "native",
11450
12359
  additionalRules: "native",
@@ -11457,8 +12366,8 @@ var init_roo_code2 = __esm({
11457
12366
  permissions: "none"
11458
12367
  },
11459
12368
  emptyImportMessage: "No Roo Code config found (.roo/rules, .roo/commands, .roo/skills, .roo/mcp.json, .rooignore, or .roorules).",
11460
- lintRules: lintRules12,
11461
- project: project12,
12369
+ lintRules: lintRules14,
12370
+ project: project14,
11462
12371
  globalSupport: {
11463
12372
  capabilities: globalCapabilities11,
11464
12373
  detectionPaths: [
@@ -11541,7 +12450,7 @@ var init_roo_code2 = __esm({
11541
12450
 
11542
12451
  // src/targets/windsurf/constants.ts
11543
12452
  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;
11544
- var init_constants14 = __esm({
12453
+ var init_constants16 = __esm({
11545
12454
  "src/targets/windsurf/constants.ts"() {
11546
12455
  WINDSURF_TARGET = "windsurf";
11547
12456
  WINDSURF_RULES_ROOT = ".windsurfrules";
@@ -11580,7 +12489,7 @@ function directoryScopedRuleDir(globs) {
11580
12489
  if (dirs.length !== globs.length) return null;
11581
12490
  return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
11582
12491
  }
11583
- function generateRules13(canonical) {
12492
+ function generateRules15(canonical) {
11584
12493
  const outputs = [];
11585
12494
  const root = canonical.rules.find((r) => r.root);
11586
12495
  if (!root) return [];
@@ -11617,23 +12526,23 @@ function generateRules13(canonical) {
11617
12526
  var init_rules4 = __esm({
11618
12527
  "src/targets/windsurf/generator/rules.ts"() {
11619
12528
  init_markdown();
11620
- init_constants14();
12529
+ init_constants16();
11621
12530
  }
11622
12531
  });
11623
12532
 
11624
12533
  // src/targets/windsurf/generator/ignore.ts
11625
- function generateIgnore9(canonical) {
12534
+ function generateIgnore10(canonical) {
11626
12535
  if (!canonical.ignore || canonical.ignore.length === 0) return [];
11627
12536
  return [{ path: CODEIUM_IGNORE, content: canonical.ignore.join("\n") }];
11628
12537
  }
11629
12538
  var init_ignore3 = __esm({
11630
12539
  "src/targets/windsurf/generator/ignore.ts"() {
11631
- init_constants14();
12540
+ init_constants16();
11632
12541
  }
11633
12542
  });
11634
12543
 
11635
12544
  // src/targets/windsurf/generator/workflows.ts
11636
- function generateCommands12(canonical) {
12545
+ function generateCommands15(canonical) {
11637
12546
  return canonical.commands.map((cmd) => {
11638
12547
  const frontmatter = {
11639
12548
  description: cmd.description.trim() || void 0,
@@ -11652,12 +12561,12 @@ function generateCommands12(canonical) {
11652
12561
  var init_workflows = __esm({
11653
12562
  "src/targets/windsurf/generator/workflows.ts"() {
11654
12563
  init_markdown();
11655
- init_constants14();
12564
+ init_constants16();
11656
12565
  }
11657
12566
  });
11658
12567
 
11659
12568
  // src/targets/windsurf/generator/agents.ts
11660
- function generateAgents11(canonical) {
12569
+ function generateAgents15(canonical) {
11661
12570
  return canonical.agents.map((agent) => ({
11662
12571
  path: `${WINDSURF_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
11663
12572
  content: serializeProjectedAgentSkill(agent)
@@ -11666,12 +12575,12 @@ function generateAgents11(canonical) {
11666
12575
  var init_agents4 = __esm({
11667
12576
  "src/targets/windsurf/generator/agents.ts"() {
11668
12577
  init_projected_agent_skill();
11669
- init_constants14();
12578
+ init_constants16();
11670
12579
  }
11671
12580
  });
11672
12581
 
11673
12582
  // src/targets/windsurf/generator/mcp.ts
11674
- function generateMcp11(canonical) {
12583
+ function generateMcp12(canonical) {
11675
12584
  if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
11676
12585
  return [
11677
12586
  {
@@ -11682,7 +12591,7 @@ function generateMcp11(canonical) {
11682
12591
  }
11683
12592
  var init_mcp3 = __esm({
11684
12593
  "src/targets/windsurf/generator/mcp.ts"() {
11685
- init_constants14();
12594
+ init_constants16();
11686
12595
  }
11687
12596
  });
11688
12597
 
@@ -11725,12 +12634,12 @@ function generateHooks6(canonical) {
11725
12634
  var init_hooks2 = __esm({
11726
12635
  "src/targets/windsurf/generator/hooks.ts"() {
11727
12636
  init_hook_command();
11728
- init_constants14();
12637
+ init_constants16();
11729
12638
  }
11730
12639
  });
11731
12640
 
11732
12641
  // src/targets/windsurf/generator/skills.ts
11733
- function generateSkills13(canonical) {
12642
+ function generateSkills15(canonical) {
11734
12643
  const outputs = [];
11735
12644
  for (const skill of canonical.skills) {
11736
12645
  const frontmatter = {
@@ -11752,12 +12661,12 @@ function generateSkills13(canonical) {
11752
12661
  var init_skills4 = __esm({
11753
12662
  "src/targets/windsurf/generator/skills.ts"() {
11754
12663
  init_markdown();
11755
- init_constants14();
12664
+ init_constants16();
11756
12665
  }
11757
12666
  });
11758
12667
 
11759
12668
  // src/targets/windsurf/generator/index.ts
11760
- var init_generator16 = __esm({
12669
+ var init_generator18 = __esm({
11761
12670
  "src/targets/windsurf/generator/index.ts"() {
11762
12671
  init_rules4();
11763
12672
  init_ignore3();
@@ -11770,9 +12679,9 @@ var init_generator16 = __esm({
11770
12679
  });
11771
12680
 
11772
12681
  // src/targets/windsurf/generator.ts
11773
- var init_generator17 = __esm({
12682
+ var init_generator19 = __esm({
11774
12683
  "src/targets/windsurf/generator.ts"() {
11775
- init_generator16();
12684
+ init_generator18();
11776
12685
  }
11777
12686
  });
11778
12687
  function toStringArray8(value) {
@@ -11824,7 +12733,7 @@ var init_importer_workflows = __esm({
11824
12733
  init_fs();
11825
12734
  init_markdown();
11826
12735
  init_import_metadata();
11827
- init_constants14();
12736
+ init_constants16();
11828
12737
  }
11829
12738
  });
11830
12739
  async function importSkills4(projectRoot, results, normalize, skillsRelDir = WINDSURF_SKILLS_DIR) {
@@ -11871,7 +12780,7 @@ var init_skills_adapter5 = __esm({
11871
12780
  init_projected_agent_skill();
11872
12781
  init_scoped_agents_import();
11873
12782
  init_skill_import_pipeline();
11874
- init_constants14();
12783
+ init_constants16();
11875
12784
  }
11876
12785
  });
11877
12786
  async function importWindsurfHooks(projectRoot, results) {
@@ -11969,7 +12878,7 @@ async function importWindsurfMcp(projectRoot, results) {
11969
12878
  var init_importer_hooks_mcp = __esm({
11970
12879
  "src/targets/windsurf/importer-hooks-mcp.ts"() {
11971
12880
  init_fs();
11972
- init_constants14();
12881
+ init_constants16();
11973
12882
  }
11974
12883
  });
11975
12884
  async function importFromWindsurf(projectRoot, options) {
@@ -12106,7 +13015,7 @@ async function importFromWindsurf(projectRoot, options) {
12106
13015
  await importWindsurfMcp(projectRoot, results);
12107
13016
  return results;
12108
13017
  }
12109
- var init_importer13 = __esm({
13018
+ var init_importer15 = __esm({
12110
13019
  "src/targets/windsurf/importer.ts"() {
12111
13020
  init_import_rewriter();
12112
13021
  init_fs();
@@ -12114,13 +13023,13 @@ var init_importer13 = __esm({
12114
13023
  init_import_metadata();
12115
13024
  init_import_orchestrator();
12116
13025
  init_scoped_agents_import();
12117
- init_constants14();
13026
+ init_constants16();
12118
13027
  init_importer_workflows();
12119
13028
  init_skills_adapter5();
12120
13029
  init_importer_hooks_mcp();
12121
13030
  }
12122
13031
  });
12123
- function lintRules13(canonical, projectRoot, _projectFiles) {
13032
+ function lintRules15(canonical, projectRoot, _projectFiles) {
12124
13033
  const diags = [];
12125
13034
  const { rules } = canonical;
12126
13035
  if (rules.length > 0) {
@@ -12147,9 +13056,9 @@ function lintRules13(canonical, projectRoot, _projectFiles) {
12147
13056
  }
12148
13057
  return diags;
12149
13058
  }
12150
- var init_linter13 = __esm({
13059
+ var init_linter15 = __esm({
12151
13060
  "src/targets/windsurf/linter.ts"() {
12152
- init_constants14();
13061
+ init_constants16();
12153
13062
  }
12154
13063
  });
12155
13064
 
@@ -12163,7 +13072,7 @@ function lintCommands6(canonical) {
12163
13072
  )
12164
13073
  );
12165
13074
  }
12166
- function lintMcp4(canonical) {
13075
+ function lintMcp5(canonical) {
12167
13076
  if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
12168
13077
  return [
12169
13078
  createWarning(
@@ -12173,7 +13082,7 @@ function lintMcp4(canonical) {
12173
13082
  )
12174
13083
  ];
12175
13084
  }
12176
- var init_lint10 = __esm({
13085
+ var init_lint12 = __esm({
12177
13086
  "src/targets/windsurf/lint.ts"() {
12178
13087
  init_helpers();
12179
13088
  }
@@ -12186,32 +13095,32 @@ function directoryScopedRuleDir2(globs) {
12186
13095
  if (dirs.length !== globs.length) return null;
12187
13096
  return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
12188
13097
  }
12189
- var target13, project13, global10, globalCapabilities12, descriptor13;
13098
+ var target15, project15, global10, globalCapabilities12, descriptor15;
12190
13099
  var init_windsurf2 = __esm({
12191
13100
  "src/targets/windsurf/index.ts"() {
12192
- init_generator17();
13101
+ init_generator19();
12193
13102
  init_capabilities();
12194
- init_constants14();
13103
+ init_constants16();
12195
13104
  init_skill_mirror();
12196
- init_importer13();
12197
- init_linter13();
12198
- init_lint10();
13105
+ init_importer15();
13106
+ init_linter15();
13107
+ init_lint12();
12199
13108
  init_import_map_builders();
12200
13109
  init_conversions();
12201
13110
  init_projected_agent_skill();
12202
- target13 = {
13111
+ target15 = {
12203
13112
  name: "windsurf",
12204
13113
  primaryRootInstructionPath: WINDSURF_AGENTS_MD,
12205
- generateRules: generateRules13,
12206
- generateCommands: generateCommands12,
12207
- generateAgents: generateAgents11,
12208
- generateSkills: generateSkills13,
12209
- generateMcp: generateMcp11,
13114
+ generateRules: generateRules15,
13115
+ generateCommands: generateCommands15,
13116
+ generateAgents: generateAgents15,
13117
+ generateSkills: generateSkills15,
13118
+ generateMcp: generateMcp12,
12210
13119
  generateHooks: generateHooks6,
12211
- generateIgnore: generateIgnore9,
13120
+ generateIgnore: generateIgnore10,
12212
13121
  importFrom: importFromWindsurf
12213
13122
  };
12214
- project13 = {
13123
+ project15 = {
12215
13124
  rootInstructionPath: WINDSURF_AGENTS_MD,
12216
13125
  extraRuleOutputPaths(rule) {
12217
13126
  if (rule.root) return [WINDSURF_AGENTS_MD];
@@ -12306,9 +13215,9 @@ var init_windsurf2 = __esm({
12306
13215
  ignore: "native",
12307
13216
  permissions: "none"
12308
13217
  };
12309
- descriptor13 = {
13218
+ descriptor15 = {
12310
13219
  id: "windsurf",
12311
- generators: target13,
13220
+ generators: target15,
12312
13221
  capabilities: {
12313
13222
  rules: "native",
12314
13223
  additionalRules: "native",
@@ -12322,12 +13231,12 @@ var init_windsurf2 = __esm({
12322
13231
  },
12323
13232
  emptyImportMessage: "No Windsurf config found (.windsurfrules, .windsurf/rules, .windsurfignore, or .codeiumignore).",
12324
13233
  supportsConversion: { agents: true },
12325
- lintRules: lintRules13,
13234
+ lintRules: lintRules15,
12326
13235
  lint: {
12327
13236
  commands: lintCommands6,
12328
- mcp: lintMcp4
13237
+ mcp: lintMcp5
12329
13238
  },
12330
- project: project13,
13239
+ project: project15,
12331
13240
  globalSupport: {
12332
13241
  capabilities: globalCapabilities12,
12333
13242
  detectionPaths: [
@@ -12370,67 +13279,80 @@ function builtinTargetsMap() {
12370
13279
  }
12371
13280
  return _builtinTargetsMap;
12372
13281
  }
12373
- function getBuiltinTargetDefinition(target14) {
12374
- return builtinTargetsMap().get(target14);
13282
+ function getBuiltinTargetDefinition(target16) {
13283
+ return builtinTargetsMap().get(target16);
12375
13284
  }
12376
- function getTargetCapabilities(target14, scope = "project") {
12377
- const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
12378
- if (!descriptor14) return void 0;
12379
- const raw = scope === "global" ? descriptor14.globalSupport?.capabilities ?? descriptor14.capabilities : descriptor14.capabilities;
13285
+ function getTargetCapabilities(target16, scope = "project") {
13286
+ const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
13287
+ if (!descriptor16) return void 0;
13288
+ const raw = scope === "global" ? descriptor16.globalSupport?.capabilities ?? descriptor16.capabilities : descriptor16.capabilities;
12380
13289
  return normalizeTargetCapabilities(raw);
12381
13290
  }
12382
- function getTargetDetectionPaths(target14, scope = "project") {
12383
- const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
12384
- if (!descriptor14) return [];
13291
+ function getTargetDetectionPaths(target16, scope = "project") {
13292
+ const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
13293
+ if (!descriptor16) return [];
12385
13294
  if (scope === "global") {
12386
- return descriptor14.globalSupport?.detectionPaths ?? [];
13295
+ return descriptor16.globalSupport?.detectionPaths ?? [];
12387
13296
  }
12388
- return descriptor14.detectionPaths;
13297
+ return descriptor16.detectionPaths;
12389
13298
  }
12390
- function getTargetLayout(target14, scope = "project") {
12391
- const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
12392
- if (!descriptor14) return void 0;
13299
+ function getTargetLayout(target16, scope = "project") {
13300
+ const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
13301
+ if (!descriptor16) return void 0;
12393
13302
  if (scope === "global") {
12394
- return descriptor14.globalSupport?.layout;
13303
+ return descriptor16.globalSupport?.layout;
12395
13304
  }
12396
- return descriptor14.project;
13305
+ return descriptor16.project;
12397
13306
  }
12398
- function getTargetPrimaryRootInstructionPath(target14, scope = "project") {
12399
- return getTargetLayout(target14, scope)?.rootInstructionPath;
13307
+ function getTargetPrimaryRootInstructionPath(target16, scope = "project") {
13308
+ return getTargetLayout(target16, scope)?.rootInstructionPath;
12400
13309
  }
12401
- function getTargetSkillDir(target14, scope = "project") {
12402
- return getTargetLayout(target14, scope)?.skillDir;
13310
+ function getTargetSkillDir(target16, scope = "project") {
13311
+ return getTargetLayout(target16, scope)?.skillDir;
12403
13312
  }
12404
- function getTargetManagedOutputs(target14, scope = "project") {
12405
- return getTargetLayout(target14, scope)?.managedOutputs;
13313
+ function getTargetManagedOutputs(target16, scope = "project") {
13314
+ return getTargetLayout(target16, scope)?.managedOutputs;
12406
13315
  }
12407
- function rewriteGeneratedOutputPath(target14, path, scope = "project") {
12408
- const layout = getTargetLayout(target14, scope);
13316
+ function rewriteGeneratedOutputPath(target16, path, scope = "project") {
13317
+ const layout = getTargetLayout(target16, scope);
12409
13318
  if (!layout) return null;
12410
13319
  return layout.rewriteGeneratedPath ? layout.rewriteGeneratedPath(path) : path;
12411
13320
  }
12412
- function isFeatureSuppressedByConversion(descriptor14, feature, config, scope) {
12413
- if (!descriptor14 || !config) return false;
12414
- if (feature === "commands" && descriptor14.supportsConversion?.commands) {
12415
- return !shouldConvertCommandsToSkills(config, descriptor14.id, true, scope);
13321
+ function isFeatureSuppressedByConversion(descriptor16, feature, config, scope) {
13322
+ if (!descriptor16 || !config) return false;
13323
+ if (feature === "commands" && descriptor16.supportsConversion?.commands) {
13324
+ return !shouldConvertCommandsToSkills(config, descriptor16.id, true, scope);
13325
+ }
13326
+ if (feature === "agents" && descriptor16.supportsConversion?.agents) {
13327
+ return !shouldConvertAgentsToSkills(config, descriptor16.id, true, scope);
13328
+ }
13329
+ return false;
13330
+ }
13331
+ function isConversionUpgrading(descriptor16, feature, config, scope) {
13332
+ if (!descriptor16 || !config) return false;
13333
+ if (feature === "commands" && descriptor16.supportsConversion?.commands) {
13334
+ return shouldConvertCommandsToSkills(config, descriptor16.id, true, scope);
12416
13335
  }
12417
- if (feature === "agents" && descriptor14.supportsConversion?.agents) {
12418
- return !shouldConvertAgentsToSkills(config, descriptor14.id, true, scope);
13336
+ if (feature === "agents" && descriptor16.supportsConversion?.agents) {
13337
+ return shouldConvertAgentsToSkills(config, descriptor16.id, true, scope);
12419
13338
  }
12420
13339
  return false;
12421
13340
  }
12422
- function getEffectiveTargetSupportLevel(target14, feature, config, scope = "project") {
12423
- const baseLevel = getTargetCapabilities(target14, scope)?.[feature]?.level ?? "none";
13341
+ function getEffectiveTargetSupportLevel(target16, feature, config, scope = "project") {
13342
+ const baseLevel = getTargetCapabilities(target16, scope)?.[feature]?.level ?? "none";
13343
+ const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
13344
+ if (baseLevel === "none" && isConversionUpgrading(descriptor16, feature, config, scope)) {
13345
+ return "embedded";
13346
+ }
12424
13347
  if (baseLevel !== "embedded") return baseLevel;
12425
- const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
12426
- return isFeatureSuppressedByConversion(descriptor14, feature, config, scope) ? "none" : baseLevel;
13348
+ return isFeatureSuppressedByConversion(descriptor16, feature, config, scope) ? "none" : baseLevel;
12427
13349
  }
12428
- function resolveTargetFeatureGenerator(target14, feature, config, scope = "project") {
12429
- const descriptor14 = getBuiltinTargetDefinition(target14) ?? getDescriptor(target14);
12430
- if (!descriptor14?.generators) return void 0;
12431
- if (isFeatureSuppressedByConversion(descriptor14, feature, config, scope)) return void 0;
13350
+ function resolveTargetFeatureGenerator(target16, feature, config, scope = "project") {
13351
+ const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
13352
+ if (!descriptor16?.generators) return void 0;
13353
+ if (isFeatureSuppressedByConversion(descriptor16, feature, config, scope)) return void 0;
12432
13354
  const pick = PICK_FEATURE_GENERATOR[feature];
12433
- return pick === null ? void 0 : pick(descriptor14.generators);
13355
+ return pick === null ? void 0 : pick(descriptor16.generators);
12434
13356
  }
12435
13357
  var BUILTIN_TARGETS, _builtinTargetsMap, PICK_FEATURE_GENERATOR;
12436
13358
  var init_builtin_targets = __esm({
@@ -12448,9 +13370,11 @@ var init_builtin_targets = __esm({
12448
13370
  init_copilot2();
12449
13371
  init_cursor2();
12450
13372
  init_gemini_cli2();
13373
+ init_goose2();
12451
13374
  init_junie2();
12452
13375
  init_kilo_code2();
12453
13376
  init_kiro2();
13377
+ init_opencode2();
12454
13378
  init_roo_code2();
12455
13379
  init_windsurf2();
12456
13380
  BUILTIN_TARGETS = [
@@ -12466,7 +13390,9 @@ var init_builtin_targets = __esm({
12466
13390
  descriptor10,
12467
13391
  descriptor11,
12468
13392
  descriptor12,
12469
- descriptor13
13393
+ descriptor13,
13394
+ descriptor14,
13395
+ descriptor15
12470
13396
  ];
12471
13397
  PICK_FEATURE_GENERATOR = {
12472
13398
  rules: (g) => g.generateRules,
@@ -12486,8 +13412,8 @@ var init_builtin_targets = __esm({
12486
13412
  init_builtin_targets();
12487
13413
  init_registry();
12488
13414
  init_descriptor_import_runner();
12489
- function copyCapabilities(capabilities2) {
12490
- return Object.freeze({ ...capabilities2 });
13415
+ function copyCapabilities(capabilities4) {
13416
+ return Object.freeze({ ...capabilities4 });
12491
13417
  }
12492
13418
  function copyGenerators(generators) {
12493
13419
  return Object.freeze({ ...generators });
@@ -12520,17 +13446,17 @@ function copyGlobalSupport(globalSupport) {
12520
13446
  layout: copyLayout(globalSupport.layout)
12521
13447
  });
12522
13448
  }
12523
- function copyTargetDescriptor(descriptor14) {
13449
+ function copyTargetDescriptor(descriptor16) {
12524
13450
  return Object.freeze({
12525
- ...descriptor14,
12526
- generators: copyGenerators(descriptor14.generators),
12527
- capabilities: copyCapabilities(descriptor14.capabilities),
12528
- globalSupport: descriptor14.globalSupport === void 0 ? void 0 : copyGlobalSupport(descriptor14.globalSupport),
12529
- lint: descriptor14.lint === void 0 ? void 0 : Object.freeze({ ...descriptor14.lint }),
12530
- project: copyLayout(descriptor14.project),
12531
- supportsConversion: descriptor14.supportsConversion === void 0 ? void 0 : Object.freeze({ ...descriptor14.supportsConversion }),
12532
- detectionPaths: Object.freeze([...descriptor14.detectionPaths]),
12533
- sharedArtifacts: descriptor14.sharedArtifacts === void 0 ? void 0 : Object.freeze({ ...descriptor14.sharedArtifacts })
13451
+ ...descriptor16,
13452
+ generators: copyGenerators(descriptor16.generators),
13453
+ capabilities: copyCapabilities(descriptor16.capabilities),
13454
+ globalSupport: descriptor16.globalSupport === void 0 ? void 0 : copyGlobalSupport(descriptor16.globalSupport),
13455
+ lint: descriptor16.lint === void 0 ? void 0 : Object.freeze({ ...descriptor16.lint }),
13456
+ project: copyLayout(descriptor16.project),
13457
+ supportsConversion: descriptor16.supportsConversion === void 0 ? void 0 : Object.freeze({ ...descriptor16.supportsConversion }),
13458
+ detectionPaths: Object.freeze([...descriptor16.detectionPaths]),
13459
+ sharedArtifacts: descriptor16.sharedArtifacts === void 0 ? void 0 : Object.freeze({ ...descriptor16.sharedArtifacts })
12534
13460
  });
12535
13461
  }
12536
13462
  function getTargetCatalog() {