@el-j/magic-helix-core 4.0.0-beta.6 → 4.0.0-beta.8
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/index.cjs +25 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +260 -227
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-loader.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as f from "node:path";
|
|
2
|
+
import F, { dirname as L } from "node:path";
|
|
3
3
|
import { fileURLToPath as M } from "node:url";
|
|
4
4
|
import * as p from "node:fs";
|
|
5
5
|
import S from "node:fs";
|
|
6
6
|
import P from "picocolors";
|
|
7
|
-
|
|
8
|
-
function R(n) {
|
|
7
|
+
function O(n) {
|
|
9
8
|
if (n === "src/**/*.ts")
|
|
10
9
|
return /^src\/.*\.ts$/;
|
|
11
10
|
if (n === "src/**/*.vue")
|
|
@@ -13,11 +12,11 @@ function R(n) {
|
|
|
13
12
|
const e = n.replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*");
|
|
14
13
|
return new RegExp(`^${e.replace(/[.+^${}()|[\]\\]/g, "\\$&")}$`);
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
const t =
|
|
15
|
+
function R(n, e) {
|
|
16
|
+
const t = O(e);
|
|
18
17
|
return n.some((s) => t.test(s));
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function me(n, e, t, s) {
|
|
21
20
|
const i = /* @__PURE__ */ new Set();
|
|
22
21
|
for (const [r, o] of Object.entries(n.dependencies))
|
|
23
22
|
e[r] && i.add(e[r]);
|
|
@@ -25,11 +24,11 @@ function ye(n, e, t, s) {
|
|
|
25
24
|
t[r] && i.add(t[r]);
|
|
26
25
|
for (const r in s) {
|
|
27
26
|
const o = s[r];
|
|
28
|
-
|
|
27
|
+
R(n.projectFiles, r) && i.add(o);
|
|
29
28
|
}
|
|
30
29
|
return i;
|
|
31
30
|
}
|
|
32
|
-
const
|
|
31
|
+
const _ = {
|
|
33
32
|
target: "github-copilot",
|
|
34
33
|
templateDirectory: "ai_templates",
|
|
35
34
|
// User's custom template dir
|
|
@@ -49,6 +48,13 @@ const A = {
|
|
|
49
48
|
react: "framework-react",
|
|
50
49
|
"@angular/core": "framework-angular",
|
|
51
50
|
"@nestjs/core": "framework-nestjs",
|
|
51
|
+
// Python frameworks
|
|
52
|
+
django: "framework-django",
|
|
53
|
+
flask: "framework-flask",
|
|
54
|
+
fastapi: "framework-fastapi",
|
|
55
|
+
// Go frameworks
|
|
56
|
+
"github.com/gin-gonic/gin": "framework-gin",
|
|
57
|
+
"github.com/gofiber/fiber": "framework-fiber",
|
|
52
58
|
// Styling
|
|
53
59
|
tailwindcss: "style-tailwind",
|
|
54
60
|
primevue: "style-primevue",
|
|
@@ -59,6 +65,7 @@ const A = {
|
|
|
59
65
|
jest: "test-jest",
|
|
60
66
|
cypress: "test-cypress",
|
|
61
67
|
playwright: "test-playwright",
|
|
68
|
+
pytest: "test-pytest",
|
|
62
69
|
// State
|
|
63
70
|
rxjs: "state-rxjs",
|
|
64
71
|
pinia: "state-pinia",
|
|
@@ -76,19 +83,10 @@ const A = {
|
|
|
76
83
|
// Detect file types - removed language-specific entries, now handled by plugins
|
|
77
84
|
},
|
|
78
85
|
tagTemplateMap: {
|
|
79
|
-
// Vue Projects
|
|
80
|
-
"framework-vue": [
|
|
81
|
-
|
|
82
|
-
],
|
|
83
|
-
"state-pinia": [
|
|
84
|
-
{ template: "vue/vue-pinia.md", suffix: "vue-pinia.instructions.md" }
|
|
85
|
-
],
|
|
86
|
-
"style-primevue": [
|
|
87
|
-
{
|
|
88
|
-
template: "vue/style-primevue.md",
|
|
89
|
-
suffix: "vue-primevue.instructions.md"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
86
|
+
// Vue Projects - templates now provided by plugins
|
|
87
|
+
"framework-vue": [],
|
|
88
|
+
"state-pinia": [],
|
|
89
|
+
"style-primevue": [],
|
|
92
90
|
"style-quasar": [
|
|
93
91
|
{ template: "vue/style-quasar.md", suffix: "vue-quasar.instructions.md" }
|
|
94
92
|
],
|
|
@@ -113,19 +111,12 @@ const A = {
|
|
|
113
111
|
suffix: "angular.instructions.md"
|
|
114
112
|
}
|
|
115
113
|
],
|
|
116
|
-
// Generic
|
|
117
|
-
"style-tailwind": [
|
|
118
|
-
{
|
|
119
|
-
template: "generic/style-tailwind.md",
|
|
120
|
-
suffix: "tailwind.instructions.md"
|
|
121
|
-
}
|
|
122
|
-
],
|
|
114
|
+
// Generic - templates now provided by plugins
|
|
115
|
+
"style-tailwind": [],
|
|
123
116
|
"style-mui": [
|
|
124
117
|
{ template: "generic/style-mui.md", suffix: "mui.instructions.md" }
|
|
125
118
|
],
|
|
126
|
-
"test-vitest": [
|
|
127
|
-
{ template: "generic/test-vitest.md", suffix: "vitest.instructions.md" }
|
|
128
|
-
],
|
|
119
|
+
"test-vitest": [],
|
|
129
120
|
"test-jest": [
|
|
130
121
|
{ template: "generic/test-jest.md", suffix: "jest.instructions.md" }
|
|
131
122
|
],
|
|
@@ -151,12 +142,12 @@ const A = {
|
|
|
151
142
|
includeExamples: !0,
|
|
152
143
|
includeBestPractices: !0
|
|
153
144
|
};
|
|
154
|
-
function
|
|
145
|
+
function he(n, e) {
|
|
155
146
|
const t = { ...T, ...e };
|
|
156
147
|
let s = n;
|
|
157
|
-
return s =
|
|
148
|
+
return s = N(s, t.outputFormat), s = A(s, t.quality), s = W(s, t.contextLevel), t.includeExamples || (s = z(s)), t.includeBestPractices || (s = G(s)), s = B(s, t.tokenBudget), s;
|
|
158
149
|
}
|
|
159
|
-
function
|
|
150
|
+
function A(n, e) {
|
|
160
151
|
switch (e) {
|
|
161
152
|
case "basic":
|
|
162
153
|
return n.split(/\n(?=##? )/).filter((s) => {
|
|
@@ -178,7 +169,7 @@ function W(n, e) {
|
|
|
178
169
|
`);
|
|
179
170
|
}
|
|
180
171
|
}
|
|
181
|
-
function
|
|
172
|
+
function W(n, e) {
|
|
182
173
|
switch (e) {
|
|
183
174
|
case "minimal":
|
|
184
175
|
return n.split(/\n(?=##? )/).filter((s) => {
|
|
@@ -196,7 +187,7 @@ function N(n, e) {
|
|
|
196
187
|
`);
|
|
197
188
|
}
|
|
198
189
|
}
|
|
199
|
-
function
|
|
190
|
+
function N(n, e) {
|
|
200
191
|
switch (e) {
|
|
201
192
|
case "structured":
|
|
202
193
|
return n.replace(/^### /gm, "#### ").replace(/^## /gm, "### ").replace(/^# /gm, "## ");
|
|
@@ -216,7 +207,7 @@ function z(n, e) {
|
|
|
216
207
|
return n;
|
|
217
208
|
}
|
|
218
209
|
}
|
|
219
|
-
function
|
|
210
|
+
function z(n) {
|
|
220
211
|
let e = "", t = !1, s = !1;
|
|
221
212
|
for (const i of n.split(`
|
|
222
213
|
`)) {
|
|
@@ -236,7 +227,7 @@ function G(n) {
|
|
|
236
227
|
}
|
|
237
228
|
return e;
|
|
238
229
|
}
|
|
239
|
-
function
|
|
230
|
+
function G(n) {
|
|
240
231
|
return n.split(`
|
|
241
232
|
`).filter((e) => {
|
|
242
233
|
const t = e.toLowerCase();
|
|
@@ -244,7 +235,7 @@ function B(n) {
|
|
|
244
235
|
}).join(`
|
|
245
236
|
`);
|
|
246
237
|
}
|
|
247
|
-
function
|
|
238
|
+
function B(n, e) {
|
|
248
239
|
const t = e * 4;
|
|
249
240
|
if (n.length <= t) return n;
|
|
250
241
|
const s = n.substring(0, t), i = s.lastIndexOf(`
|
|
@@ -255,21 +246,21 @@ function q(n, e) {
|
|
|
255
246
|
|
|
256
247
|
<!-- Content truncated to fit token budget -->`;
|
|
257
248
|
}
|
|
258
|
-
function
|
|
249
|
+
function ye(n) {
|
|
259
250
|
return Math.ceil(n.length / 4);
|
|
260
251
|
}
|
|
261
|
-
const j = "magic-helix.config.json",
|
|
262
|
-
function
|
|
263
|
-
const t = (n ? [
|
|
264
|
-
|
|
265
|
-
...
|
|
266
|
-
(s) =>
|
|
252
|
+
const j = "magic-helix.config.json", q = ["ai-aligner.config.json"];
|
|
253
|
+
function we(n) {
|
|
254
|
+
const t = (n ? [f.resolve(process.cwd(), n)] : [
|
|
255
|
+
f.resolve(process.cwd(), j),
|
|
256
|
+
...q.map(
|
|
257
|
+
(s) => f.resolve(process.cwd(), s)
|
|
267
258
|
)
|
|
268
259
|
]).find((s, i) => {
|
|
269
260
|
const r = p.existsSync(s);
|
|
270
261
|
return !n && r && i > 0 && console.warn(
|
|
271
262
|
P.yellow(
|
|
272
|
-
` Detected legacy config file ${
|
|
263
|
+
` Detected legacy config file ${f.basename(s)}. Please rename it to ${j}.`
|
|
273
264
|
)
|
|
274
265
|
), r;
|
|
275
266
|
});
|
|
@@ -291,8 +282,8 @@ function Pe(n) {
|
|
|
291
282
|
), {};
|
|
292
283
|
}
|
|
293
284
|
}
|
|
294
|
-
function
|
|
295
|
-
const e =
|
|
285
|
+
function ve(n) {
|
|
286
|
+
const e = _, t = H(
|
|
296
287
|
n.outputDirectory ?? e.outputDirectory
|
|
297
288
|
);
|
|
298
289
|
return {
|
|
@@ -321,7 +312,7 @@ function be(n) {
|
|
|
321
312
|
}
|
|
322
313
|
};
|
|
323
314
|
}
|
|
324
|
-
function
|
|
315
|
+
function H(n) {
|
|
325
316
|
const e = n.trim();
|
|
326
317
|
if (e.endsWith(".github/instruction") || /\binstruction\/?$/.test(e)) {
|
|
327
318
|
const t = e.replace(/instruction\/?$/, "instructions");
|
|
@@ -348,7 +339,7 @@ applyTo: "${e}"
|
|
|
348
339
|
`;
|
|
349
340
|
}
|
|
350
341
|
}
|
|
351
|
-
class
|
|
342
|
+
class U {
|
|
352
343
|
format(e, t, s) {
|
|
353
344
|
return e.replace(/- \*\*([^*]+)\*\*/g, "- **$1** (important)");
|
|
354
345
|
}
|
|
@@ -364,7 +355,7 @@ assistant: claude
|
|
|
364
355
|
`;
|
|
365
356
|
}
|
|
366
357
|
}
|
|
367
|
-
class
|
|
358
|
+
class J {
|
|
368
359
|
format(e, t, s) {
|
|
369
360
|
return e.replace(/- \*\*ALWAYS\*\*/g, "- 🔴").replace(/- \*\*NEVER\*\*/g, "- ❌");
|
|
370
361
|
}
|
|
@@ -380,7 +371,7 @@ context: chat
|
|
|
380
371
|
`;
|
|
381
372
|
}
|
|
382
373
|
}
|
|
383
|
-
class
|
|
374
|
+
class V {
|
|
384
375
|
format(e, t, s) {
|
|
385
376
|
return e;
|
|
386
377
|
}
|
|
@@ -395,22 +386,22 @@ applyTo: "${e}"
|
|
|
395
386
|
`;
|
|
396
387
|
}
|
|
397
388
|
}
|
|
398
|
-
function
|
|
389
|
+
function Pe(n) {
|
|
399
390
|
switch (n) {
|
|
400
391
|
case "github-copilot":
|
|
401
392
|
return new E();
|
|
402
393
|
case "claude":
|
|
403
|
-
return new
|
|
394
|
+
return new U();
|
|
404
395
|
case "copilot-chat":
|
|
405
|
-
return new
|
|
396
|
+
return new J();
|
|
406
397
|
case "generic":
|
|
407
|
-
return new
|
|
398
|
+
return new V();
|
|
408
399
|
default:
|
|
409
400
|
return new E();
|
|
410
401
|
}
|
|
411
402
|
}
|
|
412
403
|
const v = {};
|
|
413
|
-
function
|
|
404
|
+
function Y() {
|
|
414
405
|
const n = require.resolve("@el-j/magic-helix-plugins"), e = v.dirname(n), t = v.join(e, "patterns"), s = /* @__PURE__ */ new Map(), i = [
|
|
415
406
|
"role-definition",
|
|
416
407
|
"organization",
|
|
@@ -431,13 +422,13 @@ function Q() {
|
|
|
431
422
|
name: l,
|
|
432
423
|
category: r,
|
|
433
424
|
content: u,
|
|
434
|
-
priority:
|
|
425
|
+
priority: Q(r)
|
|
435
426
|
});
|
|
436
427
|
}
|
|
437
428
|
}
|
|
438
429
|
return s;
|
|
439
430
|
}
|
|
440
|
-
function
|
|
431
|
+
function Q(n) {
|
|
441
432
|
return {
|
|
442
433
|
"role-definition": 1,
|
|
443
434
|
organization: 2,
|
|
@@ -450,7 +441,7 @@ function X(n) {
|
|
|
450
441
|
// Safety always highest priority (never overridden)
|
|
451
442
|
}[n];
|
|
452
443
|
}
|
|
453
|
-
function
|
|
444
|
+
function X(n, e) {
|
|
454
445
|
const t = [], s = n.get("expert-identity"), i = n.get("scope-boundaries");
|
|
455
446
|
s && t.push(s), i && t.push(i);
|
|
456
447
|
const r = n.get("heading-hierarchy");
|
|
@@ -490,12 +481,12 @@ function K(n, e) {
|
|
|
490
481
|
}
|
|
491
482
|
return e.excludePatterns ? t.filter((u) => !e.excludePatterns?.includes(u.name)) : t;
|
|
492
483
|
}
|
|
493
|
-
function
|
|
494
|
-
const e = n.sort((
|
|
495
|
-
for (const
|
|
496
|
-
s.has(
|
|
497
|
-
const m = s.get(
|
|
498
|
-
m && m.push(
|
|
484
|
+
function K(n) {
|
|
485
|
+
const e = n.sort((g, m) => g.priority - m.priority), t = [], s = /* @__PURE__ */ new Map();
|
|
486
|
+
for (const g of e) {
|
|
487
|
+
s.has(g.category) || s.set(g.category, []);
|
|
488
|
+
const m = s.get(g.category);
|
|
489
|
+
m && m.push(g);
|
|
499
490
|
}
|
|
500
491
|
t.push(`# AI Agent Instructions
|
|
501
492
|
`);
|
|
@@ -503,57 +494,57 @@ function Z(n) {
|
|
|
503
494
|
if (i) {
|
|
504
495
|
t.push(`## Role & Identity
|
|
505
496
|
`);
|
|
506
|
-
for (const
|
|
507
|
-
t.push(w(
|
|
497
|
+
for (const g of i)
|
|
498
|
+
t.push(w(g.content));
|
|
508
499
|
}
|
|
509
500
|
const r = s.get("organization");
|
|
510
501
|
if (r) {
|
|
511
502
|
t.push(`## Instruction Structure
|
|
512
503
|
`);
|
|
513
|
-
for (const
|
|
514
|
-
t.push(w(
|
|
504
|
+
for (const g of r)
|
|
505
|
+
t.push(w(g.content));
|
|
515
506
|
}
|
|
516
507
|
const o = s.get("tool-guidelines");
|
|
517
508
|
if (o) {
|
|
518
509
|
t.push(`## Tool Usage Guidelines
|
|
519
510
|
`);
|
|
520
|
-
for (const
|
|
521
|
-
t.push(w(
|
|
511
|
+
for (const g of o)
|
|
512
|
+
t.push(w(g.content));
|
|
522
513
|
}
|
|
523
514
|
const a = s.get("reasoning");
|
|
524
515
|
if (a) {
|
|
525
516
|
t.push(`## Reasoning & Execution Patterns
|
|
526
517
|
`);
|
|
527
|
-
for (const
|
|
528
|
-
t.push(w(
|
|
518
|
+
for (const g of a)
|
|
519
|
+
t.push(w(g.content));
|
|
529
520
|
}
|
|
530
521
|
const c = s.get("domain-expertise");
|
|
531
522
|
if (c) {
|
|
532
523
|
t.push(`## Domain-Specific Guidelines
|
|
533
524
|
`);
|
|
534
|
-
for (const
|
|
535
|
-
t.push(w(
|
|
525
|
+
for (const g of c)
|
|
526
|
+
t.push(w(g.content));
|
|
536
527
|
}
|
|
537
528
|
const l = s.get("environment");
|
|
538
529
|
if (l) {
|
|
539
530
|
t.push(`## Environment Context
|
|
540
531
|
`);
|
|
541
|
-
for (const
|
|
542
|
-
t.push(w(
|
|
532
|
+
for (const g of l)
|
|
533
|
+
t.push(w(g.content));
|
|
543
534
|
}
|
|
544
535
|
const u = s.get("tone");
|
|
545
536
|
if (u) {
|
|
546
537
|
t.push(`## Communication Style
|
|
547
538
|
`);
|
|
548
|
-
for (const
|
|
549
|
-
t.push(w(
|
|
539
|
+
for (const g of u)
|
|
540
|
+
t.push(w(g.content));
|
|
550
541
|
}
|
|
551
542
|
const d = s.get("safety");
|
|
552
543
|
if (d) {
|
|
553
544
|
t.push(`## Safety & Refusal Protocols
|
|
554
545
|
`);
|
|
555
|
-
for (const
|
|
556
|
-
t.push(w(
|
|
546
|
+
for (const g of d)
|
|
547
|
+
t.push(w(g.content));
|
|
557
548
|
}
|
|
558
549
|
return t.join(`
|
|
559
550
|
|
|
@@ -566,11 +557,11 @@ function w(n) {
|
|
|
566
557
|
);
|
|
567
558
|
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());
|
|
568
559
|
}
|
|
569
|
-
function
|
|
570
|
-
const e =
|
|
571
|
-
return
|
|
560
|
+
function Z(n) {
|
|
561
|
+
const e = Y(), t = X(e, n);
|
|
562
|
+
return K(t);
|
|
572
563
|
}
|
|
573
|
-
const
|
|
564
|
+
const ee = [
|
|
574
565
|
// Role Definition (Critical)
|
|
575
566
|
{
|
|
576
567
|
name: "Expert Identity",
|
|
@@ -669,18 +660,18 @@ const te = [
|
|
|
669
660
|
}
|
|
670
661
|
];
|
|
671
662
|
function $(n) {
|
|
672
|
-
const e =
|
|
663
|
+
const e = ee.map((d) => ({
|
|
673
664
|
element: d,
|
|
674
665
|
passed: d.check(n)
|
|
675
666
|
})), t = e.filter(
|
|
676
667
|
(d) => ["Clear Headings", "Structured Sections"].includes(d.element.name)
|
|
677
|
-
), s =
|
|
668
|
+
), s = C(t), i = e.filter(
|
|
678
669
|
(d) => ["Concrete Examples", "Communication Style", "Forbidden Phrases"].includes(
|
|
679
670
|
d.element.name
|
|
680
671
|
)
|
|
681
|
-
), r =
|
|
672
|
+
), r = C(i), o = e.filter((d) => d.element.required), a = C(o), c = Math.round(
|
|
682
673
|
s * 0.3 + r * 0.2 + a * 0.5
|
|
683
|
-
), l = e.filter((d) => d.element.required && !d.passed).map((d) => d.element.name), u =
|
|
674
|
+
), l = e.filter((d) => d.element.required && !d.passed).map((d) => d.element.name), u = te(e, n);
|
|
684
675
|
return {
|
|
685
676
|
overallScore: c,
|
|
686
677
|
structureScore: s,
|
|
@@ -690,12 +681,12 @@ function $(n) {
|
|
|
690
681
|
missingElements: l
|
|
691
682
|
};
|
|
692
683
|
}
|
|
693
|
-
function
|
|
684
|
+
function C(n) {
|
|
694
685
|
if (n.length === 0) return 100;
|
|
695
686
|
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);
|
|
696
687
|
return Math.round(t / e * 100);
|
|
697
688
|
}
|
|
698
|
-
function
|
|
689
|
+
function te(n, e) {
|
|
699
690
|
const t = [], s = n.filter(
|
|
700
691
|
(a) => a.element.required && !a.passed
|
|
701
692
|
);
|
|
@@ -725,17 +716,17 @@ function se(n, e) {
|
|
|
725
716
|
"Instructions meet quality standards. Consider A/B testing variants for optimization."
|
|
726
717
|
), t;
|
|
727
718
|
}
|
|
728
|
-
function
|
|
719
|
+
function be(n, e = 70) {
|
|
729
720
|
return $(n).overallScore >= e;
|
|
730
721
|
}
|
|
731
|
-
function
|
|
722
|
+
function se(n) {
|
|
732
723
|
return n >= 90 ? "A" : n >= 80 ? "B" : n >= 70 ? "C" : n >= 60 ? "D" : "F";
|
|
733
724
|
}
|
|
734
|
-
function
|
|
725
|
+
function ke(n) {
|
|
735
726
|
const e = [];
|
|
736
727
|
if (e.push(`=== Instruction Quality Report ===
|
|
737
728
|
`), e.push(
|
|
738
|
-
`Overall Score: ${n.overallScore}/100 (${
|
|
729
|
+
`Overall Score: ${n.overallScore}/100 (${se(n.overallScore)})
|
|
739
730
|
`
|
|
740
731
|
), e.push(` Structure: ${n.structureScore}/100`), e.push(` Clarity: ${n.clarityScore}/100`), e.push(` Completeness: ${n.completenessScore}/100
|
|
741
732
|
`), n.missingElements.length > 0) {
|
|
@@ -753,7 +744,7 @@ function Fe(n) {
|
|
|
753
744
|
return e.join(`
|
|
754
745
|
`);
|
|
755
746
|
}
|
|
756
|
-
let
|
|
747
|
+
let ne = class {
|
|
757
748
|
constructor() {
|
|
758
749
|
this.plugins = /* @__PURE__ */ new Map();
|
|
759
750
|
}
|
|
@@ -799,8 +790,8 @@ let ie = class {
|
|
|
799
790
|
return this.plugins.size;
|
|
800
791
|
}
|
|
801
792
|
};
|
|
802
|
-
const h = new
|
|
803
|
-
class
|
|
793
|
+
const h = new ne();
|
|
794
|
+
class ie {
|
|
804
795
|
constructor(e, t = /* @__PURE__ */ new Map()) {
|
|
805
796
|
this.analysisData = e, this.fileContentCache = t;
|
|
806
797
|
}
|
|
@@ -828,14 +819,14 @@ class re {
|
|
|
828
819
|
return new RegExp(`^${t}$`);
|
|
829
820
|
}
|
|
830
821
|
}
|
|
831
|
-
async function
|
|
822
|
+
async function Ce(n, e) {
|
|
832
823
|
const t = /* @__PURE__ */ new Set(), s = [], i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
833
824
|
if (e)
|
|
834
825
|
for (const c of n.configFiles) {
|
|
835
826
|
const l = e(c);
|
|
836
827
|
l && r.set(c, l);
|
|
837
828
|
}
|
|
838
|
-
const o = new
|
|
829
|
+
const o = new ie(n, r);
|
|
839
830
|
if (e) {
|
|
840
831
|
const c = o.getTextFile.bind(o);
|
|
841
832
|
o.getTextFile = (l) => {
|
|
@@ -866,12 +857,12 @@ async function je(n, e) {
|
|
|
866
857
|
metadata: i
|
|
867
858
|
};
|
|
868
859
|
}
|
|
869
|
-
function
|
|
860
|
+
function Se() {
|
|
870
861
|
import("./index-B88j4AyE.js").then((n) => {
|
|
871
862
|
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());
|
|
872
863
|
});
|
|
873
864
|
}
|
|
874
|
-
class
|
|
865
|
+
class je {
|
|
875
866
|
constructor() {
|
|
876
867
|
this.name = "codeowners", this.description = "Detects CODEOWNERS file and provides code ownership instructions", this.version = "1.0.0";
|
|
877
868
|
}
|
|
@@ -915,7 +906,7 @@ class xe {
|
|
|
915
906
|
];
|
|
916
907
|
}
|
|
917
908
|
}
|
|
918
|
-
class
|
|
909
|
+
class Ee {
|
|
919
910
|
constructor() {
|
|
920
911
|
this.name = "docker", this.description = "Detects Docker usage and provides Docker-specific instructions", this.version = "1.0.0";
|
|
921
912
|
}
|
|
@@ -959,7 +950,7 @@ class Te {
|
|
|
959
950
|
}), s;
|
|
960
951
|
}
|
|
961
952
|
}
|
|
962
|
-
class
|
|
953
|
+
class xe {
|
|
963
954
|
constructor() {
|
|
964
955
|
this.name = "github-actions", this.description = "Detects GitHub Actions workflows and provides CI/CD-specific instructions", this.version = "1.0.0";
|
|
965
956
|
}
|
|
@@ -992,7 +983,7 @@ class $e {
|
|
|
992
983
|
];
|
|
993
984
|
}
|
|
994
985
|
}
|
|
995
|
-
class
|
|
986
|
+
class Te {
|
|
996
987
|
constructor() {
|
|
997
988
|
this.name = "gitlab-ci", this.description = "Detects GitLab CI/CD configuration and provides CI/CD-specific instructions", this.version = "1.0.0";
|
|
998
989
|
}
|
|
@@ -1028,7 +1019,7 @@ class Ie {
|
|
|
1028
1019
|
];
|
|
1029
1020
|
}
|
|
1030
1021
|
}
|
|
1031
|
-
class
|
|
1022
|
+
class $e {
|
|
1032
1023
|
constructor() {
|
|
1033
1024
|
this.name = "golang", this.description = "Detects Go (Golang) projects and provides Go-specific instructions", this.version = "1.0.0";
|
|
1034
1025
|
}
|
|
@@ -1062,7 +1053,7 @@ class De {
|
|
|
1062
1053
|
];
|
|
1063
1054
|
}
|
|
1064
1055
|
}
|
|
1065
|
-
class
|
|
1056
|
+
class Ie {
|
|
1066
1057
|
constructor() {
|
|
1067
1058
|
this.name = "monorepo", this.description = "Detects monorepo structures and provides monorepo-specific instructions", this.version = "1.0.0";
|
|
1068
1059
|
}
|
|
@@ -1083,7 +1074,7 @@ class Le {
|
|
|
1083
1074
|
d && (c.hasPipeline = d.includes('"pipeline"'));
|
|
1084
1075
|
} else s ? c.tool = "nx" : i ? c.tool = "pnpm" : r ? c.tool = "lerna" : c.tool = "npm/yarn workspaces";
|
|
1085
1076
|
const l = ["packages/*/package.json", "apps/*/package.json"], u = e.files.filter(
|
|
1086
|
-
(d) => l.some((
|
|
1077
|
+
(d) => l.some((g) => new RegExp(g.replace(/\*/g, "[^/]+")).test(d))
|
|
1087
1078
|
);
|
|
1088
1079
|
return u.length > 0 && (c.packageCount = u.length), {
|
|
1089
1080
|
detected: !0,
|
|
@@ -1116,7 +1107,7 @@ class Le {
|
|
|
1116
1107
|
}), s;
|
|
1117
1108
|
}
|
|
1118
1109
|
}
|
|
1119
|
-
class
|
|
1110
|
+
class De {
|
|
1120
1111
|
constructor() {
|
|
1121
1112
|
this.name = "php", this.description = "Detects PHP projects and provides PHP-specific instructions", this.version = "1.0.0";
|
|
1122
1113
|
}
|
|
@@ -1155,7 +1146,7 @@ class Me {
|
|
|
1155
1146
|
}), s;
|
|
1156
1147
|
}
|
|
1157
1148
|
}
|
|
1158
|
-
class
|
|
1149
|
+
class Le {
|
|
1159
1150
|
constructor() {
|
|
1160
1151
|
this.name = "python", this.description = "Detects Python projects and provides Python-specific instructions", this.version = "1.0.0";
|
|
1161
1152
|
}
|
|
@@ -1191,7 +1182,7 @@ class Oe {
|
|
|
1191
1182
|
];
|
|
1192
1183
|
}
|
|
1193
1184
|
}
|
|
1194
|
-
class
|
|
1185
|
+
class Me {
|
|
1195
1186
|
constructor() {
|
|
1196
1187
|
this.name = "rust", this.description = "Detects Rust projects and provides Rust-specific instructions", this.version = "1.0.0";
|
|
1197
1188
|
}
|
|
@@ -1315,7 +1306,7 @@ class x {
|
|
|
1315
1306
|
*/
|
|
1316
1307
|
async loadLocalPlugin(e) {
|
|
1317
1308
|
try {
|
|
1318
|
-
const t =
|
|
1309
|
+
const t = f.resolve(e);
|
|
1319
1310
|
if (!p.existsSync(t))
|
|
1320
1311
|
throw new Error(`Plugin file not found: ${t}`);
|
|
1321
1312
|
const s = Date.now(), i = await import(t), r = Date.now() - s, o = i.default || i.Plugin || i;
|
|
@@ -1417,7 +1408,7 @@ class x {
|
|
|
1417
1408
|
/**
|
|
1418
1409
|
* Recursively scan directories for project manifests
|
|
1419
1410
|
*/
|
|
1420
|
-
async scanForProjects(e, t =
|
|
1411
|
+
async scanForProjects(e, t = 10) {
|
|
1421
1412
|
const s = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = [
|
|
1422
1413
|
"package.json",
|
|
1423
1414
|
"Cargo.toml",
|
|
@@ -1434,12 +1425,17 @@ class x {
|
|
|
1434
1425
|
"composer.json",
|
|
1435
1426
|
"CMakeLists.txt",
|
|
1436
1427
|
"Makefile",
|
|
1437
|
-
"platformio.ini"
|
|
1428
|
+
"platformio.ini",
|
|
1429
|
+
"Dockerfile",
|
|
1430
|
+
"docker-compose.yml",
|
|
1431
|
+
"turbo.json",
|
|
1432
|
+
"nx.json"
|
|
1438
1433
|
], o = /* @__PURE__ */ new Set([
|
|
1439
1434
|
"node_modules",
|
|
1440
1435
|
"target",
|
|
1441
1436
|
"dist",
|
|
1442
1437
|
"build",
|
|
1438
|
+
"out",
|
|
1443
1439
|
".git",
|
|
1444
1440
|
".svn",
|
|
1445
1441
|
".hg",
|
|
@@ -1449,25 +1445,34 @@ class x {
|
|
|
1449
1445
|
"venv",
|
|
1450
1446
|
"env",
|
|
1451
1447
|
".cargo",
|
|
1452
|
-
".gradle"
|
|
1448
|
+
".gradle",
|
|
1449
|
+
".turbo",
|
|
1450
|
+
".next",
|
|
1451
|
+
".nuxt",
|
|
1452
|
+
"coverage",
|
|
1453
|
+
".cache",
|
|
1454
|
+
".pytest_cache",
|
|
1455
|
+
".mypy_cache",
|
|
1456
|
+
"bin",
|
|
1457
|
+
"obj"
|
|
1453
1458
|
]), a = async (c, l) => {
|
|
1454
1459
|
if (l > t) return;
|
|
1455
|
-
const u =
|
|
1460
|
+
const u = f.normalize(c);
|
|
1456
1461
|
if (!i.has(u)) {
|
|
1457
1462
|
i.add(u);
|
|
1458
1463
|
try {
|
|
1459
1464
|
const d = await p.promises.readdir(c, {
|
|
1460
1465
|
withFileTypes: !0
|
|
1461
1466
|
});
|
|
1462
|
-
let
|
|
1467
|
+
let g = !1;
|
|
1463
1468
|
for (const m of d)
|
|
1464
1469
|
if (!m.isDirectory() && r.includes(m.name)) {
|
|
1465
|
-
s.add(c),
|
|
1470
|
+
s.add(c), g = !0;
|
|
1466
1471
|
break;
|
|
1467
1472
|
}
|
|
1468
1473
|
for (const m of d)
|
|
1469
1474
|
if (m.isDirectory() && !o.has(m.name)) {
|
|
1470
|
-
const D =
|
|
1475
|
+
const D = f.join(c, m.name);
|
|
1471
1476
|
await a(D, l + 1);
|
|
1472
1477
|
}
|
|
1473
1478
|
} catch {
|
|
@@ -1480,35 +1485,50 @@ class x {
|
|
|
1480
1485
|
/**
|
|
1481
1486
|
* Detect all projects in a directory (for monorepo support)
|
|
1482
1487
|
* Enhanced version that recursively scans for ALL project types
|
|
1488
|
+
* Now runs ALL plugins on each discovered path for multi-language support
|
|
1483
1489
|
*/
|
|
1484
1490
|
async detectAllProjects(e) {
|
|
1485
|
-
const t = [], s = /* @__PURE__ */ new Set(), i = this.getAllPlugins();
|
|
1486
|
-
|
|
1491
|
+
const t = [], s = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = this.getAllPlugins();
|
|
1492
|
+
i.add(e);
|
|
1493
|
+
for (const o of r)
|
|
1487
1494
|
try {
|
|
1488
|
-
const
|
|
1489
|
-
if (
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
+
const a = await o.detect(e);
|
|
1496
|
+
if (a) {
|
|
1497
|
+
const c = `${a.projectPath}:${o.name}`;
|
|
1498
|
+
if (s.has(c) || (s.add(c), t.push({ metadata: a, plugin: o })), a.workspaceMembers && a.workspaceMembers.length > 0)
|
|
1499
|
+
for (const l of a.workspaceMembers) {
|
|
1500
|
+
const u = f.resolve(e, l);
|
|
1501
|
+
i.add(u);
|
|
1495
1502
|
}
|
|
1496
|
-
|
|
1497
|
-
} catch (
|
|
1503
|
+
}
|
|
1504
|
+
} catch (a) {
|
|
1498
1505
|
this.logWarning(
|
|
1499
|
-
`Plugin ${
|
|
1506
|
+
`Plugin ${o.name} failed at root: ${a.message}`
|
|
1500
1507
|
);
|
|
1501
1508
|
}
|
|
1502
1509
|
try {
|
|
1503
|
-
const
|
|
1504
|
-
for (const
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
}
|
|
1509
|
-
} catch (r) {
|
|
1510
|
-
this.logWarning(`Recursive scan failed: ${r.message}`);
|
|
1510
|
+
const o = await this.scanForProjects(e);
|
|
1511
|
+
for (const a of o)
|
|
1512
|
+
i.add(a);
|
|
1513
|
+
} catch (o) {
|
|
1514
|
+
this.logWarning(`Recursive scan failed: ${o.message}`);
|
|
1511
1515
|
}
|
|
1516
|
+
for (const o of i)
|
|
1517
|
+
if (o !== e)
|
|
1518
|
+
for (const a of r)
|
|
1519
|
+
try {
|
|
1520
|
+
const c = await a.detect(o);
|
|
1521
|
+
if (c) {
|
|
1522
|
+
const l = `${c.projectPath}:${a.name}`;
|
|
1523
|
+
s.has(l) || (s.add(l), t.push({ metadata: c, plugin: a }), this.log(
|
|
1524
|
+
` ✓ Detected ${a.displayName} at ${f.relative(e, o)}`
|
|
1525
|
+
));
|
|
1526
|
+
}
|
|
1527
|
+
} catch (c) {
|
|
1528
|
+
this.logWarning(
|
|
1529
|
+
`Plugin ${a.name} failed at ${o}: ${c.message}`
|
|
1530
|
+
);
|
|
1531
|
+
}
|
|
1512
1532
|
return t;
|
|
1513
1533
|
}
|
|
1514
1534
|
/**
|
|
@@ -1722,12 +1742,12 @@ const y = class y {
|
|
|
1722
1742
|
resolvePath(e) {
|
|
1723
1743
|
if (e.startsWith("~/")) {
|
|
1724
1744
|
const s = process.env.HOME || process.env.USERPROFILE || "";
|
|
1725
|
-
return
|
|
1745
|
+
return f.join(s, e.slice(2));
|
|
1726
1746
|
}
|
|
1727
|
-
if (
|
|
1747
|
+
if (f.isAbsolute(e))
|
|
1728
1748
|
return e;
|
|
1729
1749
|
const t = this.config.workspacePath || process.cwd();
|
|
1730
|
-
return
|
|
1750
|
+
return f.resolve(t, e);
|
|
1731
1751
|
}
|
|
1732
1752
|
/**
|
|
1733
1753
|
* Apply priority overrides from configuration
|
|
@@ -1759,7 +1779,7 @@ const y = class y {
|
|
|
1759
1779
|
static async loadConfig(e) {
|
|
1760
1780
|
const t = [], s = process.env.HOME || process.env.USERPROFILE;
|
|
1761
1781
|
if (s) {
|
|
1762
|
-
const i =
|
|
1782
|
+
const i = f.join(
|
|
1763
1783
|
s,
|
|
1764
1784
|
".magic-helix",
|
|
1765
1785
|
"config.json"
|
|
@@ -1767,7 +1787,7 @@ const y = class y {
|
|
|
1767
1787
|
r && t.push(r);
|
|
1768
1788
|
}
|
|
1769
1789
|
if (e) {
|
|
1770
|
-
const i =
|
|
1790
|
+
const i = f.join(e, ".magic-helix.json"), r = await y.loadConfigFromFile(i);
|
|
1771
1791
|
r && (r.workspacePath = e, t.push(r));
|
|
1772
1792
|
}
|
|
1773
1793
|
return t.length === 0 ? { workspacePath: e } : t.reduce(
|
|
@@ -1790,14 +1810,14 @@ const y = class y {
|
|
|
1790
1810
|
};
|
|
1791
1811
|
y.instance = null;
|
|
1792
1812
|
let b = y;
|
|
1793
|
-
function
|
|
1813
|
+
function Oe() {
|
|
1794
1814
|
return b.getInstance();
|
|
1795
1815
|
}
|
|
1796
|
-
async function
|
|
1816
|
+
async function Re(n) {
|
|
1797
1817
|
const e = b.getInstance();
|
|
1798
1818
|
return await e.initialize(n), e;
|
|
1799
1819
|
}
|
|
1800
|
-
class
|
|
1820
|
+
class _e {
|
|
1801
1821
|
constructor(e = {}) {
|
|
1802
1822
|
this.templateCache = /* @__PURE__ */ new Map(), this.config = e.config || {}, this.verbose = e.verbose ?? !1, this.cacheEnabled = e.cacheEnabled ?? !0;
|
|
1803
1823
|
}
|
|
@@ -1925,7 +1945,7 @@ class We {
|
|
|
1925
1945
|
return null;
|
|
1926
1946
|
const r = this.config.extensions || [".md", ".txt", ""];
|
|
1927
1947
|
for (const o of r) {
|
|
1928
|
-
const a = t.endsWith(o) ? t : `${t}${o}`, c =
|
|
1948
|
+
const a = t.endsWith(o) ? t : `${t}${o}`, c = f.join(i, a);
|
|
1929
1949
|
if (p.existsSync(c))
|
|
1930
1950
|
return this.loadFromPath(c, s);
|
|
1931
1951
|
}
|
|
@@ -1960,9 +1980,9 @@ class We {
|
|
|
1960
1980
|
resolvePath(e) {
|
|
1961
1981
|
if (e.startsWith("~/")) {
|
|
1962
1982
|
const t = process.env.HOME || process.env.USERPROFILE || "";
|
|
1963
|
-
return
|
|
1983
|
+
return f.join(t, e.slice(2));
|
|
1964
1984
|
}
|
|
1965
|
-
return
|
|
1985
|
+
return f.isAbsolute(e) ? e : f.resolve(process.cwd(), e);
|
|
1966
1986
|
}
|
|
1967
1987
|
/**
|
|
1968
1988
|
* Cache a template
|
|
@@ -1978,8 +1998,8 @@ class We {
|
|
|
1978
1998
|
}
|
|
1979
1999
|
}
|
|
1980
2000
|
const k = ".magic-helix", I = "meta-instructions.json";
|
|
1981
|
-
function
|
|
1982
|
-
const e =
|
|
2001
|
+
function re(n) {
|
|
2002
|
+
const e = f.join(n, k, I);
|
|
1983
2003
|
if (!p.existsSync(e))
|
|
1984
2004
|
return null;
|
|
1985
2005
|
try {
|
|
@@ -1991,23 +2011,36 @@ function oe(n) {
|
|
|
1991
2011
|
), null;
|
|
1992
2012
|
}
|
|
1993
2013
|
}
|
|
1994
|
-
function
|
|
1995
|
-
const e =
|
|
2014
|
+
function oe(n) {
|
|
2015
|
+
const e = f.join(n, k, "overrides"), t = /* @__PURE__ */ new Map();
|
|
1996
2016
|
if (!p.existsSync(e))
|
|
1997
2017
|
return t;
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2018
|
+
try {
|
|
2019
|
+
const s = (r) => {
|
|
2020
|
+
const o = [], a = p.readdirSync(r, { withFileTypes: !0 });
|
|
2021
|
+
for (const c of a) {
|
|
2022
|
+
const l = f.join(r, c.name);
|
|
2023
|
+
c.isDirectory() ? o.push(...s(l)) : c.isFile() && c.name.endsWith(".md") && o.push(l);
|
|
2024
|
+
}
|
|
2025
|
+
return o;
|
|
2026
|
+
}, i = s(e);
|
|
2027
|
+
for (const r of i) {
|
|
2028
|
+
const o = f.basename(r, ".md"), a = p.readFileSync(r, "utf-8");
|
|
2029
|
+
t.set(o, a);
|
|
2030
|
+
}
|
|
2031
|
+
} catch (s) {
|
|
2032
|
+
console.warn(
|
|
2033
|
+
`Failed to load override instructions: ${s.message}`
|
|
2034
|
+
);
|
|
2002
2035
|
}
|
|
2003
2036
|
return t;
|
|
2004
2037
|
}
|
|
2005
|
-
function
|
|
2038
|
+
function ae(n, e, t) {
|
|
2006
2039
|
const s = new Map(n);
|
|
2007
2040
|
if (e.ignoreTags)
|
|
2008
2041
|
for (const r of e.ignoreTags)
|
|
2009
2042
|
s.delete(r);
|
|
2010
|
-
const i =
|
|
2043
|
+
const i = oe(t);
|
|
2011
2044
|
for (const [r, o] of i)
|
|
2012
2045
|
s.set(r, o);
|
|
2013
2046
|
if (e.overrides)
|
|
@@ -2031,7 +2064,7 @@ ${r.content}`) : s.set(r.tag, r.content);
|
|
|
2031
2064
|
}
|
|
2032
2065
|
return s;
|
|
2033
2066
|
}
|
|
2034
|
-
function
|
|
2067
|
+
function ce(n, e) {
|
|
2035
2068
|
const t = new Map(n);
|
|
2036
2069
|
let s = e.template;
|
|
2037
2070
|
for (const i of e.tags) {
|
|
@@ -2040,22 +2073,22 @@ function le(n, e) {
|
|
|
2040
2073
|
}
|
|
2041
2074
|
return t.set(e.outputTag, s), t;
|
|
2042
2075
|
}
|
|
2043
|
-
function
|
|
2044
|
-
const t =
|
|
2076
|
+
function Ae(n, e) {
|
|
2077
|
+
const t = re(e);
|
|
2045
2078
|
if (!t)
|
|
2046
2079
|
return n;
|
|
2047
|
-
let s =
|
|
2080
|
+
let s = ae(n, t, e);
|
|
2048
2081
|
if (t.combiners)
|
|
2049
2082
|
for (const i of t.combiners)
|
|
2050
|
-
s =
|
|
2083
|
+
s = ce(s, i);
|
|
2051
2084
|
return s;
|
|
2052
2085
|
}
|
|
2053
|
-
function
|
|
2054
|
-
const e =
|
|
2086
|
+
function We(n) {
|
|
2087
|
+
const e = f.join(n, k);
|
|
2055
2088
|
return p.existsSync(e);
|
|
2056
2089
|
}
|
|
2057
|
-
function
|
|
2058
|
-
const e =
|
|
2090
|
+
function Ne(n) {
|
|
2091
|
+
const e = f.join(n, k), t = f.join(e, "overrides");
|
|
2059
2092
|
p.mkdirSync(e, { recursive: !0 }), p.mkdirSync(t, { recursive: !0 });
|
|
2060
2093
|
const s = {
|
|
2061
2094
|
overrides: [
|
|
@@ -2081,8 +2114,8 @@ Your content here...`,
|
|
|
2081
2114
|
}
|
|
2082
2115
|
],
|
|
2083
2116
|
ignoreTags: ["unwanted-tag"]
|
|
2084
|
-
}, i =
|
|
2085
|
-
p.writeFileSync(i, JSON.stringify(s, null, 2)), p.writeFileSync(
|
|
2117
|
+
}, i = f.join(e, I);
|
|
2118
|
+
p.writeFileSync(i, JSON.stringify(s, null, 2)), p.writeFileSync(f.join(t, "example.md"), `# Example Override
|
|
2086
2119
|
|
|
2087
2120
|
This file overrides the default instructions for this tag.
|
|
2088
2121
|
Create files like:
|
|
@@ -2092,11 +2125,11 @@ Create files like:
|
|
|
2092
2125
|
`✅ Initialized .magic-helix/ directory structure at: ${e}`
|
|
2093
2126
|
);
|
|
2094
2127
|
}
|
|
2095
|
-
class
|
|
2128
|
+
class le {
|
|
2096
2129
|
constructor(e = {}) {
|
|
2097
2130
|
this.enabled = !!e.enabled;
|
|
2098
|
-
const t = e.dir ||
|
|
2099
|
-
this.filePath =
|
|
2131
|
+
const t = e.dir || F.resolve(process.cwd(), ".magic-helix/telemetry");
|
|
2132
|
+
this.filePath = F.join(t, "events.jsonl"), this.sessionId = e.sessionId, this.variant = e.variant, this.projectRoot = e.projectRoot, this.enabled && S.mkdirSync(F.dirname(this.filePath), { recursive: !0 });
|
|
2100
2133
|
}
|
|
2101
2134
|
isEnabled() {
|
|
2102
2135
|
return this.enabled;
|
|
@@ -2115,13 +2148,13 @@ class ue {
|
|
|
2115
2148
|
S.appendFileSync(this.filePath, s, "utf-8");
|
|
2116
2149
|
}
|
|
2117
2150
|
}
|
|
2118
|
-
function
|
|
2151
|
+
function ze(n = {}) {
|
|
2119
2152
|
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();
|
|
2120
|
-
return new
|
|
2153
|
+
return new le({ enabled: e, dir: t, sessionId: s, variant: i, projectRoot: r });
|
|
2121
2154
|
}
|
|
2122
|
-
function
|
|
2155
|
+
function Ge(n) {
|
|
2123
2156
|
return n.map((e) => {
|
|
2124
|
-
const t =
|
|
2157
|
+
const t = Z(e.context), s = $(t);
|
|
2125
2158
|
return {
|
|
2126
2159
|
variant: e.name,
|
|
2127
2160
|
instructions: t,
|
|
@@ -2133,7 +2166,7 @@ function qe(n) {
|
|
|
2133
2166
|
};
|
|
2134
2167
|
});
|
|
2135
2168
|
}
|
|
2136
|
-
function
|
|
2169
|
+
function Be(n) {
|
|
2137
2170
|
return n.length === 0 ? {
|
|
2138
2171
|
variant: "",
|
|
2139
2172
|
instructions: "",
|
|
@@ -2147,7 +2180,7 @@ function He(n) {
|
|
|
2147
2180
|
n[0]
|
|
2148
2181
|
);
|
|
2149
2182
|
}
|
|
2150
|
-
function
|
|
2183
|
+
function qe(n, e) {
|
|
2151
2184
|
if (e?.isEnabled())
|
|
2152
2185
|
for (const t of n) {
|
|
2153
2186
|
const s = {
|
|
@@ -2163,55 +2196,55 @@ function Ue(n, e) {
|
|
|
2163
2196
|
e.track(s);
|
|
2164
2197
|
}
|
|
2165
2198
|
}
|
|
2166
|
-
const
|
|
2167
|
-
L(
|
|
2199
|
+
const ue = M(import.meta.url);
|
|
2200
|
+
L(ue);
|
|
2168
2201
|
export {
|
|
2169
|
-
|
|
2170
|
-
|
|
2202
|
+
_ as BUILT_IN_CONFIG,
|
|
2203
|
+
je as CodeOwnersPlugin,
|
|
2171
2204
|
T as DEFAULT_AI_REFINEMENT,
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2205
|
+
Ee as DockerPlugin,
|
|
2206
|
+
xe as GitHubActionsPlugin,
|
|
2207
|
+
Te as GitLabCIPlugin,
|
|
2208
|
+
$e as GolangPlugin,
|
|
2209
|
+
ee as INSTRUCTION_ELEMENTS,
|
|
2210
|
+
Ie as MonorepoPlugin,
|
|
2211
|
+
De as PHPPlugin,
|
|
2179
2212
|
x as PluginLoader,
|
|
2180
2213
|
b as PluginRegistry,
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2214
|
+
ne as PluginRegistryOld,
|
|
2215
|
+
Le as PythonPlugin,
|
|
2216
|
+
Me as RustPlugin,
|
|
2217
|
+
le as TelemetryClient,
|
|
2218
|
+
_e as TemplateLoader,
|
|
2219
|
+
Be as analyzeBestVariant,
|
|
2220
|
+
me as analyzeProjectTags,
|
|
2221
|
+
Ce as analyzeWithPlugins,
|
|
2222
|
+
ce as applyCombiner,
|
|
2223
|
+
Ae as applyMetaInstructions,
|
|
2224
|
+
ae as applyOverrides,
|
|
2225
|
+
K as combinePatterns,
|
|
2226
|
+
ze as createTelemetry,
|
|
2227
|
+
ye as estimateTokens,
|
|
2228
|
+
ke as formatValidationReport,
|
|
2229
|
+
Ge as generateABVariants,
|
|
2230
|
+
Z as generateInstructions,
|
|
2231
|
+
Pe as getFormatter,
|
|
2232
|
+
se as getQualityGrade,
|
|
2233
|
+
Oe as getRegistry,
|
|
2234
|
+
We as hasMetaInstructions,
|
|
2235
|
+
Ne as initMetaInstructions,
|
|
2236
|
+
Re as initializeRegistry,
|
|
2237
|
+
re as loadMetaConfig,
|
|
2238
|
+
oe as loadOverrideInstructions,
|
|
2239
|
+
Y as loadPatternTemplates,
|
|
2240
|
+
we as loadUserConfig,
|
|
2241
|
+
ve as mergeConfigs,
|
|
2242
|
+
be as passesQualityThreshold,
|
|
2210
2243
|
h as pluginRegistry,
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2244
|
+
he as refineInstructions,
|
|
2245
|
+
Se as registerBuiltInPlugins,
|
|
2246
|
+
X as selectPatterns,
|
|
2247
|
+
qe as trackABTest,
|
|
2215
2248
|
$ as validateInstructions
|
|
2216
2249
|
};
|
|
2217
2250
|
//# sourceMappingURL=index.mjs.map
|