dlw-machine-setup 0.1.0 → 0.2.1

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 +14 -73
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -3261,42 +3261,42 @@ var personas_default = {
3261
3261
  id: "sapui5-developer",
3262
3262
  name: "SAPUI5 Developer",
3263
3263
  description: "Frontend development with SAP UI5 and Fiori",
3264
- domains: ["SAPUI5", "GENERAL"],
3264
+ domains: ["SAPUI5"],
3265
3265
  mcpServers: ["azure-devops", "context7", "playwright", "@ui5/mcp-server"]
3266
3266
  },
3267
3267
  {
3268
3268
  id: "cap-developer",
3269
3269
  name: "CAP Developer",
3270
3270
  description: "Backend development with SAP Cloud Application Programming model",
3271
- domains: ["CAP", "GENERAL"],
3271
+ domains: ["CAP"],
3272
3272
  mcpServers: ["azure-devops", "context7", "cds-mcp"]
3273
3273
  },
3274
3274
  {
3275
3275
  id: "abap-developer",
3276
3276
  name: "ABAP Developer",
3277
3277
  description: "ABAP and SAP backend development",
3278
- domains: ["ABAP", "GENERAL"],
3278
+ domains: ["ABAP"],
3279
3279
  mcpServers: ["azure-devops", "context7", "abap", "sap-researcher"]
3280
3280
  },
3281
3281
  {
3282
3282
  id: "btp-developer",
3283
3283
  name: "BTP Developer",
3284
3284
  description: "SAP Business Technology Platform development",
3285
- domains: ["BTP", "GENERAL"],
3285
+ domains: ["BTP"],
3286
3286
  mcpServers: ["azure-devops", "context7"]
3287
3287
  },
3288
3288
  {
3289
3289
  id: "sap-dm-developer",
3290
3290
  name: "SAP Digital Manufacturing Developer",
3291
3291
  description: "SAP Digital Manufacturing development",
3292
- domains: ["SAP_DM", "GENERAL"],
3292
+ domains: ["SAP_DM"],
3293
3293
  mcpServers: ["azure-devops", "context7"]
3294
3294
  },
3295
3295
  {
3296
3296
  id: "forms-developer",
3297
3297
  name: "Forms Developer",
3298
3298
  description: "SAP Forms development",
3299
- domains: ["FORMS", "GENERAL"],
3299
+ domains: ["FORMS"],
3300
3300
  mcpServers: ["azure-devops", "context7"]
3301
3301
  }
3302
3302
  ]
