agentsmesh 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Align `agentsmesh init` default `targets` with the shared target catalog (`TARGET_IDS`) so new configs include every supported tool without a duplicate list. Shorten the AgentsMesh sourcing note appended to generated root instructions.
8
+
3
9
  ## 0.2.9
4
10
 
5
11
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -2534,64 +2534,57 @@ import { join as join15, dirname as dirname9 } from "path";
2534
2534
  import { basename as basename8, dirname as dirname5 } from "path";
2535
2535
 
2536
2536
  // src/targets/projection/root-instruction-paragraph.ts
2537
- var ROOT_INSTRUCTION_BODY_LEGACY = "AgentsMesh is a config sync library for AI coding tools. The only canonical source of truth is `.agentsmesh/`; files emitted into target formats such as `AGENTS.md`, `.claude/`, `.cursor/`, `.junie/`, and similar directories are generated artifacts. When making changes, edit canonical config first, then regenerate and verify the target outputs. Preserve the library's bidirectional contract: import native tool config into canonical form, generate back to target-specific layouts, and keep projected or embedded features round-trippable rather than treating them as plain text exports.";
2538
- var ROOT_INSTRUCTION_BODY = "AgentsMesh is a config sync library for AI coding tools. The only canonical source of truth is the `.agentsmesh` directory at the project root; files emitted into target formats such as `AGENTS.md`, `.claude/`, `.cursor/`, `.junie/`, and similar directories are generated artifacts. When making changes, edit canonical config first, then regenerate and verify the target outputs. Preserve the library's bidirectional contract: import native tool config into canonical form, generate back to target-specific layouts, and keep projected or embedded features round-trippable rather than treating them as plain text exports.";
2539
- var LEGACY_AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH = ROOT_INSTRUCTION_BODY_LEGACY;
2537
+ var ROOT_INSTRUCTION_BODY_V1 = "AgentsMesh is a config sync library for AI coding tools. The only canonical source of truth is `.agentsmesh/`; files emitted into target formats such as `AGENTS.md`, `.claude/`, `.cursor/`, `.junie/`, and similar directories are generated artifacts. When making changes, edit canonical config first, then regenerate and verify the target outputs. Preserve the library's bidirectional contract: import native tool config into canonical form, generate back to target-specific layouts, and keep projected or embedded features round-trippable rather than treating them as plain text exports.";
2538
+ var ROOT_INSTRUCTION_BODY_V2 = "AgentsMesh is a config sync library for AI coding tools. The only canonical source of truth is the `.agentsmesh` directory at the project root; files emitted into target formats such as `AGENTS.md`, `.claude/`, `.cursor/`, `.junie/`, and similar directories are generated artifacts. When making changes, edit canonical config first, then regenerate and verify the target outputs. Preserve the library's bidirectional contract: import native tool config into canonical form, generate back to target-specific layouts, and keep projected or embedded features round-trippable rather than treating them as plain text exports.";
2539
+ var ROOT_INSTRUCTION_BODY = "AgentsMesh syncs AI coding tool configuration from a single canonical `.agentsmesh` directory. All target-specific files (`.claude/`, `.cursor/`, `AGENTS.md`, etc.) are generated artifacts \u2014 edit canonical config first, then regenerate. The import/generate contract is bidirectional and lossless: embedded or projected features round-trip without data loss.";
2540
+ var LEGACY_AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH = ROOT_INSTRUCTION_BODY_V1;
2540
2541
  var LEGACY_AGENTSMESH_ROOT_INSTRUCTION_SECTION = `## Project-Specific Rules
2541
2542
 
2542
- ${ROOT_INSTRUCTION_BODY_LEGACY}`;
2543
- var AGENTSMESH_CONTRACT_WITH_LEGACY_BODY = `## AgentsMesh Generation Contract
2543
+ ${ROOT_INSTRUCTION_BODY_V1}`;
2544
+ var AGENTSMESH_CONTRACT_WITH_V1_BODY = `## AgentsMesh Generation Contract
2544
2545
 
2545
- ${ROOT_INSTRUCTION_BODY_LEGACY}`;
2546
+ ${ROOT_INSTRUCTION_BODY_V1}`;
2547
+ var AGENTSMESH_CONTRACT_WITH_V2_BODY = `## AgentsMesh Generation Contract
2548
+
2549
+ ${ROOT_INSTRUCTION_BODY_V2}`;
2546
2550
  var AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH = `## AgentsMesh Generation Contract
2547
2551
 
