@harness-engineering/cli 1.13.1 → 1.14.0

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 (139) hide show
  1. package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +39 -0
  2. package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +44 -0
  3. package/dist/agents/skills/claude-code/harness-execution/SKILL.md +44 -0
  4. package/dist/agents/skills/claude-code/harness-planning/SKILL.md +39 -0
  5. package/dist/agents/skills/claude-code/harness-release-readiness/SKILL.md +3 -3
  6. package/dist/agents/skills/claude-code/harness-verification/SKILL.md +35 -0
  7. package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +11 -3
  8. package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +39 -0
  9. package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +44 -0
  10. package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +44 -0
  11. package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +39 -0
  12. package/dist/agents/skills/gemini-cli/harness-release-readiness/SKILL.md +3 -3
  13. package/dist/agents/skills/gemini-cli/harness-verification/SKILL.md +35 -0
  14. package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +11 -3
  15. package/dist/agents-md-YTYQDA3P.js +8 -0
  16. package/dist/{architecture-2R5Z4ZAF.js → architecture-JQZYM4US.js} +4 -4
  17. package/dist/bin/harness-mcp.js +14 -14
  18. package/dist/bin/harness.js +24 -24
  19. package/dist/{check-phase-gate-2OFZ7OWW.js → check-phase-gate-L3RADYWO.js} +4 -4
  20. package/dist/{chunk-QY4T6YAZ.js → chunk-3C2MLBPJ.js} +4 -4
  21. package/dist/{chunk-UAX4I5ZE.js → chunk-6KTUUFRN.js} +2 -2
  22. package/dist/{chunk-ND6PNADU.js → chunk-7IP4JIFL.js} +9 -9
  23. package/dist/{chunk-C2ERUR3L.js → chunk-7MJAPE3Z.js} +165 -49
  24. package/dist/{chunk-PQ5YK4AY.js → chunk-ABQHQ6I5.js} +1583 -1169
  25. package/dist/{chunk-QPEH2QPG.js → chunk-DBSOCI3G.js} +53 -54
  26. package/dist/{chunk-MHBMTPW7.js → chunk-ERS5EVUZ.js} +9 -0
  27. package/dist/{chunk-JSTQ3AWB.js → chunk-FIAPHX37.js} +1 -1
  28. package/dist/{chunk-IMFVFNJE.js → chunk-FTMXDOR6.js} +1 -1
  29. package/dist/{chunk-72GHBOL2.js → chunk-GZKSBLQL.js} +1 -1
  30. package/dist/{chunk-K6XAPGML.js → chunk-H7Y5CKTM.js} +1 -1
  31. package/dist/{chunk-4ZMOCPYO.js → chunk-NLVUVUGD.js} +1 -1
  32. package/dist/{chunk-Z77YQRQT.js → chunk-O5OJVPL6.js} +16 -5
  33. package/dist/{chunk-NKDM3FMH.js → chunk-OD3S2NHN.js} +1 -1
  34. package/dist/{chunk-65FRIL4D.js → chunk-OSXBPAMK.js} +1 -1
  35. package/dist/{chunk-DZS7CJKL.js → chunk-OXLLOSSR.js} +45 -47
  36. package/dist/{chunk-TS3XWPW5.js → chunk-RCWZBSK5.js} +1 -1
  37. package/dist/{chunk-NOPU4RZ4.js → chunk-S2FXOWOR.js} +3 -3
  38. package/dist/{chunk-VUCPTQ6G.js → chunk-SD3SQOZ2.js} +1 -1
  39. package/dist/{chunk-IM32EEDM.js → chunk-TPOTOBR7.js} +9 -9
  40. package/dist/{chunk-SSKDAOX5.js → chunk-XKECDXJS.js} +436 -340
  41. package/dist/{chunk-TKJZKICB.js → chunk-YPYGXRDR.js} +7 -7
  42. package/dist/{chunk-Q6AB7W5Z.js → chunk-YQ6KC6TE.js} +1 -1
  43. package/dist/{chunk-NERR4TAO.js → chunk-YZD2MRNQ.js} +972 -747
  44. package/dist/ci-workflow-EQZFVX3P.js +8 -0
  45. package/dist/{dist-HXHWB7SV.js → dist-B26DFXMP.js} +571 -478
  46. package/dist/{dist-L7LAAQAS.js → dist-DZ63LLUD.js} +1 -1
  47. package/dist/{dist-2B363XUH.js → dist-HWXF2C3R.js} +18 -2
  48. package/dist/{dist-D4RYGUZE.js → dist-USY2C5JL.js} +3 -1
  49. package/dist/{docs-FZOPM4GK.js → docs-7ECGYMAV.js} +4 -4
  50. package/dist/engine-EG4EH4IX.js +8 -0
  51. package/dist/{entropy-LVHJMFGH.js → entropy-5USWKLVS.js} +3 -3
  52. package/dist/{feedback-IHLVLMRD.js → feedback-UTBXZZHF.js} +1 -1
  53. package/dist/{generate-agent-definitions-64S3CLEZ.js → generate-agent-definitions-3PM5EU7V.js} +4 -4
  54. package/dist/{graph-loader-GJZ4FN4Y.js → graph-loader-2M2HXDQI.js} +1 -1
  55. package/dist/index.d.ts +148 -9
  56. package/dist/index.js +24 -24
  57. package/dist/loader-ZPALXIVR.js +10 -0
  58. package/dist/{mcp-JQUI7BVZ.js → mcp-362EZHF4.js} +14 -14
  59. package/dist/{performance-ZTVSUANN.js → performance-OQAFMJUD.js} +3 -3
  60. package/dist/{review-pipeline-76JHKGSV.js → review-pipeline-C4GCFVGP.js} +1 -1
  61. package/dist/runtime-7YLVK453.js +9 -0
  62. package/dist/{security-FWQZF2IZ.js → security-PZOX7AQS.js} +1 -1
  63. package/dist/templates/axum/Cargo.toml.hbs +8 -0
  64. package/dist/templates/axum/src/main.rs +12 -0
  65. package/dist/templates/axum/template.json +16 -0
  66. package/dist/templates/django/manage.py.hbs +19 -0
  67. package/dist/templates/django/requirements.txt.hbs +1 -0
  68. package/dist/templates/django/src/settings.py.hbs +44 -0
  69. package/dist/templates/django/src/urls.py +6 -0
  70. package/dist/templates/django/src/wsgi.py.hbs +9 -0
  71. package/dist/templates/django/template.json +21 -0
  72. package/dist/templates/express/package.json.hbs +15 -0
  73. package/dist/templates/express/src/app.ts +12 -0
  74. package/dist/templates/express/src/lib/.gitkeep +0 -0
  75. package/dist/templates/express/template.json +16 -0
  76. package/dist/templates/fastapi/requirements.txt.hbs +2 -0
  77. package/dist/templates/fastapi/src/main.py +8 -0
  78. package/dist/templates/fastapi/template.json +20 -0
  79. package/dist/templates/gin/go.mod.hbs +5 -0
  80. package/dist/templates/gin/main.go +15 -0
  81. package/dist/templates/gin/template.json +19 -0
  82. package/dist/templates/go-base/.golangci.yml +16 -0
  83. package/dist/templates/go-base/AGENTS.md.hbs +35 -0
  84. package/dist/templates/go-base/go.mod.hbs +3 -0
  85. package/dist/templates/go-base/harness.config.json.hbs +17 -0
  86. package/dist/templates/go-base/main.go +7 -0
  87. package/dist/templates/go-base/template.json +14 -0
  88. package/dist/templates/java-base/AGENTS.md.hbs +35 -0
  89. package/dist/templates/java-base/checkstyle.xml +20 -0
  90. package/dist/templates/java-base/harness.config.json.hbs +16 -0
  91. package/dist/templates/java-base/pom.xml.hbs +39 -0
  92. package/dist/templates/java-base/src/main/java/App.java.hbs +5 -0
  93. package/dist/templates/java-base/template.json +13 -0
  94. package/dist/templates/nestjs/nest-cli.json +5 -0
  95. package/dist/templates/nestjs/package.json.hbs +18 -0
  96. package/dist/templates/nestjs/src/app.module.ts +8 -0
  97. package/dist/templates/nestjs/src/lib/.gitkeep +0 -0
  98. package/dist/templates/nestjs/src/main.ts +11 -0
  99. package/dist/templates/nestjs/template.json +16 -0
  100. package/dist/templates/nextjs/template.json +15 -1
  101. package/dist/templates/python-base/.python-version +1 -0
  102. package/dist/templates/python-base/AGENTS.md.hbs +32 -0
  103. package/dist/templates/python-base/harness.config.json.hbs +16 -0
  104. package/dist/templates/python-base/pyproject.toml.hbs +18 -0
  105. package/dist/templates/python-base/ruff.toml +5 -0
  106. package/dist/templates/python-base/src/__init__.py +0 -0
  107. package/dist/templates/python-base/template.json +13 -0
  108. package/dist/templates/react-vite/index.html +12 -0
  109. package/dist/templates/react-vite/package.json.hbs +18 -0
  110. package/dist/templates/react-vite/src/App.tsx +7 -0
  111. package/dist/templates/react-vite/src/lib/.gitkeep +0 -0
  112. package/dist/templates/react-vite/src/main.tsx +9 -0
  113. package/dist/templates/react-vite/template.json +19 -0
  114. package/dist/templates/react-vite/vite.config.ts +6 -0
  115. package/dist/templates/rust-base/AGENTS.md.hbs +35 -0
  116. package/dist/templates/rust-base/Cargo.toml.hbs +6 -0
  117. package/dist/templates/rust-base/clippy.toml +2 -0
  118. package/dist/templates/rust-base/harness.config.json.hbs +17 -0
  119. package/dist/templates/rust-base/src/main.rs +3 -0
  120. package/dist/templates/rust-base/template.json +14 -0
  121. package/dist/templates/spring-boot/pom.xml.hbs +50 -0
  122. package/dist/templates/spring-boot/src/main/java/Application.java.hbs +19 -0
  123. package/dist/templates/spring-boot/template.json +15 -0
  124. package/dist/templates/vue/index.html +12 -0
  125. package/dist/templates/vue/package.json.hbs +16 -0
  126. package/dist/templates/vue/src/App.vue +7 -0
  127. package/dist/templates/vue/src/lib/.gitkeep +0 -0
  128. package/dist/templates/vue/src/main.ts +4 -0
  129. package/dist/templates/vue/template.json +19 -0
  130. package/dist/templates/vue/vite.config.ts +6 -0
  131. package/dist/{validate-GCHZJIL7.js → validate-FD3Z6VJD.js} +4 -4
  132. package/dist/validate-cross-check-WNJM6H2D.js +8 -0
  133. package/package.json +5 -5
  134. package/dist/agents-md-XU3BHE22.js +0 -8
  135. package/dist/ci-workflow-EHV65NQB.js +0 -8
  136. package/dist/engine-OL4T6NZS.js +0 -8
  137. package/dist/loader-DPYFB6R6.js +0 -10
  138. package/dist/runtime-X7U6SC7K.js +0 -9
  139. package/dist/validate-cross-check-STFHYMAZ.js +0 -8
@@ -0,0 +1,8 @@
1
+ import {
2
+ generateAgentsMd
3
+ } from "./chunk-OD3S2NHN.js";
4
+ import "./chunk-ABQHQ6I5.js";
5
+ import "./chunk-ERS5EVUZ.js";
6
+ export {
7
+ generateAgentsMd
8
+ };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  checkDependenciesDefinition,
3
3
  handleCheckDependencies
4
- } from "./chunk-QY4T6YAZ.js";
5
- import "./chunk-K6XAPGML.js";
4
+ } from "./chunk-3C2MLBPJ.js";
5
+ import "./chunk-H7Y5CKTM.js";
6
6
  import "./chunk-IDZNPTYD.js";
7
7
  import "./chunk-W6Y7ZW3Y.js";
8
- import "./chunk-PQ5YK4AY.js";
9
- import "./chunk-MHBMTPW7.js";
8
+ import "./chunk-ABQHQ6I5.js";
9
+ import "./chunk-ERS5EVUZ.js";
10
10
  export {
11
11
  checkDependenciesDefinition,
12
12
  handleCheckDependencies
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startServer
4
- } from "../chunk-NERR4TAO.js";
5
- import "../chunk-DZS7CJKL.js";
6
- import "../chunk-TKJZKICB.js";
7
- import "../chunk-IM32EEDM.js";
8
- import "../chunk-65FRIL4D.js";
9
- import "../chunk-4ZMOCPYO.js";
4
+ } from "../chunk-YZD2MRNQ.js";
5
+ import "../chunk-OXLLOSSR.js";
6
+ import "../chunk-YPYGXRDR.js";
7
+ import "../chunk-TPOTOBR7.js";
8
+ import "../chunk-OSXBPAMK.js";
9
+ import "../chunk-NLVUVUGD.js";
10
10
  import "../chunk-ZOAWBDWU.js";
11
- import "../chunk-NOPU4RZ4.js";
12
- import "../chunk-IMFVFNJE.js";
13
- import "../chunk-QY4T6YAZ.js";
14
- import "../chunk-K6XAPGML.js";
15
- import "../chunk-ND6PNADU.js";
16
- import "../chunk-Z77YQRQT.js";
11
+ import "../chunk-S2FXOWOR.js";
12
+ import "../chunk-FTMXDOR6.js";
13
+ import "../chunk-3C2MLBPJ.js";
14
+ import "../chunk-H7Y5CKTM.js";
15
+ import "../chunk-7IP4JIFL.js";
16
+ import "../chunk-O5OJVPL6.js";
17
17
  import "../chunk-IDZNPTYD.js";
18
18
  import "../chunk-W6Y7ZW3Y.js";
19
19
  import "../chunk-N5G5QMS3.js";
20
20
  import "../chunk-3WGJMBKH.js";
21
21
  import "../chunk-XYLGHKG6.js";
22
- import "../chunk-PQ5YK4AY.js";
23
- import "../chunk-MHBMTPW7.js";
22
+ import "../chunk-ABQHQ6I5.js";
23
+ import "../chunk-ERS5EVUZ.js";
24
24
 
25
25
  // src/bin/harness-mcp.ts
26
26
  startServer().catch((error) => {
@@ -1,36 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createProgram
4
- } from "../chunk-SSKDAOX5.js";
5
- import "../chunk-VUCPTQ6G.js";
6
- import "../chunk-UAX4I5ZE.js";
7
- import "../chunk-TS3XWPW5.js";
8
- import "../chunk-Q6AB7W5Z.js";
4
+ } from "../chunk-XKECDXJS.js";
5
+ import "../chunk-SD3SQOZ2.js";
6
+ import "../chunk-6KTUUFRN.js";
7
+ import "../chunk-RCWZBSK5.js";
8
+ import "../chunk-YQ6KC6TE.js";
9
9
  import "../chunk-TRAPF4IX.js";
10
10
  import "../chunk-AOZRDOIP.js";
11
11
  import "../chunk-TEFCFC4H.js";
12
12
  import "../chunk-YBJ262QL.js";
13
13
  import "../chunk-EBJQ6N4M.js";
14
- import "../chunk-QPEH2QPG.js";
15
- import "../chunk-JSTQ3AWB.js";
14
+ import "../chunk-DBSOCI3G.js";
15
+ import "../chunk-FIAPHX37.js";
16
16
  import "../chunk-KET4QQZB.js";
17
- import "../chunk-NKDM3FMH.js";
18
- import "../chunk-NERR4TAO.js";
19
- import "../chunk-DZS7CJKL.js";
20
- import "../chunk-TKJZKICB.js";
21
- import "../chunk-IM32EEDM.js";
22
- import "../chunk-65FRIL4D.js";
23
- import "../chunk-4ZMOCPYO.js";
17
+ import "../chunk-OD3S2NHN.js";
18
+ import "../chunk-YZD2MRNQ.js";
19
+ import "../chunk-OXLLOSSR.js";
20
+ import "../chunk-YPYGXRDR.js";
21
+ import "../chunk-TPOTOBR7.js";
22
+ import "../chunk-OSXBPAMK.js";
23
+ import "../chunk-NLVUVUGD.js";
24
24
  import "../chunk-ZOAWBDWU.js";
25
- import "../chunk-NOPU4RZ4.js";
26
- import "../chunk-IMFVFNJE.js";
27
- import "../chunk-QY4T6YAZ.js";
28
- import "../chunk-K6XAPGML.js";
29
- import "../chunk-ND6PNADU.js";
25
+ import "../chunk-S2FXOWOR.js";
26
+ import "../chunk-FTMXDOR6.js";
27
+ import "../chunk-3C2MLBPJ.js";
28
+ import "../chunk-H7Y5CKTM.js";
29
+ import "../chunk-7IP4JIFL.js";
30
30
  import {
31
31
  findConfigFile,
32
32
  loadConfig
33
- } from "../chunk-Z77YQRQT.js";
33
+ } from "../chunk-O5OJVPL6.js";
34
34
  import "../chunk-IDZNPTYD.js";
35
35
  import "../chunk-W6Y7ZW3Y.js";
36
36
  import "../chunk-N5G5QMS3.js";
@@ -41,16 +41,16 @@ import "../chunk-XYLGHKG6.js";
41
41
  import {
42
42
  CLI_VERSION
43
43
  } from "../chunk-BM3PWGXQ.js";
44
- import "../chunk-72GHBOL2.js";
45
- import "../chunk-C2ERUR3L.js";
44
+ import "../chunk-GZKSBLQL.js";
45
+ import "../chunk-7MJAPE3Z.js";
46
46
  import {
47
47
  getUpdateNotification,
48
48
  isUpdateCheckEnabled,
49
49
  readCheckState,
50
50
  shouldRunCheck,
51
51
  spawnBackgroundCheck
52
- } from "../chunk-PQ5YK4AY.js";
53
- import "../chunk-MHBMTPW7.js";
52
+ } from "../chunk-ABQHQ6I5.js";
53
+ import "../chunk-ERS5EVUZ.js";
54
54
 
55
55
  // src/bin/update-check-hooks.ts
56
56
  var DEFAULT_INTERVAL_MS = 864e5;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createCheckPhaseGateCommand,
3
3
  runCheckPhaseGate
4
- } from "./chunk-UAX4I5ZE.js";
4
+ } from "./chunk-6KTUUFRN.js";
5
5
  import "./chunk-EBJQ6N4M.js";
6
- import "./chunk-Z77YQRQT.js";
6
+ import "./chunk-O5OJVPL6.js";
7
7
  import "./chunk-3WGJMBKH.js";
8
- import "./chunk-PQ5YK4AY.js";
9
- import "./chunk-MHBMTPW7.js";
8
+ import "./chunk-ABQHQ6I5.js";
9
+ import "./chunk-ERS5EVUZ.js";
10
10
  export {
11
11
  createCheckPhaseGateCommand,
12
12
  runCheckPhaseGate
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveProjectConfig
3
- } from "./chunk-K6XAPGML.js";
3
+ } from "./chunk-H7Y5CKTM.js";
4
4
  import {
5
5
  resultToMcpResponse
6
6
  } from "./chunk-IDZNPTYD.js";
@@ -38,7 +38,7 @@ async function handleCheckDependencies(input) {
38
38
  const configResult = resolveProjectConfig(projectPath);
39
39
  if (!configResult.ok) return resultToMcpResponse(configResult);
40
40
  try {
41
- const { validateDependencies, TypeScriptParser } = await import("./dist-2B363XUH.js");
41
+ const { validateDependencies, TypeScriptParser } = await import("./dist-HWXF2C3R.js");
42
42
  const config = configResult.value;
43
43
  const rawLayers = Array.isArray(config.layers) ? config.layers : [];
44
44
  const layers = rawLayers.map((l) => ({
@@ -47,11 +47,11 @@ async function handleCheckDependencies(input) {
47
47
  allowedDependencies: l.allowedDependencies
48
48
  }));
49
49
  const parser = new TypeScriptParser();
50
- const { loadGraphStore } = await import("./graph-loader-GJZ4FN4Y.js");
50
+ const { loadGraphStore } = await import("./graph-loader-2M2HXDQI.js");
51
51
  const store = await loadGraphStore(projectPath);
52
52
  let graphDependencyData;
53
53
  if (store) {
54
- const { GraphConstraintAdapter } = await import("./dist-HXHWB7SV.js");
54
+ const { GraphConstraintAdapter } = await import("./dist-B26DFXMP.js");
55
55
  const adapter = new GraphConstraintAdapter(store);
56
56
  const graphData = adapter.computeDependencyGraph();
57
57
  graphDependencyData = {
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-EBJQ6N4M.js";
4
4
  import {
5
5
  resolveConfig
6
- } from "./chunk-Z77YQRQT.js";
6
+ } from "./chunk-O5OJVPL6.js";
7
7
  import {
8
8
  ExitCode
9
9
  } from "./chunk-3WGJMBKH.js";
10
10
  import {
11
11
  Ok
12
- } from "./chunk-MHBMTPW7.js";
12
+ } from "./chunk-ERS5EVUZ.js";
13
13
 
14
14
  // src/commands/check-phase-gate.ts
15
15
  import { Command } from "commander";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  findConfigFile,
3
3
  loadConfig
4
- } from "./chunk-Z77YQRQT.js";
4
+ } from "./chunk-O5OJVPL6.js";
5
5
  import {
6
6
  resultToMcpResponse
7
7
  } from "./chunk-IDZNPTYD.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-W6Y7ZW3Y.js";
11
11
  import {
12
12
  Ok
13
- } from "./chunk-MHBMTPW7.js";
13
+ } from "./chunk-ERS5EVUZ.js";
14
14
 
15
15
  // src/mcp/tools/docs.ts
16
16
  import * as path from "path";
@@ -46,18 +46,18 @@ async function handleCheckDocs(input) {
46
46
  const projectPath = sanitizePath(input.path);
47
47
  const scope = input.scope ?? "coverage";
48
48
  if (scope === "integrity") {
49
- const { validateKnowledgeMap } = await import("./dist-2B363XUH.js");
49
+ const { validateKnowledgeMap } = await import("./dist-HWXF2C3R.js");
50
50
  const result2 = await validateKnowledgeMap(projectPath);
51
51
  return resultToMcpResponse(result2);
52
52
  }
53
53
  if (scope === "all") {
54
- const { checkDocCoverage: checkDocCoverage2, validateKnowledgeMap } = await import("./dist-2B363XUH.js");
54
+ const { checkDocCoverage: checkDocCoverage2, validateKnowledgeMap } = await import("./dist-HWXF2C3R.js");
55
55
  const domain2 = input.domain ?? "src";
56
- const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-GJZ4FN4Y.js");
56
+ const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-2M2HXDQI.js");
57
57
  const store2 = await loadGraphStore2(projectPath);
58
58
  let graphCoverage2;
59
59
  if (store2) {
60
- const { Assembler } = await import("./dist-HXHWB7SV.js");
60
+ const { Assembler } = await import("./dist-B26DFXMP.js");
61
61
  const assembler = new Assembler(store2);
62
62
  const report = assembler.checkCoverage();
63
63
  graphCoverage2 = {
@@ -90,13 +90,13 @@ async function handleCheckDocs(input) {
90
90
  }
91
91
  return resultToMcpResponse(Ok({ coverage, integrity }));
92
92
  }
93
- const { checkDocCoverage } = await import("./dist-2B363XUH.js");
93
+ const { checkDocCoverage } = await import("./dist-HWXF2C3R.js");
94
94
  const domain = input.domain ?? "src";
95
- const { loadGraphStore } = await import("./graph-loader-GJZ4FN4Y.js");
95
+ const { loadGraphStore } = await import("./graph-loader-2M2HXDQI.js");
96
96
  const store = await loadGraphStore(projectPath);
97
97
  let graphCoverage;
98
98
  if (store) {
99
- const { Assembler } = await import("./dist-HXHWB7SV.js");
99
+ const { Assembler } = await import("./dist-B26DFXMP.js");
100
100
  const assembler = new Assembler(store);
101
101
  const report = assembler.checkCoverage();
102
102
  graphCoverage = {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Err,
3
3
  Ok
4
- } from "./chunk-MHBMTPW7.js";
4
+ } from "./chunk-ERS5EVUZ.js";
5
5
 
6
6
  // src/templates/engine.ts
7
7
  import * as fs from "fs";
@@ -10,6 +10,19 @@ import Handlebars from "handlebars";
10
10
 
11
11
  // src/templates/schema.ts
12
12
  import { z } from "zod";
13
+ var LanguageEnum = z.enum(["typescript", "python", "go", "rust", "java"]);
14
+ var ToolingSchema = z.object({
15
+ packageManager: z.string().optional(),
16
+ linter: z.string().optional(),
17
+ formatter: z.string().optional(),
18
+ buildTool: z.string().optional(),
19
+ testRunner: z.string().optional(),
20
+ lockFile: z.string().optional()
21
+ });
22
+ var DetectPatternSchema = z.object({
23
+ file: z.string(),
24
+ contains: z.string().optional()
25
+ });
13
26
  var MergeStrategySchema = z.object({
14
27
  json: z.enum(["deep-merge", "overlay-wins"]).default("deep-merge"),
15
28
  files: z.literal("overlay-wins").default("overlay-wins")
@@ -21,7 +34,10 @@ var TemplateMetadataSchema = z.object({
21
34
  framework: z.string().optional(),
22
35
  extends: z.string().optional(),
23
36
  mergeStrategy: MergeStrategySchema.default({}),
24
- version: z.literal(1)
37
+ version: z.literal(1),
38
+ language: LanguageEnum.optional(),
39
+ tooling: ToolingSchema.optional(),
40
+ detect: z.array(DetectPatternSchema).optional()
25
41
  });
26
42
 
27
43
  // src/templates/merger.ts
@@ -64,6 +80,57 @@ function mergePackageJson(base, overlay) {
64
80
  }
65
81
 
66
82
  // src/templates/engine.ts
83
+ var NON_JSON_PACKAGE_CONFIGS = /* @__PURE__ */ new Set(["pyproject.toml", "go.mod", "Cargo.toml", "pom.xml"]);
84
+ function scoreDetectPatterns(targetDir, patterns) {
85
+ let score = 0;
86
+ for (const pattern of patterns) {
87
+ const filePath = path.join(targetDir, pattern.file);
88
+ if (!fs.existsSync(filePath)) continue;
89
+ if (!pattern.contains) {
90
+ score++;
91
+ continue;
92
+ }
93
+ const fd = fs.openSync(filePath, "r");
94
+ try {
95
+ const buf = Buffer.alloc(65536);
96
+ const bytesRead = fs.readSync(fd, buf, 0, 65536, 0);
97
+ const content = buf.toString("utf-8", 0, bytesRead);
98
+ if (content.includes(pattern.contains)) score++;
99
+ } finally {
100
+ fs.closeSync(fd);
101
+ }
102
+ }
103
+ return score;
104
+ }
105
+ function applyLanguageDefaults(context) {
106
+ return {
107
+ ...context,
108
+ ...context.language === "python" && context.pythonMinVersion === void 0 && { pythonMinVersion: "3.10" },
109
+ ...context.language === "go" && context.goModulePath === void 0 && {
110
+ goModulePath: `github.com/example/${context.projectName}`
111
+ },
112
+ ...context.language === "java" && context.javaGroupId === void 0 && {
113
+ javaGroupId: `com.example.${context.projectName.replace(/[^a-zA-Z0-9]/g, "").toLowerCase()}`
114
+ },
115
+ ...context.language === "rust" && context.rustEdition === void 0 && { rustEdition: "2021" }
116
+ };
117
+ }
118
+ function mergeJsonBuffers(jsonBuffers) {
119
+ try {
120
+ const results = [];
121
+ for (const [outputPath, jsons] of jsonBuffers) {
122
+ let merged = {};
123
+ for (const json of jsons) {
124
+ merged = outputPath === "package.json" ? mergePackageJson(merged, json) : deepMergeJson(merged, json);
125
+ }
126
+ results.push({ relativePath: outputPath, content: JSON.stringify(merged, null, 2) });
127
+ }
128
+ return Ok(results);
129
+ } catch (error) {
130
+ const msg = error instanceof Error ? error.message : String(error);
131
+ return Err(new Error(`JSON merge failed: ${msg}`));
132
+ }
133
+ }
67
134
  var TemplateEngine = class {
68
135
  constructor(templatesDir) {
69
136
  this.templatesDir = templatesDir;
@@ -89,7 +156,13 @@ var TemplateEngine = class {
89
156
  );
90
157
  }
91
158
  }
92
- resolveTemplate(level, framework) {
159
+ resolveTemplate(level, framework, language) {
160
+ if (language && language !== "typescript") {
161
+ return this.resolveLanguageTemplate(language, framework);
162
+ }
163
+ if (!level) {
164
+ return Err(new Error("Level is required for TypeScript/JavaScript templates"));
165
+ }
93
166
  const levelDir = this.findTemplateDir(level, "level");
94
167
  if (!levelDir) return Err(new Error(`Template not found for level: ${level}`));
95
168
  const metaPath = path.join(levelDir, "template.json");
@@ -122,69 +195,60 @@ var TemplateEngine = class {
122
195
  return Ok(resolved);
123
196
  }
124
197
  render(template, context) {
198
+ const effectiveContext = applyLanguageDefaults(context);
125
199
  const rendered = [];
126
200
  const jsonBuffers = /* @__PURE__ */ new Map();
127
201
  for (const file of template.files) {
128
- const outputPath = file.relativePath.replace(/\.hbs$/, "");
129
- if (file.isHandlebars) {
130
- try {
131
- const raw = fs.readFileSync(file.absolutePath, "utf-8");
132
- const compiled = Handlebars.compile(raw, { strict: true });
133
- const content = compiled(context);
134
- if (outputPath.endsWith(".json") && file.relativePath.endsWith(".json.hbs")) {
135
- if (!jsonBuffers.has(outputPath)) jsonBuffers.set(outputPath, []);
136
- jsonBuffers.get(outputPath).push(JSON.parse(content));
137
- } else {
138
- rendered.push({ relativePath: outputPath, content });
139
- }
140
- } catch (error) {
141
- const msg = error instanceof Error ? error.message : String(error);
142
- return Err(
143
- new Error(
144
- `Template render failed in ${file.sourceTemplate}/${file.relativePath}: ${msg}`
145
- )
146
- );
147
- }
148
- } else {
149
- try {
150
- const content = fs.readFileSync(file.absolutePath, "utf-8");
151
- rendered.push({ relativePath: file.relativePath, content });
152
- } catch (error) {
153
- const msg = error instanceof Error ? error.message : String(error);
154
- return Err(
155
- new Error(
156
- `Template render failed in ${file.sourceTemplate}/${file.relativePath}: ${msg}`
157
- )
158
- );
159
- }
160
- }
202
+ const result = this.renderFile(file, effectiveContext, jsonBuffers);
203
+ if (!result.ok) return result;
204
+ if (result.value) rendered.push(result.value);
161
205
  }
206
+ const mergeResult = mergeJsonBuffers(jsonBuffers);
207
+ if (!mergeResult.ok) return mergeResult;
208
+ rendered.push(...mergeResult.value);
209
+ return Ok({ files: rendered });
210
+ }
211
+ renderFile(file, context, jsonBuffers) {
212
+ const outputPath = file.relativePath.replace(/\.hbs$/, "");
162
213
  try {
163
- for (const [outputPath, jsons] of jsonBuffers) {
164
- let merged = {};
165
- for (const json of jsons) {
166
- merged = outputPath === "package.json" ? mergePackageJson(merged, json) : deepMergeJson(merged, json);
214
+ if (file.isHandlebars) {
215
+ const raw = fs.readFileSync(file.absolutePath, "utf-8");
216
+ const compiled = Handlebars.compile(raw, { strict: true });
217
+ const content2 = compiled(context);
218
+ if (outputPath.endsWith(".json") && file.relativePath.endsWith(".json.hbs")) {
219
+ if (!jsonBuffers.has(outputPath)) jsonBuffers.set(outputPath, []);
220
+ jsonBuffers.get(outputPath).push(JSON.parse(content2));
221
+ return Ok(null);
167
222
  }
168
- rendered.push({ relativePath: outputPath, content: JSON.stringify(merged, null, 2) });
223
+ return Ok({ relativePath: outputPath, content: content2 });
169
224
  }
225
+ const content = fs.readFileSync(file.absolutePath, "utf-8");
226
+ return Ok({ relativePath: file.relativePath, content });
170
227
  } catch (error) {
171
228
  const msg = error instanceof Error ? error.message : String(error);
172
- return Err(new Error(`JSON merge failed: ${msg}`));
229
+ return Err(
230
+ new Error(`Template render failed in ${file.sourceTemplate}/${file.relativePath}: ${msg}`)
231
+ );
173
232
  }
174
- return Ok({ files: rendered });
175
233
  }
176
234
  write(files, targetDir, options) {
177
235
  try {
178
236
  const written = [];
237
+ const skippedConfigs = [];
238
+ const isNonJsLanguage = options.language && options.language !== "typescript";
179
239
  for (const file of files.files) {
180
240
  const targetPath = path.join(targetDir, file.relativePath);
181
241
  const dir = path.dirname(targetPath);
242
+ if (!options.overwrite && isNonJsLanguage && NON_JSON_PACKAGE_CONFIGS.has(file.relativePath) && fs.existsSync(targetPath)) {
243
+ skippedConfigs.push(file.relativePath);
244
+ continue;
245
+ }
182
246
  if (!options.overwrite && fs.existsSync(targetPath)) continue;
183
247
  fs.mkdirSync(dir, { recursive: true });
184
248
  fs.writeFileSync(targetPath, file.content);
185
249
  written.push(file.relativePath);
186
250
  }
187
- return Ok(written);
251
+ return Ok({ written, skippedConfigs });
188
252
  } catch (error) {
189
253
  return Err(
190
254
  new Error(
@@ -193,6 +257,61 @@ var TemplateEngine = class {
193
257
  );
194
258
  }
195
259
  }
260
+ detectFramework(targetDir) {
261
+ try {
262
+ const templatesResult = this.listTemplates();
263
+ if (!templatesResult.ok) return Err(templatesResult.error);
264
+ const candidates = [];
265
+ for (const meta of templatesResult.value) {
266
+ if (!meta.detect || meta.detect.length === 0) continue;
267
+ if (!meta.framework || !meta.language) continue;
268
+ const score = scoreDetectPatterns(targetDir, meta.detect);
269
+ if (score > 0) {
270
+ candidates.push({
271
+ framework: meta.framework,
272
+ language: meta.language,
273
+ score,
274
+ templateName: meta.name
275
+ });
276
+ }
277
+ }
278
+ candidates.sort((a, b) => b.score - a.score);
279
+ return Ok(candidates);
280
+ } catch (error) {
281
+ return Err(
282
+ new Error(
283
+ `Framework detection failed: ${error instanceof Error ? error.message : String(error)}`
284
+ )
285
+ );
286
+ }
287
+ }
288
+ resolveLanguageTemplate(language, framework) {
289
+ const baseName = `${language}-base`;
290
+ const baseDir = this.findTemplateDir(baseName, "name");
291
+ if (!baseDir) return Err(new Error(`Language base template not found: ${baseName}`));
292
+ const metaPath = path.join(baseDir, "template.json");
293
+ const metaRaw = JSON.parse(fs.readFileSync(metaPath, "utf-8"));
294
+ const metaResult = TemplateMetadataSchema.safeParse(metaRaw);
295
+ if (!metaResult.success)
296
+ return Err(new Error(`Invalid template.json in ${baseName}: ${metaResult.error.message}`));
297
+ const metadata = metaResult.data;
298
+ let files = this.collectFiles(baseDir, baseName);
299
+ let overlayMetadata;
300
+ if (framework) {
301
+ const frameworkDir = this.findTemplateDir(framework, "framework");
302
+ if (!frameworkDir) return Err(new Error(`Framework template not found: ${framework}`));
303
+ const fMetaPath = path.join(frameworkDir, "template.json");
304
+ const fMetaRaw = JSON.parse(fs.readFileSync(fMetaPath, "utf-8"));
305
+ const fMetaResult = TemplateMetadataSchema.safeParse(fMetaRaw);
306
+ if (fMetaResult.success) overlayMetadata = fMetaResult.data;
307
+ const frameworkFiles = this.collectFiles(frameworkDir, framework);
308
+ files = this.mergeFileLists(files, frameworkFiles);
309
+ }
310
+ files = files.filter((f) => f.relativePath !== "template.json");
311
+ const resolved = { metadata, files };
312
+ if (overlayMetadata !== void 0) resolved.overlayMetadata = overlayMetadata;
313
+ return Ok(resolved);
314
+ }
196
315
  findTemplateDir(name, type) {
197
316
  const entries = fs.readdirSync(this.templatesDir, { withFileTypes: true });
198
317
  for (const entry of entries) {
@@ -202,11 +321,8 @@ var TemplateEngine = class {
202
321
  const raw = JSON.parse(fs.readFileSync(metaPath, "utf-8"));
203
322
  const parsed = TemplateMetadataSchema.safeParse(raw);
204
323
  if (!parsed.success) continue;
205
- if (type === "level" && parsed.data.level === name)
206
- return path.join(this.templatesDir, entry.name);
207
- if (type === "framework" && parsed.data.framework === name)
208
- return path.join(this.templatesDir, entry.name);
209
- if (parsed.data.name === name) return path.join(this.templatesDir, entry.name);
324
+ const fieldValue = parsed.data[type];
325
+ if (fieldValue === name) return path.join(this.templatesDir, entry.name);
210
326
  }
211
327
  return null;
212
328
  }