@el-j/magic-helix-core 4.0.0-beta.1 → 4.0.0-beta.2

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 (31) hide show
  1. package/dist/builtin-plugins/cpp/index.d.ts +46 -0
  2. package/dist/builtin-plugins/index.d.ts +1 -0
  3. package/dist/default_templates/generic/lang-typescript.md +49 -3
  4. package/dist/default_templates/generic/style-tailwind.md +72 -2
  5. package/dist/default_templates/generic/test-vitest.md +126 -1
  6. package/dist/default_templates/vue/vue-core.md +90 -10
  7. package/dist/{index-BkJhe5Af.js → index-0GK4RlUx.js} +2 -2
  8. package/dist/{index-BkJhe5Af.js.map → index-0GK4RlUx.js.map} +1 -1
  9. package/dist/{index-Jz0HYZ7B.js → index-BQ6v041y.js} +2 -2
  10. package/dist/index-BQ6v041y.js.map +1 -0
  11. package/dist/index-Baxb1vI_.js +210 -0
  12. package/dist/index-Baxb1vI_.js.map +1 -0
  13. package/dist/{index-L3IVvhd1.cjs → index-BqTqxCpG.cjs} +2 -2
  14. package/dist/{index-L3IVvhd1.cjs.map → index-BqTqxCpG.cjs.map} +1 -1
  15. package/dist/{index-Dm37u5ut.js → index-DkvW5yBY.js} +362 -241
  16. package/dist/index-DkvW5yBY.js.map +1 -0
  17. package/dist/index-Dn1ehjIj.cjs +80 -0
  18. package/dist/index-Dn1ehjIj.cjs.map +1 -0
  19. package/dist/index-nioXOg4m.cjs +76 -0
  20. package/dist/index-nioXOg4m.cjs.map +1 -0
  21. package/dist/{index-J1qAfsnO.cjs → index-okhY3fWD.cjs} +2 -2
  22. package/dist/index-okhY3fWD.cjs.map +1 -0
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.mjs +1 -1
  25. package/dist/plugin-loader.d.ts +5 -0
  26. package/package.json +1 -1
  27. package/dist/index-B_6W_RnJ.cjs +0 -76
  28. package/dist/index-B_6W_RnJ.cjs.map +0 -1
  29. package/dist/index-Dm37u5ut.js.map +0 -1
  30. package/dist/index-J1qAfsnO.cjs.map +0 -1
  31. package/dist/index-Jz0HYZ7B.js.map +0 -1
@@ -1,11 +1,11 @@
1
- import * as p from "node:path";
2
- import F, { dirname as O, resolve as R } from "node:path";
3
- import { fileURLToPath as _ } from "node:url";
4
- import * as f from "node:fs";
1
+ import * as f from "node:path";
2
+ import S, { dirname as O, resolve as R } from "node:path";
3
+ import { fileURLToPath as A } from "node:url";
4
+ import * as p from "node:fs";
5
5
  import E from "node:fs";
6
6
  import b from "picocolors";