2548
2552
  ${ROOT_INSTRUCTION_BODY}`;
2549
2553
  function normalizeWhitespace(value) {
2550
2554
  return value.replace(/\s+/g, " ").trim();
2551
2555
  }
2556
+ var LEGACY_FORMS = [
2557
+ AGENTSMESH_CONTRACT_WITH_V2_BODY,
2558
+ AGENTSMESH_CONTRACT_WITH_V1_BODY,
2559
+ LEGACY_AGENTSMESH_ROOT_INSTRUCTION_SECTION,
2560
+ LEGACY_AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH
2561
+ ];
2552
2562
  function appendAgentsmeshRootInstructionParagraph(content) {
2553
2563
  const trimmed = content.trim();
2554
- if (normalizeWhitespace(trimmed).includes(
2555
- normalizeWhitespace(AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH)
2556
- )) {
2564
+ const norm2 = normalizeWhitespace(trimmed);
2565
+ if (norm2.includes(normalizeWhitespace(AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH))) {
2557
2566
  return trimmed;
2558
2567
  }
2559
- if (normalizeWhitespace(trimmed).includes(
2560
- normalizeWhitespace(LEGACY_AGENTSMESH_ROOT_INSTRUCTION_SECTION)
2561
- )) {
2562
- return trimmed.replace(
2563
- LEGACY_AGENTSMESH_ROOT_INSTRUCTION_SECTION,
2564
- AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH
2565
- );
2566
- }
2567
- if (normalizeWhitespace(trimmed).includes(normalizeWhitespace(AGENTSMESH_CONTRACT_WITH_LEGACY_BODY))) {
2568
- return trimmed.replace(
2569
- AGENTSMESH_CONTRACT_WITH_LEGACY_BODY,
2570
- AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH
2571
- );
2572
- }
2573
- if (normalizeWhitespace(trimmed).includes(
2574
- normalizeWhitespace(LEGACY_AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH)
2575
- )) {
2576
- return trimmed.replace(
2577
- LEGACY_AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH,
2578
- AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH
2579
- );
2568
+ for (const legacy of LEGACY_FORMS) {
2569
+ if (norm2.includes(normalizeWhitespace(legacy))) {
2570
+ return trimmed.replace(legacy, AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH);
2571
+ }
2580
2572
  }
2581
2573
  return trimmed ? `${trimmed}
2582
2574
 
2583
2575
  ${AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH}` : AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH;
2584
2576
  }
2585
2577
  function stripAgentsmeshRootInstructionParagraph(content) {
2586
- return content.replace(`
2587
-
2588
- ${AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH}`, "").replace(`
2589
-
2590
- ${AGENTSMESH_CONTRACT_WITH_LEGACY_BODY}`, "").replace(`
2578
+ let result = content;
2579
+ result = result.replace(`
2591
2580
 
2592
- ${LEGACY_AGENTSMESH_ROOT_INSTRUCTION_SECTION}`, "").replace(`
2581
+ ${AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH}`, "");
2582
+ for (const legacy of LEGACY_FORMS) {
2583
+ result = result.replace(`
2593
2584
 
2594
- ${LEGACY_AGENTSMESH_ROOT_INSTRUCTION_PARAGRAPH}`, "").trim();
2585
+ ${legacy}`, "");
2586
+ }
2587
+ return result.trim();
2595
2588
  }
2596
2589
 
2597
2590
  // src/targets/import/import-metadata.ts
@@ -9923,17 +9916,6 @@ async function runGenerate(flags, projectRoot, options = {}) {
9923
9916
  import { join as join57 } from "path";
9924
9917
 
9925
9918
  // src/cli/commands/init-templates.ts
9926
- var ALL_TARGETS = [
9927
- "claude-code",
9928
- "cursor",
9929
- "copilot",
9930
- "continue",
9931
- "junie",
9932
- "gemini-cli",
9933
- "cline",
9934
- "codex-cli",
9935
- "windsurf"
9936
- ];
9937
9919
  var ALL_FEATURES = [
9938
9920
  "rules",
9939
9921
  "commands",
@@ -9945,7 +9927,7 @@ var ALL_FEATURES = [
9945
9927
  "permissions"
9946
9928
  ];
9947
9929
  function buildConfig(targets) {
9948
- const targetList = (targets.length > 0 ? targets : ALL_TARGETS).map((t) => ` - ${t}`).join("\n");
9930
+ const targetList = (targets.length > 0 ? targets : TARGET_IDS).map((t) => ` - ${t}`).join("\n");
9949
9931
  const featureList = ALL_FEATURES.map((f) => ` - ${f}`).join("\n");
9950
9932
  return `version: 1
9951
9933
  targets: