agentic-qe 3.7.11 → 3.7.13

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 (34) hide show
  1. package/.claude/skills/.validation/schemas/skill-frontmatter.schema.json +5 -0
  2. package/.claude/skills/release/SKILL.md +44 -2
  3. package/.claude/skills/skills-manifest.json +1 -1
  4. package/CHANGELOG.md +20 -0
  5. package/assets/skills/.validation/schemas/skill-frontmatter.schema.json +5 -0
  6. package/dist/cli/bundle.js +357 -307
  7. package/dist/domains/test-generation/services/pattern-matcher.js +1 -1
  8. package/dist/domains/test-generation/services/pattern-matcher.js.map +1 -1
  9. package/dist/domains/test-generation/services/test-generator.js +1 -1
  10. package/dist/domains/test-generation/services/test-generator.js.map +1 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +5 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp/bundle.js +206 -165
  16. package/dist/shared/parsers/typescript-parser.d.ts +1 -1
  17. package/dist/shared/parsers/typescript-parser.d.ts.map +1 -1
  18. package/dist/shared/parsers/typescript-parser.js +1 -1
  19. package/dist/shared/parsers/typescript-parser.js.map +1 -1
  20. package/dist/validation/index.d.ts +4 -0
  21. package/dist/validation/index.d.ts.map +1 -1
  22. package/dist/validation/index.js +8 -0
  23. package/dist/validation/index.js.map +1 -1
  24. package/dist/validation/trigger-optimizer.d.ts +61 -0
  25. package/dist/validation/trigger-optimizer.d.ts.map +1 -0
  26. package/dist/validation/trigger-optimizer.js +356 -0
  27. package/dist/validation/trigger-optimizer.js.map +1 -0
  28. package/dist/validation/version-comparator.d.ts +115 -0
  29. package/dist/validation/version-comparator.d.ts.map +1 -0
  30. package/dist/validation/version-comparator.js +322 -0
  31. package/dist/validation/version-comparator.js.map +1 -0
  32. package/package.json +1 -1
  33. package/scripts/build-cli.mjs +62 -11
  34. package/scripts/build-mcp.mjs +53 -11
@@ -52,7 +52,6 @@ const nativeModules = [
52
52
 
53
53
  // Pure JS externals that work fine with ESM import
54
54
  const esmExternals = [
55
- 'typescript',
56
55
  'fast-glob',
57
56
  'fast-json-patch',
58
57
  'yaml',
@@ -64,19 +63,62 @@ const esmExternals = [
64
63
  ];
65
64
 
66
65
  /**
67
- * esbuild plugin: Rewrite bare "typescript" import to explicit subpath.
66
+ * esbuild plugin: Lazy-load typescript via createRequire().
68
67
  *
69
- * TypeScript's package.json has no "exports" field only "main": "./lib/typescript.js".
70
- * Node.js 22+ ESM legacyMainResolve fails to resolve the bare specifier in some
71
- * environments (devcontainers, NVM-managed Node). Rewriting to the explicit subpath
72
- * bypasses legacyMainResolve entirely (see issue #267).
68
+ * typescript is a devDependency it won't be available when users install
69
+ * agentic-qe globally. A top-level ESM `import` would crash the entire CLI
70
+ * (even `aqe --version`). This plugin replaces the static import with a
71
+ * lazy createRequire() call that only executes when the TypeScript parser
72
+ * is actually used, and throws a helpful error if typescript is missing.
73
73
  */
74
- const typescriptResolvePlugin = {
75
- name: 'typescript-resolve',
74
+ /**
75
+ * esbuild plugin: Lazy-load typescript via createRequire().
76
+ *
77
+ * typescript is a devDependency — it won't be available when users install
78
+ * agentic-qe globally. A top-level ESM `import` would crash the entire CLI
79
+ * (even `aqe --version`). This plugin replaces the static import with a
80
+ * lazy createRequire() call that only executes when the TypeScript parser
81
+ * is actually used, and throws a helpful error if typescript is missing.
82
+ */
83
+ const typescriptLazyPlugin = {
84
+ name: 'typescript-lazy',
76
85
  setup(build) {
77
86
  build.onResolve({ filter: /^typescript$/ }, () => ({
78
- path: 'typescript/lib/typescript.js',
79
- external: true,
87
+ path: 'typescript',
88
+ namespace: 'typescript-lazy',
89
+ }));
90
+
91
+ build.onLoad({ filter: /.*/, namespace: 'typescript-lazy' }, () => ({
92
+ contents: [
93
+ 'import { createRequire } from "module";',
94
+ 'let _ts;',
95
+ 'function _load() {',
96
+ ' if (!_ts) {',
97
+ ' const req = createRequire(import.meta.url);',
98
+ ' try { _ts = req("typescript"); }',
99
+ ' catch {',
100
+ ' try { _ts = req("typescript/lib/typescript.js"); }',
101
+ ' catch {',
102
+ ' _ts = new Proxy({}, { get(_, p) {',
103
+ ' if (p === "__esModule" || typeof p === "symbol") return undefined;',
104
+ ' throw new Error("TypeScript is required for code analysis. Install it: npm install -g typescript");',
105
+ ' }});',
106
+ ' }',
107
+ ' }',
108
+ ' }',
109
+ ' return _ts;',
110
+ '}',
111
+ 'export default new Proxy({}, {',
112
+ ' get(_, p) { return _load()[p]; },',
113
+ ' has(_, p) { return p in _load(); },',
114
+ ' ownKeys() { return Object.keys(_load()); },',
115
+ ' getOwnPropertyDescriptor(_, p) {',
116
+ ' const v = _load()[p];',
117
+ ' if (v !== undefined) return { configurable: true, enumerable: true, value: v };',
118
+ ' },',
119
+ '});',
120
+ ].join('\n'),
121
+ loader: 'js',
80
122
  }));
81
123
  },
82
124
  };
@@ -124,7 +166,7 @@ try {
124
166
  platform: 'node',
125
167
  format: 'esm',
126
168
  external: esmExternals,
127
- plugins: [typescriptResolvePlugin, nativeRequirePlugin],
169
+ plugins: [typescriptLazyPlugin, nativeRequirePlugin],
128
170
  outfile: join(__dirname, '..', 'dist/mcp/bundle.js'),
129
171
  define: {
130
172
  '__CLI_VERSION__': JSON.stringify(version),