agentic-qe 1.8.3 → 1.9.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 (290) hide show
  1. package/.claude/skills/agentic-jujutsu/SKILL.md +645 -0
  2. package/.claude/skills/cicd-pipeline-qe-orchestrator/README.md +2 -2
  3. package/.claude/skills/cicd-pipeline-qe-orchestrator/SKILL.md +6 -6
  4. package/CHANGELOG.md +595 -0
  5. package/README.md +117 -16
  6. package/config/constitution.schema.json +423 -0
  7. package/config/otel-collector.yaml +234 -0
  8. package/dist/App.d.ts +5 -0
  9. package/dist/App.d.ts.map +1 -0
  10. package/dist/App.js +15 -0
  11. package/dist/App.js.map +1 -0
  12. package/dist/cli/commands/constitution.d.ts +34 -0
  13. package/dist/cli/commands/constitution.d.ts.map +1 -0
  14. package/dist/cli/commands/constitution.js +679 -0
  15. package/dist/cli/commands/constitution.js.map +1 -0
  16. package/dist/cli/commands/init-claude-md-template.js +3 -3
  17. package/dist/cli/commands/init.d.ts +8 -75
  18. package/dist/cli/commands/init.d.ts.map +1 -1
  19. package/dist/cli/commands/init.js +22 -2292
  20. package/dist/cli/commands/init.js.map +1 -1
  21. package/dist/cli/commands/telemetry.d.ts +36 -0
  22. package/dist/cli/commands/telemetry.d.ts.map +1 -0
  23. package/dist/cli/commands/telemetry.js +364 -0
  24. package/dist/cli/commands/telemetry.js.map +1 -0
  25. package/dist/cli/index.js +66 -0
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/cli/init/agents.d.ts +22 -0
  28. package/dist/cli/init/agents.d.ts.map +1 -0
  29. package/dist/cli/init/agents.js +522 -0
  30. package/dist/cli/init/agents.js.map +1 -0
  31. package/dist/cli/init/bash-wrapper.d.ts +14 -0
  32. package/dist/cli/init/bash-wrapper.d.ts.map +1 -0
  33. package/dist/cli/init/bash-wrapper.js +47 -0
  34. package/dist/cli/init/bash-wrapper.js.map +1 -0
  35. package/dist/cli/init/claude-config.d.ts +24 -0
  36. package/dist/cli/init/claude-config.d.ts.map +1 -0
  37. package/dist/cli/init/claude-config.js +275 -0
  38. package/dist/cli/init/claude-config.js.map +1 -0
  39. package/dist/cli/init/claude-md.d.ts +19 -0
  40. package/dist/cli/init/claude-md.d.ts.map +1 -0
  41. package/dist/cli/init/claude-md.js +153 -0
  42. package/dist/cli/init/claude-md.js.map +1 -0
  43. package/dist/cli/init/commands.d.ts +6 -0
  44. package/dist/cli/init/commands.d.ts.map +1 -0
  45. package/dist/cli/init/commands.js +83 -0
  46. package/dist/cli/init/commands.js.map +1 -0
  47. package/dist/cli/init/database-init.d.ts +15 -0
  48. package/dist/cli/init/database-init.d.ts.map +1 -0
  49. package/dist/cli/init/database-init.js +203 -0
  50. package/dist/cli/init/database-init.js.map +1 -0
  51. package/dist/cli/init/directory-structure.d.ts +14 -0
  52. package/dist/cli/init/directory-structure.d.ts.map +1 -0
  53. package/dist/cli/init/directory-structure.js +107 -0
  54. package/dist/cli/init/directory-structure.js.map +1 -0
  55. package/dist/cli/init/documentation.d.ts +14 -0
  56. package/dist/cli/init/documentation.d.ts.map +1 -0
  57. package/dist/cli/init/documentation.js +195 -0
  58. package/dist/cli/init/documentation.js.map +1 -0
  59. package/dist/cli/init/fleet-config.d.ts +34 -0
  60. package/dist/cli/init/fleet-config.d.ts.map +1 -0
  61. package/dist/cli/init/fleet-config.js +269 -0
  62. package/dist/cli/init/fleet-config.js.map +1 -0
  63. package/dist/cli/init/helpers.d.ts +6 -0
  64. package/dist/cli/init/helpers.d.ts.map +1 -0
  65. package/dist/cli/init/helpers.js +94 -0
  66. package/dist/cli/init/helpers.js.map +1 -0
  67. package/dist/cli/init/index.d.ts +32 -0
  68. package/dist/cli/init/index.d.ts.map +1 -0
  69. package/dist/cli/init/index.js +294 -0
  70. package/dist/cli/init/index.js.map +1 -0
  71. package/dist/cli/init/skills.d.ts +6 -0
  72. package/dist/cli/init/skills.d.ts.map +1 -0
  73. package/dist/cli/init/skills.js +138 -0
  74. package/dist/cli/init/skills.js.map +1 -0
  75. package/dist/cli/init/utils/file-utils.d.ts +74 -0
  76. package/dist/cli/init/utils/file-utils.d.ts.map +1 -0
  77. package/dist/cli/init/utils/file-utils.js +187 -0
  78. package/dist/cli/init/utils/file-utils.js.map +1 -0
  79. package/dist/cli/init/utils/index.d.ts +18 -0
  80. package/dist/cli/init/utils/index.d.ts.map +1 -0
  81. package/dist/cli/init/utils/index.js +48 -0
  82. package/dist/cli/init/utils/index.js.map +1 -0
  83. package/dist/cli/init/utils/log-utils.d.ts +47 -0
  84. package/dist/cli/init/utils/log-utils.d.ts.map +1 -0
  85. package/dist/cli/init/utils/log-utils.js +68 -0
  86. package/dist/cli/init/utils/log-utils.js.map +1 -0
  87. package/dist/cli/init/utils/path-utils.d.ts +91 -0
  88. package/dist/cli/init/utils/path-utils.d.ts.map +1 -0
  89. package/dist/cli/init/utils/path-utils.js +208 -0
  90. package/dist/cli/init/utils/path-utils.js.map +1 -0
  91. package/dist/cli/init/utils/validation-utils.d.ts +44 -0
  92. package/dist/cli/init/utils/validation-utils.d.ts.map +1 -0
  93. package/dist/cli/init/utils/validation-utils.js +68 -0
  94. package/dist/cli/init/utils/validation-utils.js.map +1 -0
  95. package/dist/cli/init/utils.d.ts +183 -0
  96. package/dist/cli/init/utils.d.ts.map +1 -0
  97. package/dist/cli/init/utils.js +354 -0
  98. package/dist/cli/init/utils.js.map +1 -0
  99. package/dist/components/Dashboard/Dashboard.d.ts +4 -0
  100. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -0
  101. package/dist/components/Dashboard/Dashboard.js +148 -0
  102. package/dist/components/Dashboard/Dashboard.js.map +1 -0
  103. package/dist/components/Dashboard/DashboardHeader.d.ts +4 -0
  104. package/dist/components/Dashboard/DashboardHeader.d.ts.map +1 -0
  105. package/dist/components/Dashboard/DashboardHeader.js +138 -0
  106. package/dist/components/Dashboard/DashboardHeader.js.map +1 -0
  107. package/dist/constitution/evaluators/ast-evaluator.d.ts +42 -0
  108. package/dist/constitution/evaluators/ast-evaluator.d.ts.map +1 -0
  109. package/dist/constitution/evaluators/ast-evaluator.js +303 -0
  110. package/dist/constitution/evaluators/ast-evaluator.js.map +1 -0
  111. package/dist/constitution/evaluators/base.d.ts +144 -0
  112. package/dist/constitution/evaluators/base.d.ts.map +1 -0
  113. package/dist/constitution/evaluators/base.js +144 -0
  114. package/dist/constitution/evaluators/base.js.map +1 -0
  115. package/dist/constitution/evaluators/index.d.ts +19 -0
  116. package/dist/constitution/evaluators/index.d.ts.map +1 -0
  117. package/dist/constitution/evaluators/index.js +56 -0
  118. package/dist/constitution/evaluators/index.js.map +1 -0
  119. package/dist/constitution/evaluators/metric-evaluator.d.ts +59 -0
  120. package/dist/constitution/evaluators/metric-evaluator.d.ts.map +1 -0
  121. package/dist/constitution/evaluators/metric-evaluator.js +195 -0
  122. package/dist/constitution/evaluators/metric-evaluator.js.map +1 -0
  123. package/dist/constitution/evaluators/pattern-evaluator.d.ts +66 -0
  124. package/dist/constitution/evaluators/pattern-evaluator.d.ts.map +1 -0
  125. package/dist/constitution/evaluators/pattern-evaluator.js +221 -0
  126. package/dist/constitution/evaluators/pattern-evaluator.js.map +1 -0
  127. package/dist/constitution/evaluators/semantic-evaluator.d.ts +68 -0
  128. package/dist/constitution/evaluators/semantic-evaluator.d.ts.map +1 -0
  129. package/dist/constitution/evaluators/semantic-evaluator.js +250 -0
  130. package/dist/constitution/evaluators/semantic-evaluator.js.map +1 -0
  131. package/dist/constitution/index.d.ts +105 -0
  132. package/dist/constitution/index.d.ts.map +1 -0
  133. package/dist/constitution/index.js +207 -0
  134. package/dist/constitution/index.js.map +1 -0
  135. package/dist/constitution/loader.d.ts +141 -0
  136. package/dist/constitution/loader.d.ts.map +1 -0
  137. package/dist/constitution/loader.js +515 -0
  138. package/dist/constitution/loader.js.map +1 -0
  139. package/dist/constitution/schema.d.ts +409 -0
  140. package/dist/constitution/schema.d.ts.map +1 -0
  141. package/dist/constitution/schema.js +71 -0
  142. package/dist/constitution/schema.js.map +1 -0
  143. package/dist/contexts/DashboardContext.d.ts +41 -0
  144. package/dist/contexts/DashboardContext.d.ts.map +1 -0
  145. package/dist/contexts/DashboardContext.js +187 -0
  146. package/dist/contexts/DashboardContext.js.map +1 -0
  147. package/dist/core/memory/MemoryManagerFactory.d.ts +77 -0
  148. package/dist/core/memory/MemoryManagerFactory.d.ts.map +1 -0
  149. package/dist/core/memory/MemoryManagerFactory.js +270 -0
  150. package/dist/core/memory/MemoryManagerFactory.js.map +1 -0
  151. package/dist/core/memory/SwarmMemoryManager.d.ts +58 -0
  152. package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
  153. package/dist/core/memory/SwarmMemoryManager.js +375 -131
  154. package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
  155. package/dist/core/memory/index.d.ts +1 -0
  156. package/dist/core/memory/index.d.ts.map +1 -1
  157. package/dist/core/memory/index.js +12 -1
  158. package/dist/core/memory/index.js.map +1 -1
  159. package/dist/hooks/useKeyboardShortcuts.d.ts +12 -0
  160. package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  161. package/dist/hooks/useKeyboardShortcuts.js +69 -0
  162. package/dist/hooks/useKeyboardShortcuts.js.map +1 -0
  163. package/dist/mcp/handlers/memory/memory-backup.js +6 -6
  164. package/dist/mcp/handlers/memory/memory-backup.js.map +1 -1
  165. package/dist/mcp/handlers/phase2/Phase2Tools.d.ts.map +1 -1
  166. package/dist/mcp/handlers/phase2/Phase2Tools.js +4 -2
  167. package/dist/mcp/handlers/phase2/Phase2Tools.js.map +1 -1
  168. package/dist/mcp/server.d.ts.map +1 -1
  169. package/dist/mcp/server.js +4 -38
  170. package/dist/mcp/server.js.map +1 -1
  171. package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
  172. package/dist/mcp/services/AgentRegistry.js +4 -4
  173. package/dist/mcp/services/AgentRegistry.js.map +1 -1
  174. package/dist/persistence/event-store.d.ts +162 -0
  175. package/dist/persistence/event-store.d.ts.map +1 -0
  176. package/dist/persistence/event-store.js +315 -0
  177. package/dist/persistence/event-store.js.map +1 -0
  178. package/dist/persistence/index.d.ts +145 -0
  179. package/dist/persistence/index.d.ts.map +1 -0
  180. package/dist/persistence/index.js +227 -0
  181. package/dist/persistence/index.js.map +1 -0
  182. package/dist/persistence/metrics-aggregator.d.ts +187 -0
  183. package/dist/persistence/metrics-aggregator.d.ts.map +1 -0
  184. package/dist/persistence/metrics-aggregator.js +495 -0
  185. package/dist/persistence/metrics-aggregator.js.map +1 -0
  186. package/dist/persistence/reasoning-store.d.ts +178 -0
  187. package/dist/persistence/reasoning-store.d.ts.map +1 -0
  188. package/dist/persistence/reasoning-store.js +440 -0
  189. package/dist/persistence/reasoning-store.js.map +1 -0
  190. package/dist/persistence/schema.d.ts +181 -0
  191. package/dist/persistence/schema.d.ts.map +1 -0
  192. package/dist/persistence/schema.js +186 -0
  193. package/dist/persistence/schema.js.map +1 -0
  194. package/dist/telemetry/bootstrap.d.ts +67 -0
  195. package/dist/telemetry/bootstrap.d.ts.map +1 -0
  196. package/dist/telemetry/bootstrap.js +320 -0
  197. package/dist/telemetry/bootstrap.js.map +1 -0
  198. package/dist/telemetry/index.d.ts +16 -0
  199. package/dist/telemetry/index.d.ts.map +1 -0
  200. package/dist/telemetry/index.js +84 -0
  201. package/dist/telemetry/index.js.map +1 -0
  202. package/dist/telemetry/instrumentation/agent.d.ts +158 -0
  203. package/dist/telemetry/instrumentation/agent.d.ts.map +1 -0
  204. package/dist/telemetry/instrumentation/agent.js +372 -0
  205. package/dist/telemetry/instrumentation/agent.js.map +1 -0
  206. package/dist/telemetry/instrumentation/index.d.ts +24 -0
  207. package/dist/telemetry/instrumentation/index.d.ts.map +1 -0
  208. package/dist/telemetry/instrumentation/index.js +54 -0
  209. package/dist/telemetry/instrumentation/index.js.map +1 -0
  210. package/dist/telemetry/instrumentation/memory.d.ts +313 -0
  211. package/dist/telemetry/instrumentation/memory.d.ts.map +1 -0
  212. package/dist/telemetry/instrumentation/memory.js +552 -0
  213. package/dist/telemetry/instrumentation/memory.js.map +1 -0
  214. package/dist/telemetry/instrumentation/task.d.ts +146 -0
  215. package/dist/telemetry/instrumentation/task.d.ts.map +1 -0
  216. package/dist/telemetry/instrumentation/task.js +305 -0
  217. package/dist/telemetry/instrumentation/task.js.map +1 -0
  218. package/dist/telemetry/metrics/agent-metrics.d.ts +109 -0
  219. package/dist/telemetry/metrics/agent-metrics.d.ts.map +1 -0
  220. package/dist/telemetry/metrics/agent-metrics.js +213 -0
  221. package/dist/telemetry/metrics/agent-metrics.js.map +1 -0
  222. package/dist/telemetry/metrics/collectors/cost.d.ts +246 -0
  223. package/dist/telemetry/metrics/collectors/cost.d.ts.map +1 -0
  224. package/dist/telemetry/metrics/collectors/cost.js +526 -0
  225. package/dist/telemetry/metrics/collectors/cost.js.map +1 -0
  226. package/dist/telemetry/metrics/collectors/pricing-config.d.ts +87 -0
  227. package/dist/telemetry/metrics/collectors/pricing-config.d.ts.map +1 -0
  228. package/dist/telemetry/metrics/collectors/pricing-config.js +207 -0
  229. package/dist/telemetry/metrics/collectors/pricing-config.js.map +1 -0
  230. package/dist/telemetry/metrics/index.d.ts +54 -0
  231. package/dist/telemetry/metrics/index.d.ts.map +1 -0
  232. package/dist/telemetry/metrics/index.js +116 -0
  233. package/dist/telemetry/metrics/index.js.map +1 -0
  234. package/dist/telemetry/metrics/quality-metrics.d.ts +171 -0
  235. package/dist/telemetry/metrics/quality-metrics.d.ts.map +1 -0
  236. package/dist/telemetry/metrics/quality-metrics.js +259 -0
  237. package/dist/telemetry/metrics/quality-metrics.js.map +1 -0
  238. package/dist/telemetry/metrics/system-metrics.d.ts +129 -0
  239. package/dist/telemetry/metrics/system-metrics.d.ts.map +1 -0
  240. package/dist/telemetry/metrics/system-metrics.js +380 -0
  241. package/dist/telemetry/metrics/system-metrics.js.map +1 -0
  242. package/dist/telemetry/types.d.ts +195 -0
  243. package/dist/telemetry/types.d.ts.map +1 -0
  244. package/dist/telemetry/types.js +90 -0
  245. package/dist/telemetry/types.js.map +1 -0
  246. package/dist/visualization/api/RestEndpoints.d.ts +136 -0
  247. package/dist/visualization/api/RestEndpoints.d.ts.map +1 -0
  248. package/dist/visualization/api/RestEndpoints.js +428 -0
  249. package/dist/visualization/api/RestEndpoints.js.map +1 -0
  250. package/dist/visualization/api/WebSocketServer.d.ts +165 -0
  251. package/dist/visualization/api/WebSocketServer.d.ts.map +1 -0
  252. package/dist/visualization/api/WebSocketServer.js +518 -0
  253. package/dist/visualization/api/WebSocketServer.js.map +1 -0
  254. package/dist/visualization/core/DataTransformer.d.ts +89 -0
  255. package/dist/visualization/core/DataTransformer.d.ts.map +1 -0
  256. package/dist/visualization/core/DataTransformer.js +478 -0
  257. package/dist/visualization/core/DataTransformer.js.map +1 -0
  258. package/dist/visualization/index.d.ts +92 -0
  259. package/dist/visualization/index.d.ts.map +1 -0
  260. package/dist/visualization/index.js +121 -0
  261. package/dist/visualization/index.js.map +1 -0
  262. package/dist/visualization/types.d.ts +148 -0
  263. package/dist/visualization/types.d.ts.map +1 -0
  264. package/dist/visualization/types.js +7 -0
  265. package/dist/visualization/types.js.map +1 -0
  266. package/dist/voting/consensus.d.ts +87 -0
  267. package/dist/voting/consensus.d.ts.map +1 -0
  268. package/dist/voting/consensus.js +568 -0
  269. package/dist/voting/consensus.js.map +1 -0
  270. package/dist/voting/index.d.ts +12 -0
  271. package/dist/voting/index.d.ts.map +1 -0
  272. package/dist/voting/index.js +36 -0
  273. package/dist/voting/index.js.map +1 -0
  274. package/dist/voting/orchestrator.d.ts +65 -0
  275. package/dist/voting/orchestrator.d.ts.map +1 -0
  276. package/dist/voting/orchestrator.js +306 -0
  277. package/dist/voting/orchestrator.js.map +1 -0
  278. package/dist/voting/panel-assembly.d.ts +54 -0
  279. package/dist/voting/panel-assembly.d.ts.map +1 -0
  280. package/dist/voting/panel-assembly.js +192 -0
  281. package/dist/voting/panel-assembly.js.map +1 -0
  282. package/dist/voting/protocol.d.ts +119 -0
  283. package/dist/voting/protocol.d.ts.map +1 -0
  284. package/dist/voting/protocol.js +18 -0
  285. package/dist/voting/protocol.js.map +1 -0
  286. package/dist/voting/types.d.ts +125 -0
  287. package/dist/voting/types.d.ts.map +1 -0
  288. package/dist/voting/types.js +7 -0
  289. package/dist/voting/types.js.map +1 -0
  290. package/package.json +43 -2
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+ /**
3
+ * Path utilities module
4
+ *
5
+ * Path handling for Agentic QE Fleet directories:
6
+ * - Base directory (.agentic-qe)
7
+ * - Data directory (databases)
8
+ * - Config directory
9
+ * - Agents directory
10
+ * - Docs directory
11
+ * - Template resolution (centralized)
12
+ * - Relative path conversion
13
+ *
14
+ * @module cli/init/utils/path-utils
15
+ */
16
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
+ desc = { enumerable: true, get: function() { return m[k]; } };
21
+ }
22
+ Object.defineProperty(o, k2, desc);
23
+ }) : (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ }));
27
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29
+ }) : function(o, v) {
30
+ o["default"] = v;
31
+ });
32
+ var __importStar = (this && this.__importStar) || (function () {
33
+ var ownKeys = function(o) {
34
+ ownKeys = Object.getOwnPropertyNames || function (o) {
35
+ var ar = [];
36
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
+ return ar;
38
+ };
39
+ return ownKeys(o);
40
+ };
41
+ return function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ })();
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.getBaseDir = getBaseDir;
51
+ exports.getDataDir = getDataDir;
52
+ exports.getConfigDir = getConfigDir;
53
+ exports.getAgentsDir = getAgentsDir;
54
+ exports.getDocsDir = getDocsDir;
55
+ exports.getRelativePath = getRelativePath;
56
+ exports.getPackageRoot = getPackageRoot;
57
+ exports.resolveTemplatePath = resolveTemplatePath;
58
+ exports.resolveTemplatePathSync = resolveTemplatePathSync;
59
+ const path = __importStar(require("path"));
60
+ const fs = __importStar(require("fs-extra"));
61
+ /**
62
+ * Get the base directory for Agentic QE Fleet (.agentic-qe)
63
+ *
64
+ * @param cwd - Current working directory (default: process.cwd())
65
+ * @returns Absolute path to .agentic-qe directory
66
+ */
67
+ function getBaseDir(cwd = process.cwd()) {
68
+ return path.join(cwd, '.agentic-qe');
69
+ }
70
+ /**
71
+ * Get the data directory for databases
72
+ *
73
+ * @param cwd - Current working directory (default: process.cwd())
74
+ * @returns Absolute path to .agentic-qe/data directory
75
+ */
76
+ function getDataDir(cwd = process.cwd()) {
77
+ return path.join(getBaseDir(cwd), 'data');
78
+ }
79
+ /**
80
+ * Get the config directory
81
+ *
82
+ * @param cwd - Current working directory (default: process.cwd())
83
+ * @returns Absolute path to .agentic-qe/config directory
84
+ */
85
+ function getConfigDir(cwd = process.cwd()) {
86
+ return path.join(getBaseDir(cwd), 'config');
87
+ }
88
+ /**
89
+ * Get the agents directory
90
+ *
91
+ * @param cwd - Current working directory (default: process.cwd())
92
+ * @returns Absolute path to .agentic-qe/agents directory
93
+ */
94
+ function getAgentsDir(cwd = process.cwd()) {
95
+ return path.join(getBaseDir(cwd), 'agents');
96
+ }
97
+ /**
98
+ * Get the docs directory
99
+ *
100
+ * @param cwd - Current working directory (default: process.cwd())
101
+ * @returns Absolute path to .agentic-qe/docs directory
102
+ */
103
+ function getDocsDir(cwd = process.cwd()) {
104
+ return path.join(getBaseDir(cwd), 'docs');
105
+ }
106
+ /**
107
+ * Get relative path from base directory
108
+ *
109
+ * @param fullPath - Absolute path
110
+ * @param baseDir - Base directory (default: process.cwd())
111
+ * @returns Relative path from base directory
112
+ */
113
+ function getRelativePath(fullPath, baseDir = process.cwd()) {
114
+ return path.relative(baseDir, fullPath);
115
+ }
116
+ /**
117
+ * Get the package root directory (where package.json lives)
118
+ *
119
+ * Searches upward from __dirname until package.json is found.
120
+ * Handles both development and installed package scenarios.
121
+ *
122
+ * @returns Absolute path to package root directory
123
+ * @throws Error if package.json cannot be found
124
+ */
125
+ function getPackageRoot() {
126
+ let currentDir = __dirname;
127
+ const maxDepth = 10; // Safety limit to prevent infinite loops
128
+ let depth = 0;
129
+ while (depth < maxDepth) {
130
+ const packageJsonPath = path.join(currentDir, 'package.json');
131
+ if (fs.existsSync(packageJsonPath)) {
132
+ // Verify it's our package by checking name
133
+ try {
134
+ const pkg = require(packageJsonPath);
135
+ if (pkg.name === 'agentic-qe' || pkg.name === '@agentic-qe/core') {
136
+ return currentDir;
137
+ }
138
+ }
139
+ catch {
140
+ // Not a valid package.json, keep searching
141
+ }
142
+ }
143
+ const parentDir = path.dirname(currentDir);
144
+ if (parentDir === currentDir) {
145
+ // Reached filesystem root
146
+ break;
147
+ }
148
+ currentDir = parentDir;
149
+ depth++;
150
+ }
151
+ throw new Error('Could not find agentic-qe package root (package.json not found)');
152
+ }
153
+ /**
154
+ * Resolve template file path with centralized fallback logic
155
+ *
156
+ * Searches for templates in this order:
157
+ * 1. Project root templates/ directory (for user customization)
158
+ * 2. Package root templates/ directory (development)
159
+ * 3. node_modules/agentic-qe/templates/ (installed package)
160
+ *
161
+ * @param templateFileName - Template file name (e.g., 'aqe.sh')
162
+ * @param projectRoot - Project root directory (default: process.cwd())
163
+ * @returns Absolute path to template file
164
+ * @throws Error if template not found in any location
165
+ */
166
+ async function resolveTemplatePath(templateFileName, projectRoot = process.cwd()) {
167
+ const searchPaths = [
168
+ // 1. Project root templates/ (user customization)
169
+ path.join(projectRoot, 'templates', templateFileName),
170
+ // 2. Package root templates/ (development)
171
+ path.join(getPackageRoot(), 'templates', templateFileName),
172
+ // 3. node_modules/agentic-qe/templates/ (installed package)
173
+ path.join(projectRoot, 'node_modules', 'agentic-qe', 'templates', templateFileName),
174
+ // 4. Parent node_modules (monorepo scenario)
175
+ path.join(projectRoot, '..', 'node_modules', 'agentic-qe', 'templates', templateFileName),
176
+ ];
177
+ // Try each path in order
178
+ for (const templatePath of searchPaths) {
179
+ if (await fs.pathExists(templatePath)) {
180
+ return templatePath;
181
+ }
182
+ }
183
+ // Template not found anywhere
184
+ throw new Error(`Template file '${templateFileName}' not found. Searched:\n${searchPaths.map(p => ` - ${p}`).join('\n')}`);
185
+ }
186
+ /**
187
+ * Synchronous version of resolveTemplatePath for use in non-async contexts
188
+ *
189
+ * @param templateFileName - Template file name
190
+ * @param projectRoot - Project root directory (default: process.cwd())
191
+ * @returns Absolute path to template file
192
+ * @throws Error if template not found
193
+ */
194
+ function resolveTemplatePathSync(templateFileName, projectRoot = process.cwd()) {
195
+ const searchPaths = [
196
+ path.join(projectRoot, 'templates', templateFileName),
197
+ path.join(getPackageRoot(), 'templates', templateFileName),
198
+ path.join(projectRoot, 'node_modules', 'agentic-qe', 'templates', templateFileName),
199
+ path.join(projectRoot, '..', 'node_modules', 'agentic-qe', 'templates', templateFileName),
200
+ ];
201
+ for (const templatePath of searchPaths) {
202
+ if (fs.existsSync(templatePath)) {
203
+ return templatePath;
204
+ }
205
+ }
206
+ throw new Error(`Template file '${templateFileName}' not found. Searched:\n${searchPaths.map(p => ` - ${p}`).join('\n')}`);
207
+ }
208
+ //# sourceMappingURL=path-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../../../src/cli/init/utils/path-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWH,gCAEC;AAQD,gC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CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC3G,CAAC;AACJ,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Validation utilities module
3
+ *
4
+ * Input validation and parsing utilities:
5
+ * - Numeric range validation
6
+ * - Enum validation
7
+ * - Comma-separated string parsing
8
+ * - Package version retrieval
9
+ *
10
+ * @module cli/init/utils/validation-utils
11
+ */
12
+ /**
13
+ * Validate that a value is within a numeric range
14
+ *
15
+ * @param value - Value to validate
16
+ * @param min - Minimum allowed value (inclusive)
17
+ * @param max - Maximum allowed value (inclusive)
18
+ * @param fieldName - Name of field for error message
19
+ * @throws Error if value is out of range
20
+ */
21
+ export declare function validateRange(value: number, min: number, max: number, fieldName: string): void;
22
+ /**
23
+ * Validate that a value is one of allowed options
24
+ *
25
+ * @param value - Value to validate
26
+ * @param allowedValues - Array of allowed values
27
+ * @param fieldName - Name of field for error message
28
+ * @throws Error if value is not in allowed values
29
+ */
30
+ export declare function validateEnum<T>(value: T, allowedValues: T[], fieldName: string): void;
31
+ /**
32
+ * Parse comma-separated string into trimmed array
33
+ *
34
+ * @param input - Comma-separated string
35
+ * @returns Array of trimmed strings
36
+ */
37
+ export declare function parseCommaSeparated(input: string): string[];
38
+ /**
39
+ * Get the current package version
40
+ *
41
+ * @returns Package version from package.json
42
+ */
43
+ export declare function getPackageVersion(): string;
44
+ //# sourceMappingURL=validation-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-utils.d.ts","sourceRoot":"","sources":["../../../../src/cli/init/utils/validation-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,IAAI,CAIN;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,CAAC,EACR,aAAa,EAAE,CAAC,EAAE,EAClB,SAAS,EAAE,MAAM,GAChB,IAAI,CAMN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAO1C"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /**
3
+ * Validation utilities module
4
+ *
5
+ * Input validation and parsing utilities:
6
+ * - Numeric range validation
7
+ * - Enum validation
8
+ * - Comma-separated string parsing
9
+ * - Package version retrieval
10
+ *
11
+ * @module cli/init/utils/validation-utils
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.validateRange = validateRange;
15
+ exports.validateEnum = validateEnum;
16
+ exports.parseCommaSeparated = parseCommaSeparated;
17
+ exports.getPackageVersion = getPackageVersion;
18
+ /**
19
+ * Validate that a value is within a numeric range
20
+ *
21
+ * @param value - Value to validate
22
+ * @param min - Minimum allowed value (inclusive)
23
+ * @param max - Maximum allowed value (inclusive)
24
+ * @param fieldName - Name of field for error message
25
+ * @throws Error if value is out of range
26
+ */
27
+ function validateRange(value, min, max, fieldName) {
28
+ if (value < min || value > max) {
29
+ throw new Error(`${fieldName} must be between ${min} and ${max}`);
30
+ }
31
+ }
32
+ /**
33
+ * Validate that a value is one of allowed options
34
+ *
35
+ * @param value - Value to validate
36
+ * @param allowedValues - Array of allowed values
37
+ * @param fieldName - Name of field for error message
38
+ * @throws Error if value is not in allowed values
39
+ */
40
+ function validateEnum(value, allowedValues, fieldName) {
41
+ if (!allowedValues.includes(value)) {
42
+ throw new Error(`Invalid ${fieldName}. Must be one of: ${allowedValues.join(', ')}`);
43
+ }
44
+ }
45
+ /**
46
+ * Parse comma-separated string into trimmed array
47
+ *
48
+ * @param input - Comma-separated string
49
+ * @returns Array of trimmed strings
50
+ */
51
+ function parseCommaSeparated(input) {
52
+ return input.split(',').map(item => item.trim()).filter(item => item.length > 0);
53
+ }
54
+ /**
55
+ * Get the current package version
56
+ *
57
+ * @returns Package version from package.json
58
+ */
59
+ function getPackageVersion() {
60
+ try {
61
+ const packageJson = require('../../../../package.json');
62
+ return packageJson.version || 'unknown';
63
+ }
64
+ catch {
65
+ return 'unknown';
66
+ }
67
+ }
68
+ //# sourceMappingURL=validation-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-utils.js","sourceRoot":"","sources":["../../../../src/cli/init/utils/validation-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAWH,sCASC;AAUD,oCAUC;AAQD,kDAEC;AAOD,8CAOC;AA9DD;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAC3B,KAAa,EACb,GAAW,EACX,GAAW,EACX,SAAiB;IAEjB,IAAI,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,oBAAoB,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,KAAQ,EACR,aAAkB,EAClB,SAAiB;IAEjB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,WAAW,SAAS,qBAAqB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACpE,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACnF,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB;IAC/B,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;QACxD,OAAO,WAAW,CAAC,OAAO,IAAI,SAAS,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Shared utilities module for init operations
3
+ *
4
+ * Common functions used across initialization modules for:
5
+ * - File system operations
6
+ * - Logging with chalk formatting
7
+ * - Path handling
8
+ * - Validation
9
+ *
10
+ * @module cli/init/utils
11
+ */
12
+ /**
13
+ * Ensure directory exists, creating it if necessary
14
+ *
15
+ * @param dirPath - Absolute or relative path to directory
16
+ * @throws Error if directory creation fails
17
+ */
18
+ export declare function ensureDirectory(dirPath: string): Promise<void>;
19
+ /**
20
+ * Check if a file exists
21
+ *
22
+ * @param filePath - Path to check
23
+ * @returns True if file exists, false otherwise
24
+ */
25
+ export declare function fileExists(filePath: string): Promise<boolean>;
26
+ /**
27
+ * Check if a directory exists
28
+ *
29
+ * @param dirPath - Path to check
30
+ * @returns True if directory exists, false otherwise
31
+ */
32
+ export declare function directoryExists(dirPath: string): Promise<boolean>;
33
+ /**
34
+ * Write JSON data to file with proper formatting and error handling
35
+ *
36
+ * @param filePath - Path to write JSON file
37
+ * @param data - Data to serialize to JSON
38
+ * @param indent - Number of spaces for indentation (default: 2)
39
+ * @throws Error if write fails
40
+ */
41
+ export declare function safeWriteJson(filePath: string, data: any, indent?: number): Promise<void>;
42
+ /**
43
+ * Read and parse JSON file with error handling
44
+ *
45
+ * @param filePath - Path to JSON file
46
+ * @returns Parsed JSON data
47
+ * @throws Error if file doesn't exist or JSON is invalid
48
+ */
49
+ export declare function safeReadJson<T = any>(filePath: string): Promise<T>;
50
+ /**
51
+ * Write text file with error handling
52
+ *
53
+ * @param filePath - Path to write file
54
+ * @param content - File content
55
+ * @throws Error if write fails
56
+ */
57
+ export declare function safeWriteFile(filePath: string, content: string): Promise<void>;
58
+ /**
59
+ * Log success message with green checkmark
60
+ *
61
+ * @param message - Success message
62
+ * @param prefix - Optional prefix (default: '✓')
63
+ */
64
+ export declare function logSuccess(message: string, prefix?: string): void;
65
+ /**
66
+ * Log warning message with yellow color
67
+ *
68
+ * @param message - Warning message
69
+ * @param prefix - Optional prefix (default: '⚠️')
70
+ */
71
+ export declare function logWarning(message: string, prefix?: string): void;
72
+ /**
73
+ * Log error message with red color
74
+ *
75
+ * @param message - Error message
76
+ * @param prefix - Optional prefix (default: '✗')
77
+ */
78
+ export declare function logError(message: string, prefix?: string): void;
79
+ /**
80
+ * Log info message with gray color
81
+ *
82
+ * @param message - Info message
83
+ * @param prefix - Optional prefix (default: '•')
84
+ */
85
+ export declare function logInfo(message: string, prefix?: string): void;
86
+ /**
87
+ * Log message indicating existing resource (gray checkmark)
88
+ *
89
+ * @param message - Message about existing resource
90
+ */
91
+ export declare function logExists(message: string): void;
92
+ /**
93
+ * Get the base directory for Agentic QE Fleet (.agentic-qe)
94
+ *
95
+ * @param cwd - Current working directory (default: process.cwd())
96
+ * @returns Absolute path to .agentic-qe directory
97
+ */
98
+ export declare function getBaseDir(cwd?: string): string;
99
+ /**
100
+ * Get the data directory for databases
101
+ *
102
+ * @param cwd - Current working directory (default: process.cwd())
103
+ * @returns Absolute path to .agentic-qe/data directory
104
+ */
105
+ export declare function getDataDir(cwd?: string): string;
106
+ /**
107
+ * Get the config directory
108
+ *
109
+ * @param cwd - Current working directory (default: process.cwd())
110
+ * @returns Absolute path to .agentic-qe/config directory
111
+ */
112
+ export declare function getConfigDir(cwd?: string): string;
113
+ /**
114
+ * Get the agents directory
115
+ *
116
+ * @param cwd - Current working directory (default: process.cwd())
117
+ * @returns Absolute path to .agentic-qe/agents directory
118
+ */
119
+ export declare function getAgentsDir(cwd?: string): string;
120
+ /**
121
+ * Get the docs directory
122
+ *
123
+ * @param cwd - Current working directory (default: process.cwd())
124
+ * @returns Absolute path to .agentic-qe/docs directory
125
+ */
126
+ export declare function getDocsDir(cwd?: string): string;
127
+ /**
128
+ * Validate that a value is within a numeric range
129
+ *
130
+ * @param value - Value to validate
131
+ * @param min - Minimum allowed value (inclusive)
132
+ * @param max - Maximum allowed value (inclusive)
133
+ * @param fieldName - Name of field for error message
134
+ * @throws Error if value is out of range
135
+ */
136
+ export declare function validateRange(value: number, min: number, max: number, fieldName: string): void;
137
+ /**
138
+ * Validate that a value is one of allowed options
139
+ *
140
+ * @param value - Value to validate
141
+ * @param allowedValues - Array of allowed values
142
+ * @param fieldName - Name of field for error message
143
+ * @throws Error if value is not in allowed values
144
+ */
145
+ export declare function validateEnum<T>(value: T, allowedValues: T[], fieldName: string): void;
146
+ /**
147
+ * Parse comma-separated string into trimmed array
148
+ *
149
+ * @param input - Comma-separated string
150
+ * @returns Array of trimmed strings
151
+ */
152
+ export declare function parseCommaSeparated(input: string): string[];
153
+ /**
154
+ * Get the current package version
155
+ *
156
+ * @returns Package version from package.json
157
+ */
158
+ export declare function getPackageVersion(): string;
159
+ /**
160
+ * Create a safe directory structure (won't fail if directories exist)
161
+ *
162
+ * @param directories - Array of directory paths to create
163
+ * @param baseDir - Base directory (default: process.cwd())
164
+ * @param force - Force recreation if directory exists
165
+ * @returns Array of created directory paths
166
+ */
167
+ export declare function createDirectories(directories: string[], baseDir?: string, force?: boolean): Promise<string[]>;
168
+ /**
169
+ * Format file size in human-readable format
170
+ *
171
+ * @param bytes - Size in bytes
172
+ * @returns Formatted string (e.g., "1.5 KB", "2.3 MB")
173
+ */
174
+ export declare function formatFileSize(bytes: number): string;
175
+ /**
176
+ * Get relative path from base directory
177
+ *
178
+ * @param fullPath - Absolute path
179
+ * @param baseDir - Base directory (default: process.cwd())
180
+ * @returns Relative path from base directory
181
+ */
182
+ export declare function getRelativePath(fullPath: string, baseDir?: string): string;
183
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/cli/init/utils.ts"],"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