7
- import { glob as A } from "glob";
8
- function W(n) {
7
+ import { glob as W } from "glob";
8
+ function N(n) {
9
9
  if (n === "src/**/*.ts")
10
10
  return /^src\/.*\.ts$/;
11
11
  if (n === "src/**/*.vue")
@@ -13,11 +13,11 @@ function W(n) {
13
13
  const e = n.replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*");
14
14
  return new RegExp(`^${e.replace(/[.+^${}()|[\]\\]/g, "\\$&")}$`);
15
15
  }
16
- function N(n, e) {
17
- const t = W(e);
16
+ function z(n, e) {
17
+ const t = N(e);
18
18
  return n.some((s) => t.test(s));
19
19
  }
20
- function Pe(n, e, t, s) {
20
+ function ke(n, e, t, s) {
21
21
  const i = /* @__PURE__ */ new Set();
22
22
  for (const [r, o] of Object.entries(n.dependencies))
23
23
  e[r] && i.add(e[r]);
@@ -25,7 +25,7 @@ function Pe(n, e, t, s) {
25
25
  t[r] && i.add(t[r]);
26
26
  for (const r in s) {
27
27
  const o = s[r];
28
- N(n.projectFiles, r) && i.add(o);
28
+ z(n.projectFiles, r) && i.add(o);
29
29
  }
30
30
  return i;
31
31
  }
@@ -82,59 +82,88 @@ const G = {
82
82
  },
83
83
  tagTemplateMap: {
84
84
  // Vue Projects
85
- "framework-vue": [{ template: "vue/vue-core.md", suffix: "vue-core.md" }],
86
- "state-pinia": [{ template: "vue/vue-pinia.md", suffix: "vue-pinia.md" }],
85
+ "framework-vue": [
86
+ { template: "vue/vue-core.md", suffix: "vue.instructions.md" }
87
+ ],
88
+ "state-pinia": [
89
+ { template: "vue/vue-pinia.md", suffix: "vue-pinia.instructions.md" }
90
+ ],
87
91
  "style-primevue": [
88
- { template: "vue/style-primevue.md", suffix: "vue-style-primevue.md" }
92
+ {
93
+ template: "vue/style-primevue.md",
94
+ suffix: "vue-primevue.instructions.md"
95
+ }
89
96
  ],
90
97
  "style-quasar": [
91
- { template: "vue/style-quasar.md", suffix: "vue-style-quasar.md" }
98
+ { template: "vue/style-quasar.md", suffix: "vue-quasar.instructions.md" }
92
99
  ],
93
100
  // React Projects
94
101
  "framework-react": [
95
- { template: "react/react-core.md", suffix: "react-core.md" }
102
+ { template: "react/react-core.md", suffix: "react.instructions.md" }
96
103
  ],
97
104
  "state-zustand": [
98
- { template: "react/react-zustand.md", suffix: "react-zustand.md" }
105
+ {
106
+ template: "react/react-zustand.md",
107
+ suffix: "react-zustand.instructions.md"
108
+ }
99
109
  ],
100
110
  // NestJS Projects
101
111
  "framework-nestjs": [
102
- { template: "nestjs/nestjs-core.md", suffix: "nestjs-core.md" }
112
+ { template: "nestjs/nestjs-core.md", suffix: "nestjs.instructions.md" }
103
113
  ],
104
114
  // Angular Projects
105
115
  "framework-angular": [
106
- { template: "angular/angular-core.md", suffix: "angular-core.md" }
116
+ {
117
+ template: "angular/angular-core.md",
118
+ suffix: "angular.instructions.md"
119
+ }
107
120
  ],
108
121
  // Generic
109
122
  "style-tailwind": [
110
- { template: "generic/style-tailwind.md", suffix: "style-tailwind.md" }
123
+ {
124
+ template: "generic/style-tailwind.md",
125
+ suffix: "tailwind.instructions.md"
126
+ }
127
+ ],
128
+ "style-mui": [
129
+ { template: "generic/style-mui.md", suffix: "mui.instructions.md" }
111
130
  ],
112
- "style-mui": [{ template: "generic/style-mui.md", suffix: "style-mui.md" }],
113
131
  "test-vitest": [
114
- { template: "generic/test-vitest.md", suffix: "test-vitest.md" }
132
+ { template: "generic/test-vitest.md", suffix: "vitest.instructions.md" }
133
+ ],
134
+ "test-jest": [
135
+ { template: "generic/test-jest.md", suffix: "jest.instructions.md" }
115
136
  ],
116
- "test-jest": [{ template: "generic/test-jest.md", suffix: "test-jest.md" }],
117
137
  "test-cypress": [
118
- { template: "generic/test-cypress.md", suffix: "test-cypress.md" }
138
+ {
139
+ template: "generic/test-cypress.md",
140
+ suffix: "cypress.instructions.md"
141
+ }
119
142
  ],
120
143
  "test-playwright": [
121
- { template: "generic/test-playwright.md", suffix: "test-playwright.md" }
144
+ {
145
+ template: "generic/test-playwright.md",
146
+ suffix: "playwright.instructions.md"
147
+ }
122
148
  ],
123
149
  "lang-typescript": [
124
- { template: "generic/lang-typescript.md", suffix: "lang-typescript.md" }
150
+ {
151
+ template: "generic/lang-typescript.md",
152
+ suffix: "typescript.instructions.md"
153
+ }
125
154
  ],
126
155
  "lang-python": [
127
- { template: "python/lang-python.md", suffix: "lang-python.md" }
156
+ { template: "python/lang-python.md", suffix: "python.instructions.md" }
128
157
  ],
129
- "lang-go": [{ template: "go/lang-go.md", suffix: "lang-go.md" }],
158
+ "lang-go": [{ template: "go/lang-go.md", suffix: "go.instructions.md" }],
130
159
  "state-rxjs": [
131
- { template: "generic/state-rxjs.md", suffix: "state-rxjs.md" }
160
+ { template: "generic/state-rxjs.md", suffix: "rxjs.instructions.md" }
132
161
  ],
133
162
  "state-redux": [
134
- { template: "generic/state-redux.md", suffix: "state-redux.md" }
163
+ { template: "generic/state-redux.md", suffix: "redux.instructions.md" }
135
164
  ]
136
165
  }
137
- }, I = {
166
+ }, D = {
138
167
  quality: "standard",
139
168
  contextLevel: "balanced",
140
169
  outputFormat: "markdown",
@@ -142,12 +171,12 @@ const G = {
142
171
  includeExamples: !0,
143
172
  includeBestPractices: !0
144
173
  };
145
- function be(n, e) {
146
- const t = { ...I, ...e };
174
+ function Ce(n, e) {
175
+ const t = { ...D, ...e };
147
176
  let s = n;
148
- return s = q(s, t.outputFormat), s = z(s, t.quality), s = B(s, t.contextLevel), t.includeExamples || (s = H(s)), t.includeBestPractices || (s = U(s)), s = J(s, t.tokenBudget), s;
177
+ return s = H(s, t.outputFormat), s = B(s, t.quality), s = q(s, t.contextLevel), t.includeExamples || (s = U(s)), t.includeBestPractices || (s = J(s)), s = V(s, t.tokenBudget), s;
149
178
  }
150
- function z(n, e) {
179
+ function B(n, e) {
151
180
  switch (e) {
152
181
  case "basic":
153
182
  return n.split(/\n(?=##? )/).filter((s) => {
@@ -169,7 +198,7 @@ function z(n, e) {
169
198
  `);
170
199
  }
171
200
  }
172
- function B(n, e) {
201
+ function q(n, e) {
173
202
  switch (e) {
174
203
  case "minimal":
175
204
  return n.split(/\n(?=##? )/).filter((s) => {
@@ -187,7 +216,7 @@ function B(n, e) {
187
216
  `);
188
217
  }
189
218
  }
190
- function q(n, e) {
219
+ function H(n, e) {
191
220
  switch (e) {
192
221
  case "structured":
193
222
  return n.replace(/^### /gm, "#### ").replace(/^## /gm, "### ").replace(/^# /gm, "## ");
@@ -207,7 +236,7 @@ function q(n, e) {
207
236
  return n;
208
237
  }
209
238
  }
210
- function H(n) {
239
+ function U(n) {
211
240
  let e = "", t = !1, s = !1;
212
241
  for (const i of n.split(`
213
242
  `)) {
@@ -227,7 +256,7 @@ function H(n) {
227
256
  }
228
257
  return e;
229
258
  }
230
- function U(n) {
259
+ function J(n) {
231
260
  return n.split(`
232
261
  `).filter((e) => {
233
262
  const t = e.toLowerCase();
@@ -235,7 +264,7 @@ function U(n) {
235
264
  }).join(`
236
265
  `);
237
266
  }
238
- function J(n, e) {
267
+ function V(n, e) {
239
268
  const t = e * 4;
240
269
  if (n.length <= t) return n;
241
270
  const s = n.substring(0, t), i = s.lastIndexOf(`
@@ -246,21 +275,21 @@ function J(n, e) {
246
275
 
247
276
  <!-- Content truncated to fit token budget -->`;
248
277
  }
249
- function ke(n) {
278
+ function Fe(n) {
250
279
  return Math.ceil(n.length / 4);
251
280
  }
252
- const T = "magic-helix.config.json", V = ["ai-aligner.config.json"];
253
- function Ce(n) {
254
- const t = (n ? [p.resolve(process.cwd(), n)] : [
255
- p.resolve(process.cwd(), T),
256
- ...V.map(
257
- (s) => p.resolve(process.cwd(), s)
281
+ const T = "magic-helix.config.json", Y = ["ai-aligner.config.json"];
282
+ function Se(n) {
283
+ const t = (n ? [f.resolve(process.cwd(), n)] : [
284
+ f.resolve(process.cwd(), T),
285
+ ...Y.map(
286
+ (s) => f.resolve(process.cwd(), s)
258
287
  )
259
288
  ]).find((s, i) => {
260
- const r = f.existsSync(s);
289
+ const r = p.existsSync(s);
261
290
  return !n && r && i > 0 && console.warn(
262
291
  b.yellow(
263
- ` Detected legacy config file ${p.basename(s)}. Please rename it to ${T}.`
292
+ ` Detected legacy config file ${f.basename(s)}. Please rename it to ${T}.`
264
293
  )
265
294
  ), r;
266
295
  });
@@ -271,7 +300,7 @@ function Ce(n) {
271
300
  try {
272
301
  return console.log(
273
302
  b.blue(" User config file found. Merging with built-in conventions.")
274
- ), JSON.parse(f.readFileSync(t, "utf-8"));
303
+ ), JSON.parse(p.readFileSync(t, "utf-8"));
275
304
  } catch (s) {
276
305
  return console.error(
277
306
  b.red(`❌ Error parsing config file: ${s.message}`)
@@ -282,12 +311,14 @@ function Ce(n) {
282
311
  ), {};
283
312
  }
284
313
  }
285
- function Fe(n) {
286
- const e = G;
314
+ function xe(n) {
315
+ const e = G, t = Q(
316
+ n.outputDirectory ?? e.outputDirectory
317
+ );
287
318
  return {
288
319
  target: n.target || e.target,
289
320
  templateDirectory: n.templateDirectory ?? e.templateDirectory,
290
- outputDirectory: n.outputDirectory ?? e.outputDirectory,
321
+ outputDirectory: t,
291
322
  dependencyTagMap: {
292
323
  ...e.dependencyTagMap,
293
324
  ...n.dependencyTagMap || {}
@@ -305,12 +336,24 @@ function Fe(n) {
305
336
  ...n.tagTemplateMap || {}
306
337
  },
307
338
  aiRefinement: {
308
- ...I,
339
+ ...D,
309
340
  ...n.aiRefinement || {}
310
341
  }
311
342
  };
312
343
  }
313
- class j {
344
+ function Q(n) {
345
+ const e = n.trim();
346
+ if (e.endsWith(".github/instruction") || /\binstruction\/?$/.test(e)) {
347
+ const t = e.replace(/instruction\/?$/, "instructions");
348
+ return console.warn(
349
+ b.yellow(
350
+ ` Normalized outputDirectory from "${e}" to "${t}". Using ".github/instructions" as the default convention.`
351
+ )
352
+ ), t;
353
+ }
354
+ return e;
355
+ }
356
+ class $ {
314
357
  format(e, t, s) {
315
358
  return e;
316
359
  }
@@ -325,7 +368,7 @@ applyTo: "${e}"
325
368
  `;
326
369
  }
327
370
  }
328
- class Y {
371
+ class X {
329
372
  format(e, t, s) {
330
373
  return e.replace(/- \*\*([^*]+)\*\*/g, "- **$1** (important)");
331
374
  }
@@ -341,7 +384,7 @@ assistant: claude
341
384
  `;
342
385
  }
343
386
  }
344
- class Q {
387
+ class K {
345
388
  format(e, t, s) {
346
389
  return e.replace(/- \*\*ALWAYS\*\*/g, "- 🔴").replace(/- \*\*NEVER\*\*/g, "- ❌");
347
390
  }
@@ -357,7 +400,7 @@ context: chat
357
400
  `;
358
401
  }
359
402
  }
360
- class X {
403
+ class Z {
361
404
  format(e, t, s) {
362
405
  return e;
363
406
  }
@@ -372,25 +415,25 @@ applyTo: "${e}"
372
415
  `;
373
416
  }
374
417
  }
375
- function Se(n) {
418
+ function je(n) {
376
419
  switch (n) {
377
420
  case "github-copilot":
378
- return new j();
421
+ return new $();
379
422
  case "claude":
380
- return new Y();
423
+ return new X();
381
424
  case "copilot-chat":
382
- return new Q();
425
+ return new K();
383
426
  case "generic":
384
- return new X();
427
+ return new Z();
385
428
  default:
386
- return new j();
429
+ return new $();
387
430
  }
388
431
  }
389
- const v = {}, xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
432
+ const v = {}, Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
390
433
  __proto__: null,
391
434
  default: v
392
435
  }, Symbol.toStringTag, { value: "Module" }));
393
- function K() {
436
+ function ee() {
394
437
  const n = v.join(__dirname, "default_templates", "patterns"), e = /* @__PURE__ */ new Map(), t = [
395
438
  "role-definition",
396
439
  "organization",
@@ -411,13 +454,13 @@ function K() {
411
454
  name: a,
412
455
  category: s,
413
456
  content: c,
414
- priority: Z(s)
457
+ priority: te(s)
415
458
  });
416
459
  }
417
460
  }
418
461
  return e;
419
462
  }
420
- function Z(n) {
463
+ function te(n) {
421
464
  return {
422
465
  "role-definition": 1,
423
466
  organization: 2,
@@ -430,7 +473,7 @@ function Z(n) {
430
473
  // Safety always highest priority (never overridden)
431
474
  }[n];
432
475
  }
433
- function ee(n, e) {
476
+ function se(n, e) {
434
477
  const t = [], s = n.get("expert-identity"), i = n.get("scope-boundaries");
435
478
  s && t.push(s), i && t.push(i);
436
479
  const r = n.get("heading-hierarchy");
@@ -470,12 +513,12 @@ function ee(n, e) {
470
513
  }
471
514
  return e.excludePatterns ? t.filter((u) => !e.excludePatterns?.includes(u.name)) : t;
472
515
  }
473
- function te(n) {
474
- const e = n.sort((g, w) => g.priority - w.priority), t = [], s = /* @__PURE__ */ new Map();
516
+ function ne(n) {
517
+ const e = n.sort((g, m) => g.priority - m.priority), t = [], s = /* @__PURE__ */ new Map();
475
518
  for (const g of e) {
476
519
  s.has(g.category) || s.set(g.category, []);
477
- const w = s.get(g.category);
478
- w && w.push(g);
520
+ const m = s.get(g.category);
521
+ m && m.push(g);
479
522
  }
480
523
  t.push(`# AI Agent Instructions
481
524
  `);
@@ -484,73 +527,73 @@ function te(n) {
484
527
  t.push(`## Role & Identity
485
528
  `);
486
529
  for (const g of i)
487
- t.push(y(g.content));
530
+ t.push(w(g.content));
488
531
  }
489
532
  const r = s.get("organization");
490
533
  if (r) {
491
534
  t.push(`## Instruction Structure
492
535
  `);
493
536
  for (const g of r)
494
- t.push(y(g.content));
537
+ t.push(w(g.content));
495
538
  }
496
539
  const o = s.get("tool-guidelines");
497
540
  if (o) {
498
541
  t.push(`## Tool Usage Guidelines
499
542
  `);
500
543
  for (const g of o)
501
- t.push(y(g.content));
544
+ t.push(w(g.content));
502
545
  }
503
546
  const a = s.get("reasoning");
504
547
  if (a) {
505
548
  t.push(`## Reasoning & Execution Patterns
506
549
  `);
507
550
  for (const g of a)
508
- t.push(y(g.content));
551
+ t.push(w(g.content));
509
552
  }
510
553
  const c = s.get("domain-expertise");
511
554
  if (c) {
512
555
  t.push(`## Domain-Specific Guidelines
513
556
  `);
514
557
  for (const g of c)
515
- t.push(y(g.content));
558
+ t.push(w(g.content));
516
559
  }
517
560
  const l = s.get("environment");
518
561
  if (l) {
519
562
  t.push(`## Environment Context
520
563
  `);
521
564
  for (const g of l)
522
- t.push(y(g.content));
565
+ t.push(w(g.content));
523
566
  }
524
567
  const u = s.get("tone");
525
568
  if (u) {
526
569
  t.push(`## Communication Style
527
570
  `);
528
571
  for (const g of u)
529
- t.push(y(g.content));
572
+ t.push(w(g.content));
530
573
  }
531
574
  const d = s.get("safety");
532
575
  if (d) {
533
576
  t.push(`## Safety & Refusal Protocols
534
577
  `);
535
578
  for (const g of d)
536
- t.push(y(g.content));
579
+ t.push(w(g.content));
537
580
  }
538
581
  return t.join(`
539
582
 
540
583
  `);
541
584
  }
542
- function y(n) {
585
+ function w(n) {
543
586
  let e = n.replace(/^# .+ Pattern\n+/, "");
544
587
  const t = e.match(
545
588
  /## Examples\n([\s\S]+?)(?=\n## |\n---|Z)/
546
589
  );
547
590
  return t ? t[1].trim() : (e = e.replace(/## Purpose\n.+?\n\n/, ""), e = e.replace(/## Template\n[\s\S]+?(?=\n## |$)/, ""), e = e.replace(/## Best Practices\n[\s\S]+$/, ""), e.trim());
548
591
  }
549
- function se(n) {
550
- const e = K(), t = ee(e, n);
551
- return te(t);
592
+ function ie(n) {
593
+ const e = ee(), t = se(e, n);
594
+ return ne(t);
552
595
  }
553
- const ne = [
596
+ const re = [
554
597
  // Role Definition (Critical)
555
598
  {
556
599
  name: "Expert Identity",
@@ -648,19 +691,19 @@ const ne = [
648
691
  check: (n) => /do not (say|use|start with)|avoid (saying|phrases like)/i.test(n)
649
692
  }
650
693
  ];
651
- function D(n) {
652
- const e = ne.map((d) => ({
694
+ function L(n) {
695
+ const e = re.map((d) => ({
653
696
  element: d,
654
697
  passed: d.check(n)
655
698
  })), t = e.filter(
656
699
  (d) => ["Clear Headings", "Structured Sections"].includes(d.element.name)
657
- ), s = S(t), i = e.filter(
700
+ ), s = x(t), i = e.filter(
658
701
  (d) => ["Concrete Examples", "Communication Style", "Forbidden Phrases"].includes(
659
702
  d.element.name
660
703
  )
661
- ), r = S(i), o = e.filter((d) => d.element.required), a = S(o), c = Math.round(
704
+ ), r = x(i), o = e.filter((d) => d.element.required), a = x(o), c = Math.round(
662
705
  s * 0.3 + r * 0.2 + a * 0.5
663
- ), l = e.filter((d) => d.element.required && !d.passed).map((d) => d.element.name), u = ie(e, n);
706
+ ), l = e.filter((d) => d.element.required && !d.passed).map((d) => d.element.name), u = oe(e, n);
664
707
  return {
665
708
  overallScore: c,
666
709
  structureScore: s,
@@ -670,12 +713,12 @@ function D(n) {
670
713
  missingElements: l
671
714
  };
672
715
  }
673
- function S(n) {
716
+ function x(n) {
674
717
  if (n.length === 0) return 100;
675
718
  const e = n.reduce((s, i) => s + i.element.weight, 0), t = n.filter((s) => s.passed).reduce((s, i) => s + i.element.weight, 0);
676
719
  return Math.round(t / e * 100);
677
720
  }
678
- function ie(n, e) {
721
+ function oe(n, e) {
679
722
  const t = [], s = n.filter(
680
723
  (a) => a.element.required && !a.passed
681
724
  );
@@ -705,17 +748,17 @@ function ie(n, e) {
705
748
  "Instructions meet quality standards. Consider A/B testing variants for optimization."
706
749
  ), t;
707
750
  }
708
- function Ee(n, e = 70) {
709
- return D(n).overallScore >= e;
751
+ function Te(n, e = 70) {
752
+ return L(n).overallScore >= e;
710
753
  }
711
- function re(n) {
754
+ function ae(n) {
712
755
  return n >= 90 ? "A" : n >= 80 ? "B" : n >= 70 ? "C" : n >= 60 ? "D" : "F";
713
756
  }
714
- function Te(n) {
757
+ function $e(n) {
715
758
  const e = [];
716
759
  if (e.push(`=== Instruction Quality Report ===
717
760
  `), e.push(
718
- `Overall Score: ${n.overallScore}/100 (${re(n.overallScore)})
761
+ `Overall Score: ${n.overallScore}/100 (${ae(n.overallScore)})
719
762
  `
720
763
  ), e.push(` Structure: ${n.structureScore}/100`), e.push(` Clarity: ${n.clarityScore}/100`), e.push(` Completeness: ${n.completenessScore}/100
721
764
  `), n.missingElements.length > 0) {
@@ -733,7 +776,7 @@ function Te(n) {
733
776
  return e.join(`
734
777
  `);
735
778
  }
736
- let oe = class {
779
+ let ce = class {
737
780
  constructor() {
738
781
  this.plugins = /* @__PURE__ */ new Map();
739
782
  }
@@ -779,8 +822,8 @@ let oe = class {
779
822
  return this.plugins.size;
780
823
  }
781
824
  };
782
- const m = new oe();
783
- class ae {
825
+ const h = new ce();
826
+ class le {
784
827
  constructor(e, t = /* @__PURE__ */ new Map()) {
785
828
  this.analysisData = e, this.fileContentCache = t;
786
829
  }
@@ -808,14 +851,14 @@ class ae {
808
851
  return new RegExp(`^${t}$`);
809
852
  }
810
853
  }
811
- async function $e(n, e) {
854
+ async function De(n, e) {
812
855
  const t = /* @__PURE__ */ new Set(), s = [], i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
813
856
  if (e)
814
857
  for (const c of n.configFiles) {
815
858
  const l = e(c);
816
859
  l && r.set(c, l);
817
860
  }
818
- const o = new ae(n, r);
861
+ const o = new le(n, r);
819
862
  if (e) {
820
863
  const c = o.getTextFile.bind(o);
821
864
  o.getTextFile = (l) => {
@@ -823,7 +866,7 @@ async function $e(n, e) {
823
866
  return u !== null ? u : e(l);
824
867
  };
825
868
  }
826
- const a = m.getAll();
869
+ const a = h.getAll();
827
870
  for (const c of a)
828
871
  try {
829
872
  const l = await Promise.resolve(c.detect(o));
@@ -846,12 +889,12 @@ async function $e(n, e) {
846
889
  metadata: i
847
890
  };
848
891
  }
849
- function Ie() {
850
- import("./index-Jz0HYZ7B.js").then((n) => {
851
- m.register(new n.GolangPlugin()), m.register(new n.PythonPlugin()), m.register(new n.RustPlugin()), m.register(new n.PHPPlugin()), m.register(new n.DockerPlugin()), m.register(new n.GitHubActionsPlugin()), m.register(new n.GitLabCIPlugin()), m.register(new n.MonorepoPlugin()), m.register(new n.CodeOwnersPlugin());
892
+ function Le() {
893
+ import("./index-BQ6v041y.js").then((n) => {
894
+ h.register(new n.GolangPlugin()), h.register(new n.PythonPlugin()), h.register(new n.RustPlugin()), h.register(new n.PHPPlugin()), h.register(new n.DockerPlugin()), h.register(new n.GitHubActionsPlugin()), h.register(new n.GitLabCIPlugin()), h.register(new n.MonorepoPlugin()), h.register(new n.CodeOwnersPlugin());
852
895
  });
853
896
  }
854
- class De {
897
+ class Me {
855
898
  constructor() {
856
899
  this.name = "codeowners", this.description = "Detects CODEOWNERS file and provides code ownership instructions", this.version = "1.0.0";
857
900
  }
@@ -895,7 +938,7 @@ class De {
895
938
  ];
896
939
  }
897
940
  }
898
- class Le {
941
+ class _e {
899
942
  constructor() {
900
943
  this.name = "docker", this.description = "Detects Docker usage and provides Docker-specific instructions", this.version = "1.0.0";
901
944
  }
@@ -939,7 +982,7 @@ class Le {
939
982
  }), s;
940
983
  }
941
984
  }
942
- class Me {
985
+ class Oe {
943
986
  constructor() {
944
987
  this.name = "github-actions", this.description = "Detects GitHub Actions workflows and provides CI/CD-specific instructions", this.version = "1.0.0";
945
988
  }
@@ -972,7 +1015,7 @@ class Me {
972
1015
  ];
973
1016
  }
974
1017
  }
975
- class Oe {
1018
+ class Re {
976
1019
  constructor() {
977
1020
  this.name = "gitlab-ci", this.description = "Detects GitLab CI/CD configuration and provides CI/CD-specific instructions", this.version = "1.0.0";
978
1021
  }
@@ -1008,7 +1051,7 @@ class Oe {
1008
1051
  ];
1009
1052
  }
1010
1053
  }
1011
- class Re {
1054
+ class Ae {
1012
1055
  constructor() {
1013
1056
  this.name = "golang", this.description = "Detects Go (Golang) projects and provides Go-specific instructions", this.version = "1.0.0";
1014
1057
  }
@@ -1042,7 +1085,7 @@ class Re {
1042
1085
  ];
1043
1086
  }
1044
1087
  }
1045
- class _e {
1088
+ class We {
1046
1089
  constructor() {
1047
1090
  this.name = "monorepo", this.description = "Detects monorepo structures and provides monorepo-specific instructions", this.version = "1.0.0";
1048
1091
  }
@@ -1096,7 +1139,7 @@ class _e {
1096
1139
  }), s;
1097
1140
  }
1098
1141
  }
1099
- class Ae {
1142
+ class Ne {
1100
1143
  constructor() {
1101
1144
  this.name = "php", this.description = "Detects PHP projects and provides PHP-specific instructions", this.version = "1.0.0";
1102
1145
  }
@@ -1135,7 +1178,7 @@ class Ae {
1135
1178
  }), s;
1136
1179
  }
1137
1180
  }
1138
- class We {
1181
+ class ze {
1139
1182
  constructor() {
1140
1183
  this.name = "python", this.description = "Detects Python projects and provides Python-specific instructions", this.version = "1.0.0";
1141
1184
  }
@@ -1171,7 +1214,7 @@ class We {
1171
1214
  ];
1172
1215
  }
1173
1216
  }
1174
- class Ne {
1217
+ class Ge {
1175
1218
  constructor() {
1176
1219
  this.name = "rust", this.description = "Detects Rust projects and provides Rust-specific instructions", this.version = "1.0.0";
1177
1220
  }
@@ -1208,7 +1251,7 @@ class Ne {
1208
1251
  ];
1209
1252
  }
1210
1253
  }
1211
- class $ {
1254
+ class I {
1212
1255
  constructor(e = {}) {
1213
1256
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.loadErrors = [], this.verbose = e.verbose ?? !1;
1214
1257
  }
@@ -1218,7 +1261,7 @@ class $ {
1218
1261
  async loadBuiltinPlugins(e) {
1219
1262
  const t = [];
1220
1263
  try {
1221
- const { NodeJSPlugin: s } = await import("./index-Bg8DD8ku.js"), { GoPlugin: i } = await import("./index-B8pyjKdF.js"), { PythonPlugin: r } = await import("./index-OT2XAJkc.js"), { RustPlugin: o } = await import("./index-BkJhe5Af.js"), { JavaPlugin: a } = await import("./index-AkVwRl-r.js"), { RubyPlugin: c } = await import("./index-CPbv2Od1.js"), { PHPPlugin: l } = await import("./index-mYXvc3Fs.js"), { CSharpPlugin: u } = await import("./index-Cf-MC6Al.js"), { SwiftPlugin: d } = await import("./index-WmVSB57y.js"), g = [
1264
+ const { NodeJSPlugin: s } = await import("./index-Bg8DD8ku.js"), { GoPlugin: i } = await import("./index-B8pyjKdF.js"), { PythonPlugin: r } = await import("./index-OT2XAJkc.js"), { RustPlugin: o } = await import("./index-0GK4RlUx.js"), { JavaPlugin: a } = await import("./index-AkVwRl-r.js"), { RubyPlugin: c } = await import("./index-CPbv2Od1.js"), { PHPPlugin: l } = await import("./index-mYXvc3Fs.js"), { CSharpPlugin: u } = await import("./index-Cf-MC6Al.js"), { SwiftPlugin: d } = await import("./index-WmVSB57y.js"), { CppPlugin: g } = await import("./index-Baxb1vI_.js"), m = [
1222
1265
  s,
1223
1266
  i,
1224
1267
  r,
@@ -1227,22 +1270,23 @@ class $ {
1227
1270
  c,
1228
1271
  l,
1229
1272
  u,
1230
- d
1273
+ d,
1274
+ g
1231
1275
  ];
1232
- for (const w of g) {
1233
- const P = new w();
1276
+ for (const F of m) {
1277
+ const P = new F();
1234
1278
  if (e && !e.includes(P.name))
1235
1279
  continue;
1236
- const M = Date.now(), x = {
1280
+ const _ = Date.now(), j = {
1237
1281
  plugin: P,
1238
1282
  source: {
1239
1283
  type: "builtin",
1240
1284
  identifier: P.name,
1241
1285
  packageName: "magic-helix-plugins"
1242
1286
  },
1243
- loadTime: Date.now() - M
1287
+ loadTime: Date.now() - _
1244
1288
  };
1245
- this.loadedPlugins.set(P.name, x), t.push(x), this.log(
1289
+ this.loadedPlugins.set(P.name, j), t.push(j), this.log(
1246
1290
  `Loaded built-in plugin: ${P.displayName} (${P.name})`
1247
1291
  );
1248
1292
  }
@@ -1300,8 +1344,8 @@ class $ {
1300
1344
  */
1301
1345
  async loadLocalPlugin(e) {
1302
1346
  try {
1303
- const t = p.resolve(e);
1304
- if (!f.existsSync(t))
1347
+ const t = f.resolve(e);
1348
+ if (!p.existsSync(t))
1305
1349
  throw new Error(`Plugin file not found: ${t}`);
1306
1350
  const s = Date.now(), i = await import(t), r = Date.now() - s, o = i.default || i.Plugin || i;
1307
1351
  if (typeof o != "function")
@@ -1399,24 +1443,101 @@ class $ {
1399
1443
  }
1400
1444
  return null;
1401
1445
  }
1446
+ /**
1447
+ * Recursively scan directories for project manifests
1448
+ */
1449
+ async scanForProjects(e, t = 5) {
1450
+ const s = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = [
1451
+ "package.json",
1452
+ "Cargo.toml",
1453
+ "go.mod",
1454
+ "go.sum",
1455
+ "setup.py",
1456
+ "pyproject.toml",
1457
+ "requirements.txt",
1458
+ "pom.xml",
1459
+ "build.gradle",
1460
+ "build.gradle.kts",
1461
+ "Package.swift",
1462
+ "Gemfile",
1463
+ "composer.json",
1464
+ "CMakeLists.txt",
1465
+ "Makefile",
1466
+ "platformio.ini"
1467
+ ], o = /* @__PURE__ */ new Set([
1468
+ "node_modules",
1469
+ "target",
1470
+ "dist",
1471
+ "build",
1472
+ ".git",
1473
+ ".svn",
1474
+ ".hg",
1475
+ "vendor",
1476
+ "__pycache__",
1477
+ ".venv",
1478
+ "venv",
1479
+ "env",
1480
+ ".cargo",
1481
+ ".gradle"
1482
+ ]), a = async (c, l) => {
1483
+ if (l > t) return;
1484
+ const u = f.normalize(c);
1485
+ if (!i.has(u)) {
1486
+ i.add(u);
1487
+ try {
1488
+ const d = await p.promises.readdir(c, {
1489
+ withFileTypes: !0
1490
+ });
1491
+ let g = !1;
1492
+ for (const m of d)
1493
+ if (!m.isDirectory() && r.includes(m.name)) {
1494
+ s.add(c), g = !0;
1495
+ break;
1496
+ }
1497
+ for (const m of d)
1498
+ if (m.isDirectory() && !o.has(m.name)) {
1499
+ const F = f.join(c, m.name);
1500
+ await a(F, l + 1);
1501
+ }
1502
+ } catch {
1503
+ return;
1504
+ }
1505
+ }
1506
+ };
1507
+ return await a(e, 0), Array.from(s).sort();
1508
+ }
1402
1509
  /**
1403
1510
  * Detect all projects in a directory (for monorepo support)
1511
+ * Enhanced version that recursively scans for ALL project types
1404
1512
  */
1405
1513
  async detectAllProjects(e) {
1406
- const t = [], s = this.getAllPlugins();
1407
- for (const i of s)
1514
+ const t = [], s = /* @__PURE__ */ new Set(), i = this.getAllPlugins();
1515
+ for (const r of i)
1408
1516
  try {
1409
- const r = await i.detect(e);
1410
- if (r && (t.push({ metadata: r, plugin: i }), r.workspaceMembers && r.workspaceMembers.length > 0))
1411
- for (const o of r.workspaceMembers) {
1412
- const a = p.resolve(e, o), c = await this.detectProject(a);
1413
- c && t.push(c);
1517
+ const o = await r.detect(e);
1518
+ if (o && (s.add(o.projectPath), t.push({ metadata: o, plugin: r }), o.workspaceMembers && o.workspaceMembers.length > 0))
1519
+ for (const a of o.workspaceMembers) {
1520
+ const c = f.resolve(e, a);
1521
+ if (!s.has(c)) {
1522
+ const l = await this.detectProject(c);
1523
+ l && (s.add(l.metadata.projectPath), t.push(l));
1524
+ }
1414
1525
  }
1415
- } catch (r) {
1526
+ } catch (o) {
1416
1527
  this.logWarning(
1417
- `Plugin ${i.name} failed: ${r.message}`
1528
+ `Plugin ${r.name} failed: ${o.message}`
1418
1529
  );
1419
1530
  }
1531
+ try {
1532
+ const r = await this.scanForProjects(e);
1533
+ for (const o of r)
1534
+ if (!s.has(o)) {
1535
+ const a = await this.detectProject(o);
1536
+ a && (s.add(a.metadata.projectPath), t.push(a));
1537
+ }
1538
+ } catch (r) {
1539
+ this.logWarning(`Recursive scan failed: ${r.message}`);
1540
+ }
1420
1541
  return t;
1421
1542
  }
1422
1543
  /**
@@ -1486,21 +1607,21 @@ class $ {
1486
1607
  this.verbose && console.warn(`[PluginLoader] ⚠️ ${e}`);
1487
1608
  }
1488
1609
  }
1489
- const h = class h {
1610
+ const y = class y {
1490
1611
  constructor() {
1491
- this.initialized = !1, this.loader = new $({ verbose: !1 }), this.config = {};
1612
+ this.initialized = !1, this.loader = new I({ verbose: !1 }), this.config = {};
1492
1613
  }
1493
1614
  /**
1494
1615
  * Get the singleton instance
1495
1616
  */
1496
1617
  static getInstance() {
1497
- return h.instance || (h.instance = new h()), h.instance;
1618
+ return y.instance || (y.instance = new y()), y.instance;
1498
1619
  }
1499
1620
  /**
1500
1621
  * Initialize the registry with configuration
1501
1622
  */
1502
1623
  async initialize(e = {}) {
1503
- if (!this.initialized && (this.config = e, this.loader = new $({ verbose: e.verbose }), await this.loadConfiguredPlugins(e.plugins), this.initialized = !0, e.verbose)) {
1624
+ if (!this.initialized && (this.config = e, this.loader = new I({ verbose: e.verbose }), await this.loadConfiguredPlugins(e.plugins), this.initialized = !0, e.verbose)) {
1504
1625
  const t = this.loader.getStats();
1505
1626
  console.log(
1506
1627
  `[PluginRegistry] Initialized with ${t.totalLoaded} plugins`
@@ -1632,12 +1753,12 @@ const h = class h {
1632
1753
  resolvePath(e) {
1633
1754
  if (e.startsWith("~/")) {
1634
1755
  const s = process.env.HOME || process.env.USERPROFILE || "";
1635
- return p.join(s, e.slice(2));
1756
+ return f.join(s, e.slice(2));
1636
1757
  }
1637
- if (p.isAbsolute(e))
1758
+ if (f.isAbsolute(e))
1638
1759
  return e;
1639
1760
  const t = this.config.workspacePath || process.cwd();
1640
- return p.resolve(t, e);
1761
+ return f.resolve(t, e);
1641
1762
  }
1642
1763
  /**
1643
1764
  * Apply priority overrides from configuration
@@ -1653,9 +1774,9 @@ const h = class h {
1653
1774
  */
1654
1775
  static async loadConfigFromFile(e) {
1655
1776
  try {
1656
- if (!f.existsSync(e))
1777
+ if (!p.existsSync(e))
1657
1778
  return null;
1658
- const t = f.readFileSync(e, "utf-8");
1779
+ const t = p.readFileSync(e, "utf-8");
1659
1780
  return JSON.parse(t);
1660
1781
  } catch (t) {
1661
1782
  return console.warn(
@@ -1669,15 +1790,15 @@ const h = class h {
1669
1790
  static async loadConfig(e) {
1670
1791
  const t = [], s = process.env.HOME || process.env.USERPROFILE;
1671
1792
  if (s) {
1672
- const i = p.join(
1793
+ const i = f.join(
1673
1794
  s,
1674
1795
  ".magic-helix",
1675
1796
  "config.json"
1676
- ), r = await h.loadConfigFromFile(i);
1797
+ ), r = await y.loadConfigFromFile(i);
1677
1798
  r && t.push(r);
1678
1799
  }
1679
1800
  if (e) {
1680
- const i = p.join(e, ".magic-helix.json"), r = await h.loadConfigFromFile(i);
1801
+ const i = f.join(e, ".magic-helix.json"), r = await y.loadConfigFromFile(i);
1681
1802
  r && (r.workspacePath = e, t.push(r));
1682
1803
  }
1683
1804
  return t.length === 0 ? { workspacePath: e } : t.reduce(
@@ -1698,16 +1819,16 @@ const h = class h {
1698
1819
  );
1699
1820
  }
1700
1821
  };
1701
- h.instance = null;
1702
- let k = h;
1703
- function Ge() {
1822
+ y.instance = null;
1823
+ let k = y;
1824
+ function Be() {
1704
1825
  return k.getInstance();
1705
1826
  }
1706
- async function ze(n) {
1827
+ async function qe(n) {
1707
1828
  const e = k.getInstance();
1708
1829
  return await e.initialize(n), e;
1709
1830
  }
1710
- class Be {
1831
+ class He {
1711
1832
  constructor(e = {}) {
1712
1833
  this.templateCache = /* @__PURE__ */ new Map(), this.config = e.config || {}, this.verbose = e.verbose ?? !1, this.cacheEnabled = e.cacheEnabled ?? !0;
1713
1834
  }
@@ -1812,9 +1933,9 @@ class Be {
1812
1933
  async loadFromPath(e, t) {
1813
1934
  try {
1814
1935
  const s = this.resolvePath(e);
1815
- if (!f.existsSync(s))
1936
+ if (!p.existsSync(s))
1816
1937
  return this.log(`Template not found at: ${s}`), null;
1817
- const i = f.readFileSync(s, "utf-8");
1938
+ const i = p.readFileSync(s, "utf-8");
1818
1939
  return this.log(`✓ Loaded template from ${t}: ${s}`), {
1819
1940
  content: i,
1820
1941
  source: t,
@@ -1831,12 +1952,12 @@ class Be {
1831
1952
  */
1832
1953
  async searchInDirectory(e, t, s) {
1833
1954
  const i = this.resolvePath(e);
1834
- if (!f.existsSync(i))
1955
+ if (!p.existsSync(i))
1835
1956
  return null;
1836
1957
  const r = this.config.extensions || [".md", ".txt", ""];
1837
1958
  for (const o of r) {
1838
- const a = t.endsWith(o) ? t : `${t}${o}`, c = p.join(i, a);
1839
- if (f.existsSync(c))
1959
+ const a = t.endsWith(o) ? t : `${t}${o}`, c = f.join(i, a);
1960
+ if (p.existsSync(c))
1840
1961
  return this.loadFromPath(c, s);
1841
1962
  }
1842
1963
  return null;
@@ -1870,9 +1991,9 @@ class Be {
1870
1991
  resolvePath(e) {
1871
1992
  if (e.startsWith("~/")) {
1872
1993
  const t = process.env.HOME || process.env.USERPROFILE || "";
1873
- return p.join(t, e.slice(2));
1994
+ return f.join(t, e.slice(2));
1874
1995
  }
1875
- return p.isAbsolute(e) ? e : p.resolve(process.cwd(), e);
1996
+ return f.isAbsolute(e) ? e : f.resolve(process.cwd(), e);
1876
1997
  }
1877
1998
  /**
1878
1999
  * Cache a template
@@ -1887,13 +2008,13 @@ class Be {
1887
2008
  this.verbose && console.warn(`[TemplateLoader] ⚠️ ${e}`);
1888
2009
  }
1889
2010
  }
1890
- const C = ".magic-helix", L = "meta-instructions.json";
1891
- function ce(n) {
1892
- const e = p.join(n, C, L);
1893
- if (!f.existsSync(e))
2011
+ const C = ".magic-helix", M = "meta-instructions.json";
2012
+ function ue(n) {
2013
+ const e = f.join(n, C, M);
2014
+ if (!p.existsSync(e))
1894
2015
  return null;
1895
2016
  try {
1896
- const t = f.readFileSync(e, "utf-8");
2017
+ const t = p.readFileSync(e, "utf-8");
1897
2018
  return JSON.parse(t);
1898
2019
  } catch (t) {
1899
2020
  return console.warn(
@@ -1901,23 +2022,23 @@ function ce(n) {
1901
2022
  ), null;
1902
2023
  }
1903
2024
  }
1904
- function le(n) {
1905
- const e = p.join(n, C, "overrides"), t = /* @__PURE__ */ new Map();
1906
- if (!f.existsSync(e))
2025
+ function de(n) {
2026
+ const e = f.join(n, C, "overrides"), t = /* @__PURE__ */ new Map();
2027
+ if (!p.existsSync(e))
1907
2028
  return t;
1908
- const s = A.sync("**/*.md", { cwd: e, absolute: !0 });
2029
+ const s = W.sync("**/*.md", { cwd: e, absolute: !0 });
1909
2030
  for (const i of s) {
1910
- const r = p.basename(i, ".md"), o = f.readFileSync(i, "utf-8");
2031
+ const r = f.basename(i, ".md"), o = p.readFileSync(i, "utf-8");
1911
2032
  t.set(r, o);
1912
2033
  }
1913
2034
  return t;
1914
2035
  }
1915
- function ue(n, e, t) {
2036
+ function ge(n, e, t) {
1916
2037
  const s = new Map(n);
1917
2038
  if (e.ignoreTags)
1918
2039
  for (const r of e.ignoreTags)
1919
2040
  s.delete(r);
1920
- const i = le(t);
2041
+ const i = de(t);
1921
2042
  for (const [r, o] of i)
1922
2043
  s.set(r, o);
1923
2044
  if (e.overrides)
@@ -1941,7 +2062,7 @@ ${r.content}`) : s.set(r.tag, r.content);
1941
2062
  }
1942
2063
  return s;
1943
2064
  }
1944
- function de(n, e) {
2065
+ function fe(n, e) {
1945
2066
  const t = new Map(n);
1946
2067
  let s = e.template;
1947
2068
  for (const i of e.tags) {
@@ -1950,23 +2071,23 @@ function de(n, e) {
1950
2071
  }
1951
2072
  return t.set(e.outputTag, s), t;
1952
2073
  }
1953
- function qe(n, e) {
1954
- const t = ce(e);
2074
+ function Ue(n, e) {
2075
+ const t = ue(e);
1955
2076
  if (!t)
1956
2077
  return n;
1957
- let s = ue(n, t, e);
2078
+ let s = ge(n, t, e);
1958
2079
  if (t.combiners)
1959
2080
  for (const i of t.combiners)
1960
- s = de(s, i);
2081
+ s = fe(s, i);
1961
2082
  return s;
1962
2083
  }
1963
- function He(n) {
1964
- const e = p.join(n, C);
1965
- return f.existsSync(e);
2084
+ function Je(n) {
2085
+ const e = f.join(n, C);
2086
+ return p.existsSync(e);
1966
2087
  }
1967
- function Ue(n) {
1968
- const e = p.join(n, C), t = p.join(e, "overrides");
1969
- f.mkdirSync(e, { recursive: !0 }), f.mkdirSync(t, { recursive: !0 });
2088
+ function Ve(n) {
2089
+ const e = f.join(n, C), t = f.join(e, "overrides");
2090
+ p.mkdirSync(e, { recursive: !0 }), p.mkdirSync(t, { recursive: !0 });
1970
2091
  const s = {
1971
2092
  overrides: [
1972
2093
  {
@@ -1991,8 +2112,8 @@ Your content here...`,
1991
2112
  }
1992
2113
  ],
1993
2114
  ignoreTags: ["unwanted-tag"]
1994
- }, i = p.join(e, L);
1995
- f.writeFileSync(i, JSON.stringify(s, null, 2)), f.writeFileSync(p.join(t, "example.md"), `# Example Override
2115
+ }, i = f.join(e, M);
2116
+ p.writeFileSync(i, JSON.stringify(s, null, 2)), p.writeFileSync(f.join(t, "example.md"), `# Example Override
1996
2117
 
1997
2118
  This file overrides the default instructions for this tag.
1998
2119
  Create files like:
@@ -2002,11 +2123,11 @@ Create files like:
2002
2123
  `✅ Initialized .magic-helix/ directory structure at: ${e}`
2003
2124
  );
2004
2125
  }
2005
- class ge {
2126
+ class pe {
2006
2127
  constructor(e = {}) {
2007
2128
  this.enabled = !!e.enabled;
2008
- const t = e.dir || F.resolve(process.cwd(), ".magic-helix/telemetry");
2009
- this.filePath = F.join(t, "events.jsonl"), this.sessionId = e.sessionId, this.variant = e.variant, this.projectRoot = e.projectRoot, this.enabled && E.mkdirSync(F.dirname(this.filePath), { recursive: !0 });
2129
+ const t = e.dir || S.resolve(process.cwd(), ".magic-helix/telemetry");
2130
+ this.filePath = S.join(t, "events.jsonl"), this.sessionId = e.sessionId, this.variant = e.variant, this.projectRoot = e.projectRoot, this.enabled && E.mkdirSync(S.dirname(this.filePath), { recursive: !0 });
2010
2131
  }
2011
2132
  isEnabled() {
2012
2133
  return this.enabled;
@@ -2025,13 +2146,13 @@ class ge {
2025
2146
  E.appendFileSync(this.filePath, s, "utf-8");
2026
2147
  }
2027
2148
  }
2028
- function Je(n = {}) {
2149
+ function Ye(n = {}) {
2029
2150
  const e = n.enabled ?? process.env.MAGIC_HELIX_TELEMETRY === "1", t = n.dir || process.env.MAGIC_HELIX_TELEMETRY_DIR, s = n.sessionId || process.env.MAGIC_HELIX_SESSION_ID || `${Date.now()}`, i = n.variant || process.env.MAGIC_HELIX_VARIANT || "default", r = n.projectRoot || process.cwd();
2030
- return new ge({ enabled: e, dir: t, sessionId: s, variant: i, projectRoot: r });
2151
+ return new pe({ enabled: e, dir: t, sessionId: s, variant: i, projectRoot: r });
2031
2152
  }
2032
- function Ve(n) {
2153
+ function Qe(n) {
2033
2154
  return n.map((e) => {
2034
- const t = se(e.context), s = D(t);
2155
+ const t = ie(e.context), s = L(t);
2035
2156
  return {
2036
2157
  variant: e.name,
2037
2158
  instructions: t,
@@ -2043,7 +2164,7 @@ function Ve(n) {
2043
2164
  };
2044
2165
  });
2045
2166
  }
2046
- function Ye(n) {
2167
+ function Xe(n) {
2047
2168
  return n.length === 0 ? {
2048
2169
  variant: "",
2049
2170
  instructions: "",
@@ -2057,7 +2178,7 @@ function Ye(n) {
2057
2178
  n[0]
2058
2179
  );
2059
2180
  }
2060
- function Qe(n, e) {
2181
+ function Ke(n, e) {
2061
2182
  if (e?.isEnabled())
2062
2183
  for (const t of n) {
2063
2184
  const s = {
@@ -2073,56 +2194,56 @@ function Qe(n, e) {
2073
2194
  e.track(s);
2074
2195
  }
2075
2196
  }
2076
- const pe = _(import.meta.url), fe = O(pe), Xe = R(fe, "default_templates");
2197
+ const me = A(import.meta.url), he = O(me), Ze = R(he, "default_templates");
2077
2198
  export {
2078
- ze as A,
2079
- Xe as B,
2080
- De as C,
2081
- Le as D,
2082
- ce as E,
2083
- le as F,
2084
- Me as G,
2085
- ue as H,
2086
- ne as I,
2087
- de as J,
2088
- qe as K,
2089
- He as L,
2090
- _e as M,
2091
- Ue as N,
2092
- Je as O,
2093
- Ae as P,
2094
- ge as Q,
2095
- Ne as R,
2096
- Ve as S,
2097
- Be as T,
2098
- Ye as U,
2099
- Qe as V,
2100
- xe as _,
2101
- Oe as a,
2102
- Re as b,
2103
- We as c,
2104
- Pe as d,
2199
+ qe as A,
2200
+ Ze as B,
2201
+ Me as C,
2202
+ _e as D,
2203
+ ue as E,
2204
+ de as F,
2205
+ Oe as G,
2206
+ ge as H,
2207
+ re as I,
2208
+ fe as J,
2209
+ Ue as K,
2210
+ Je as L,
2211
+ We as M,
2212
+ Ve as N,
2213
+ Ye as O,
2214
+ Ne as P,
2215
+ pe as Q,
2216
+ Ge as R,
2217
+ Qe as S,
2218
+ He as T,
2219
+ Xe as U,
2220
+ Ke as V,
2221
+ Ee as _,
2222
+ Re as a,
2223
+ Ae as b,
2224
+ ze as c,
2225
+ ke as d,
2105
2226
  G as e,
2106
- ke as f,
2107
- I as g,
2108
- Se as h,
2109
- se as i,
2110
- K as j,
2111
- te as k,
2112
- Ce as l,
2113
- Fe as m,
2114
- Te as n,
2115
- re as o,
2116
- Ee as p,
2117
- $e as q,
2118
- be as r,
2119
- ee as s,
2120
- Ie as t,
2121
- oe as u,
2122
- D as v,
2123
- m as w,
2124
- $ as x,
2227
+ Fe as f,
2228
+ D as g,
2229
+ je as h,
2230
+ ie as i,
2231
+ ee as j,
2232
+ ne as k,
2233
+ Se as l,
2234
+ xe as m,
2235
+ $e as n,
2236
+ ae as o,
2237
+ Te as p,
2238
+ De as q,
2239
+ Ce as r,
2240
+ se as s,
2241
+ Le as t,
2242
+ ce as u,
2243
+ L as v,
2244
+ h as w,
2245
+ I as x,
2125
2246
  k as y,
2126
- Ge as z
2247
+ Be as z
2127
2248
  };
2128
- //# sourceMappingURL=index-Dm37u5ut.js.map
2249
+ //# sourceMappingURL=index-DkvW5yBY.js.map