@@ -3773,51 +3773,6 @@ function buildMCPConfiguration(selectedItems, baseMcpServers2) {
3773
3773
  var import_fs4 = require("fs");
3774
3774
  var import_path4 = require("path");
3775
3775
  var CONTEXTS_DIR = (0, import_path4.join)(process.cwd(), "contexts");
3776
- function stripFrontmatter(content) {
3777
- const match = content.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n*/);
3778
- return match ? content.slice(match[0].length) : content;
3779
- }
3780
- function collectMarkdownFilesRecursive(dir, basePath, result) {
3781
- const entries = (0, import_fs4.readdirSync)(dir, { withFileTypes: true });
3782
- for (const entry of entries) {
3783
- const fullPath = (0, import_path4.join)(dir, entry.name);
3784
- const relPath = (0, import_path4.join)(basePath, entry.name);
3785
- if (entry.isDirectory()) {
3786
- collectMarkdownFilesRecursive(fullPath, relPath, result);
3787
- } else if (entry.isFile() && entry.name.endsWith(".md")) {
3788
- result.push({
3789
- relativePath: relPath,
3790
- content: stripFrontmatter((0, import_fs4.readFileSync)(fullPath, "utf-8")),
3791
- priority: 1
3792
- });
3793
- }
3794
- }
3795
- }
3796
- function collectInstructionFiles(domains) {
3797
- const result = /* @__PURE__ */ new Map();
3798
- for (const domain of domains) {
3799
- const domainPath = (0, import_path4.join)(CONTEXTS_DIR, domain.toUpperCase());
3800
- if (!(0, import_fs4.existsSync)(domainPath)) continue;
3801
- const files = [];
3802
- const instructionsMd = (0, import_path4.join)(domainPath, "core", "instructions.md");
3803
- if ((0, import_fs4.existsSync)(instructionsMd)) {
3804
- files.push({
3805
- relativePath: "core/instructions.md",
3806
- content: stripFrontmatter((0, import_fs4.readFileSync)(instructionsMd, "utf-8")),
3807
- priority: 0
3808
- });
3809
- }
3810
- const instructionsDir = (0, import_path4.join)(domainPath, "core", "instructions");
3811
- if ((0, import_fs4.existsSync)(instructionsDir)) {
3812
- collectMarkdownFilesRecursive(instructionsDir, "core/instructions", files);
3813
- }
3814
- files.sort((a, b) => a.priority - b.priority || a.relativePath.localeCompare(b.relativePath));
3815
- if (files.length > 0) {
3816
- result.set(domain, files);
3817
- }
3818
- }
3819
- return result;
3820
- }
3821
3776
  function buildMCPSection(mcpConfig) {
3822
3777
  const entries = Object.entries(mcpConfig);
3823
3778
  if (entries.length === 0) return "";
@@ -3870,7 +3825,7 @@ function buildContextRefsSection(domains) {
3870
3825
  lines2.push(``);
3871
3826
  return lines2.join("\n");
3872
3827
  }
3873
- function buildCombinedInstructions(domains, instructionFiles, mcpConfig) {
3828
+ function buildCombinedInstructions(domains, mcpConfig) {
3874
3829
  const lines2 = [
3875
3830
  `# AI Development Instructions`,
3876
3831
  ``,
@@ -3881,47 +3836,33 @@ function buildCombinedInstructions(domains, instructionFiles, mcpConfig) {
3881
3836
  if (mcpConfig && Object.keys(mcpConfig).length > 0) {
3882
3837
  lines2.push(buildMCPSection(mcpConfig));
3883
3838
  }
3884
- for (const domain of domains) {
3885
- const files = instructionFiles.get(domain);
3886
- if (!files || files.length === 0) continue;
3887
- lines2.push(`## ${domain.toUpperCase()}`);
3888
- lines2.push(``);
3889
- for (const file of files) {
3890
- lines2.push(file.content.trim());
3891
- lines2.push(``);
3892
- }
3893
- }
3894
3839
  return lines2.join("\n");
3895
3840
  }
3896
3841
  async function setupInstructions(config) {
3897
3842
  const { domains, agent, mcpConfig } = config;
3898
- const instructionFiles = collectInstructionFiles(domains);
3899
3843
  switch (agent) {
3900
3844
  case "claude-code": {
3901
- const combinedContent = buildCombinedInstructions(domains, instructionFiles, mcpConfig);
3902
- const claudeMdPath = (0, import_path4.join)(process.cwd(), "CLAUDE.md");
3903
- (0, import_fs4.writeFileSync)(claudeMdPath, combinedContent, "utf-8");
3845
+ const content = buildCombinedInstructions(domains, mcpConfig);
3846
+ (0, import_fs4.writeFileSync)((0, import_path4.join)(process.cwd(), "CLAUDE.md"), content, "utf-8");
3904
3847
  break;
3905
3848
  }
3906
3849
  case "github-copilot": {
3907
3850
  const instructionsDir = (0, import_path4.join)(process.cwd(), ".github", "instructions");
3908
3851
  if (!(0, import_fs4.existsSync)(instructionsDir)) (0, import_fs4.mkdirSync)(instructionsDir, { recursive: true });
3909
- const combinedBody = buildCombinedInstructions(domains, instructionFiles, mcpConfig);
3852
+ const body = buildCombinedInstructions(domains, mcpConfig);
3910
3853
  const withFrontmatter = `---
3911
3854
  applyTo: "**"
3912
3855
  ---
3913
3856
 
3914
- ${combinedBody}`;
3915
- const filePath = (0, import_path4.join)(instructionsDir, `instructions.instructions.md`);
3916
- (0, import_fs4.writeFileSync)(filePath, withFrontmatter, "utf-8");
3857
+ ${body}`;
3858
+ (0, import_fs4.writeFileSync)((0, import_path4.join)(instructionsDir, `instructions.instructions.md`), withFrontmatter, "utf-8");
3917
3859
  break;
3918
3860
  }
3919
3861
  case "cursor": {
3920
3862
  const cursorDir = (0, import_path4.join)(process.cwd(), ".cursor", "rules");
3921
3863
  if (!(0, import_fs4.existsSync)(cursorDir)) (0, import_fs4.mkdirSync)(cursorDir, { recursive: true });
3922
- const combinedBody = buildCombinedInstructions(domains, instructionFiles, mcpConfig);
3923
- const rulesPath = (0, import_path4.join)(cursorDir, `instructions.mdc`);
3924
- (0, import_fs4.writeFileSync)(rulesPath, combinedBody, "utf-8");
3864
+ const body = buildCombinedInstructions(domains, mcpConfig);
3865
+ (0, import_fs4.writeFileSync)((0, import_path4.join)(cursorDir, `instructions.mdc`), body, "utf-8");
3925
3866
  break;
3926
3867
  }
3927
3868
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"