dlw-machine-setup 0.4.5 → 0.4.6

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.
Files changed (2) hide show
  1. package/bin/installer.js +16 -10
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -3859,7 +3859,13 @@ function resolveDomainFolder(domain) {
3859
3859
  const fallback = domain.toUpperCase();
3860
3860
  return { folderName: fallback, folderPath: (0, import_path4.join)(CONTEXTS_DIR, fallback) };
3861
3861
  }
3862
- function buildContextRefsSection(domains) {
3862
+ function formatPathRef(contextPath, description, agent) {
3863
+ if (agent === "github-copilot") {
3864
+ return `- [${contextPath}](../../${contextPath}) \u2014 ${description}`;
3865
+ }
3866
+ return `- \`${contextPath}\` \u2014 ${description}`;
3867
+ }
3868
+ function buildContextRefsSection(domains, agent) {
3863
3869
  const lines2 = [
3864
3870
  `## Context References`,
3865
3871
  ``,
@@ -3874,19 +3880,19 @@ function buildContextRefsSection(domains) {
3874
3880
  const ctxInstructions = (0, import_path4.join)(domainPath, "context-instructions.md");
3875
3881
  if ((0, import_fs4.existsSync)(ctxInstructions)) {
3876
3882
  const desc = extractFirstHeading(ctxInstructions);
3877
- domainFiles.push(`- \`_ai-context/${folderName}/context-instructions.md\` \u2014 ${desc}`);
3883
+ domainFiles.push(formatPathRef(`_ai-context/${folderName}/context-instructions.md`, desc, agent));
3878
3884
  }
3879
3885
  const instructionsMd = (0, import_path4.join)(domainPath, "core", "instructions.md");
3880
3886
  if ((0, import_fs4.existsSync)(instructionsMd)) {
3881
3887
  const desc = extractFirstHeading(instructionsMd);
3882
- domainFiles.push(`- \`_ai-context/${folderName}/core/instructions.md\` \u2014 ${desc} (start here)`);
3888
+ domainFiles.push(formatPathRef(`_ai-context/${folderName}/core/instructions.md`, `${desc} (start here)`, agent));
3883
3889
  }
3884
3890
  const coreDir = (0, import_path4.join)(domainPath, "core");
3885
3891
  if ((0, import_fs4.existsSync)(coreDir)) {
3886
3892
  const coreFiles = collectMdFiles(coreDir).filter((f) => f !== "instructions.md" && !f.startsWith("instructions/"));
3887
3893
  for (const file of coreFiles) {
3888
3894
  const desc = extractFirstHeading((0, import_path4.join)(coreDir, file));
3889
- domainFiles.push(`- \`_ai-context/${folderName}/core/${file}\` \u2014 ${desc}`);
3895
+ domainFiles.push(formatPathRef(`_ai-context/${folderName}/core/${file}`, desc, agent));
3890
3896
  }
3891
3897
  }
3892
3898
  const refDir = (0, import_path4.join)(domainPath, "reference");
@@ -3897,7 +3903,7 @@ function buildContextRefsSection(domains) {
3897
3903
  domainFiles.push(`**Reference & cheat sheets:**`);
3898
3904
  for (const file of refFiles) {
3899
3905
  const desc = extractFirstHeading((0, import_path4.join)(refDir, file));
3900
- domainFiles.push(`- \`_ai-context/${folderName}/reference/${file}\` \u2014 ${desc}`);
3906
+ domainFiles.push(formatPathRef(`_ai-context/${folderName}/reference/${file}`, desc, agent));
3901
3907
  }
3902
3908
  }
3903
3909
  }
@@ -3913,14 +3919,14 @@ function buildContextRefsSection(domains) {
3913
3919
  }
3914
3920
  return lines2.join("\n");
3915
3921
  }
3916
- function buildCombinedInstructions(domains, mcpConfig) {
3922
+ function buildCombinedInstructions(domains, mcpConfig, agent = "") {
3917
3923
  const lines2 = [
3918
3924
  `# AI Development Instructions`,
3919
3925
  ``,
3920
3926
  `> Generated by One-Shot Installer`,
3921
3927
  ``
3922
3928
  ];
3923
- lines2.push(buildContextRefsSection(domains));
3929
+ lines2.push(buildContextRefsSection(domains, agent));
3924
3930
  if (mcpConfig && Object.keys(mcpConfig).length > 0) {
3925
3931
  lines2.push(buildMCPSection(mcpConfig));
3926
3932
  }
@@ -3930,7 +3936,7 @@ async function setupInstructions(config) {
3930
3936
  const { domains, agent, mcpConfig } = config;
3931
3937
  switch (agent) {
3932
3938
  case "claude-code": {
3933
- const content = buildCombinedInstructions(domains, mcpConfig);
3939
+ const content = buildCombinedInstructions(domains, mcpConfig, agent);
3934
3940
  upsertBlock((0, import_path4.join)(process.cwd(), "CLAUDE.md"), content);
3935
3941
  break;
3936
3942
  }
@@ -3945,14 +3951,14 @@ applyTo: "**"
3945
3951
 
3946
3952
  `, "utf-8");
3947
3953
  }
3948
- const body = buildCombinedInstructions(domains, mcpConfig);
3954
+ const body = buildCombinedInstructions(domains, mcpConfig, agent);
3949
3955
  upsertBlock(filePath, body);
3950
3956
  break;
3951
3957
  }
3952
3958
  case "cursor": {
3953
3959
  const cursorDir = (0, import_path4.join)(process.cwd(), ".cursor", "rules");
3954
3960
  if (!(0, import_fs4.existsSync)(cursorDir)) (0, import_fs4.mkdirSync)(cursorDir, { recursive: true });
3955
- const body = buildCombinedInstructions(domains, mcpConfig);
3961
+ const body = buildCombinedInstructions(domains, mcpConfig, agent);
3956
3962
  upsertBlock((0, import_path4.join)(cursorDir, `instructions.mdc`), body);
3957
3963
  break;
3958
3964
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"