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,187 @@
1
+ "use strict";
2
+ /**
3
+ * File system utilities module
4
+ *
5
+ * Common file system operations for initialization:
6
+ * - Directory creation and validation
7
+ * - File existence checks
8
+ * - Safe JSON and file operations
9
+ * - Directory structure creation
10
+ *
11
+ * @module cli/init/utils/file-utils
12
+ */
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.ensureDirectory = ensureDirectory;
48
+ exports.fileExists = fileExists;
49
+ exports.directoryExists = directoryExists;
50
+ exports.safeWriteJson = safeWriteJson;
51
+ exports.safeReadJson = safeReadJson;
52
+ exports.safeWriteFile = safeWriteFile;
53
+ exports.createDirectories = createDirectories;
54
+ exports.formatFileSize = formatFileSize;
55
+ const fs = __importStar(require("fs-extra"));
56
+ const path = __importStar(require("path"));
57
+ const log_utils_1 = require("./log-utils");
58
+ /**
59
+ * Ensure directory exists, creating it if necessary
60
+ *
61
+ * @param dirPath - Absolute or relative path to directory
62
+ * @throws Error if directory creation fails
63
+ */
64
+ async function ensureDirectory(dirPath) {
65
+ try {
66
+ await fs.ensureDir(dirPath);
67
+ }
68
+ catch (error) {
69
+ throw new Error(`Failed to create directory ${dirPath}: ${error}`);
70
+ }
71
+ }
72
+ /**
73
+ * Check if a file exists
74
+ *
75
+ * @param filePath - Path to check
76
+ * @returns True if file exists, false otherwise
77
+ */
78
+ async function fileExists(filePath) {
79
+ try {
80
+ return await fs.pathExists(filePath);
81
+ }
82
+ catch {
83
+ return false;
84
+ }
85
+ }
86
+ /**
87
+ * Check if a directory exists
88
+ *
89
+ * @param dirPath - Path to check
90
+ * @returns True if directory exists, false otherwise
91
+ */
92
+ async function directoryExists(dirPath) {
93
+ try {
94
+ const stats = await fs.stat(dirPath);
95
+ return stats.isDirectory();
96
+ }
97
+ catch {
98
+ return false;
99
+ }
100
+ }
101
+ /**
102
+ * Write JSON data to file with proper formatting and error handling
103
+ *
104
+ * @param filePath - Path to write JSON file
105
+ * @param data - Data to serialize to JSON
106
+ * @param indent - Number of spaces for indentation (default: 2)
107
+ * @throws Error if write fails
108
+ */
109
+ async function safeWriteJson(filePath, data, indent = 2) {
110
+ try {
111
+ const jsonContent = JSON.stringify(data, null, indent);
112
+ await fs.writeFile(filePath, jsonContent, 'utf-8');
113
+ }
114
+ catch (error) {
115
+ throw new Error(`Failed to write JSON to ${filePath}: ${error}`);
116
+ }
117
+ }
118
+ /**
119
+ * Read and parse JSON file with error handling
120
+ *
121
+ * @param filePath - Path to JSON file
122
+ * @returns Parsed JSON data
123
+ * @throws Error if file doesn't exist or JSON is invalid
124
+ */
125
+ async function safeReadJson(filePath) {
126
+ try {
127
+ const content = await fs.readFile(filePath, 'utf-8');
128
+ return JSON.parse(content);
129
+ }
130
+ catch (error) {
131
+ throw new Error(`Failed to read JSON from ${filePath}: ${error}`);
132
+ }
133
+ }
134
+ /**
135
+ * Write text file with error handling
136
+ *
137
+ * @param filePath - Path to write file
138
+ * @param content - File content
139
+ * @throws Error if write fails
140
+ */
141
+ async function safeWriteFile(filePath, content) {
142
+ try {
143
+ await fs.writeFile(filePath, content, 'utf-8');
144
+ }
145
+ catch (error) {
146
+ throw new Error(`Failed to write file ${filePath}: ${error}`);
147
+ }
148
+ }
149
+ /**
150
+ * Create a safe directory structure (won't fail if directories exist)
151
+ *
152
+ * @param directories - Array of directory paths to create
153
+ * @param baseDir - Base directory (default: process.cwd())
154
+ * @param force - Force recreation if directory exists
155
+ * @returns Array of created directory paths
156
+ */
157
+ async function createDirectories(directories, baseDir = process.cwd(), force = false) {
158
+ const created = [];
159
+ for (const dir of directories) {
160
+ const fullPath = path.join(baseDir, dir);
161
+ if (await fileExists(fullPath) && !force) {
162
+ (0, log_utils_1.logExists)(`Directory exists: ${dir}`);
163
+ continue;
164
+ }
165
+ await ensureDirectory(fullPath);
166
+ (0, log_utils_1.logSuccess)(`Created: ${dir}`);
167
+ created.push(fullPath);
168
+ }
169
+ return created;
170
+ }
171
+ /**
172
+ * Format file size in human-readable format
173
+ *
174
+ * @param bytes - Size in bytes
175
+ * @returns Formatted string (e.g., "1.5 KB", "2.3 MB")
176
+ */
177
+ function formatFileSize(bytes) {
178
+ const units = ['B', 'KB', 'MB', 'GB', 'TB'];
179
+ let size = bytes;
180
+ let unitIndex = 0;
181
+ while (size >= 1024 && unitIndex < units.length - 1) {
182
+ size /= 1024;
183
+ unitIndex++;
184
+ }
185
+ return `${size.toFixed(1)} ${units[unitIndex]}`;
186
+ }
187
+ //# sourceMappingURL=file-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-utils.js","sourceRoot":"","sources":["../../../../src/cli/init/utils/file-utils.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Shared utilities module for init operations
3
+ *
4
+ * Re-exports all utility functions from specialized modules:
5
+ * - File system operations (file-utils)
6
+ * - Logging with chalk formatting (log-utils)
7
+ * - Path handling (path-utils)
8
+ * - Validation (validation-utils)
9
+ *
10
+ * This barrel export maintains backward compatibility with existing imports.
11
+ *
12
+ * @module cli/init/utils
13
+ */
14
+ export { ensureDirectory, fileExists, directoryExists, safeWriteJson, safeReadJson, safeWriteFile, createDirectories, formatFileSize, } from './file-utils';
15
+ export { logSuccess, logWarning, logError, logInfo, logExists, } from './log-utils';
16
+ export { getBaseDir, getDataDir, getConfigDir, getAgentsDir, getDocsDir, getRelativePath, } from './path-utils';
17
+ export { validateRange, validateEnum, parseCommaSeparated, getPackageVersion, } from './validation-utils';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/init/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,GACV,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,eAAe,GAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * Shared utilities module for init operations
4
+ *
5
+ * Re-exports all utility functions from specialized modules:
6
+ * - File system operations (file-utils)
7
+ * - Logging with chalk formatting (log-utils)
8
+ * - Path handling (path-utils)
9
+ * - Validation (validation-utils)
10
+ *
11
+ * This barrel export maintains backward compatibility with existing imports.
12
+ *
13
+ * @module cli/init/utils
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.getPackageVersion = exports.parseCommaSeparated = exports.validateEnum = exports.validateRange = exports.getRelativePath = exports.getDocsDir = exports.getAgentsDir = exports.getConfigDir = exports.getDataDir = exports.getBaseDir = exports.logExists = exports.logInfo = exports.logError = exports.logWarning = exports.logSuccess = exports.formatFileSize = exports.createDirectories = exports.safeWriteFile = exports.safeReadJson = exports.safeWriteJson = exports.directoryExists = exports.fileExists = exports.ensureDirectory = void 0;
17
+ // File system utilities
18
+ var file_utils_1 = require("./file-utils");
19
+ Object.defineProperty(exports, "ensureDirectory", { enumerable: true, get: function () { return file_utils_1.ensureDirectory; } });
20
+ Object.defineProperty(exports, "fileExists", { enumerable: true, get: function () { return file_utils_1.fileExists; } });
21
+ Object.defineProperty(exports, "directoryExists", { enumerable: true, get: function () { return file_utils_1.directoryExists; } });
22
+ Object.defineProperty(exports, "safeWriteJson", { enumerable: true, get: function () { return file_utils_1.safeWriteJson; } });
23
+ Object.defineProperty(exports, "safeReadJson", { enumerable: true, get: function () { return file_utils_1.safeReadJson; } });
24
+ Object.defineProperty(exports, "safeWriteFile", { enumerable: true, get: function () { return file_utils_1.safeWriteFile; } });
25
+ Object.defineProperty(exports, "createDirectories", { enumerable: true, get: function () { return file_utils_1.createDirectories; } });
26
+ Object.defineProperty(exports, "formatFileSize", { enumerable: true, get: function () { return file_utils_1.formatFileSize; } });
27
+ // Logging utilities
28
+ var log_utils_1 = require("./log-utils");
29
+ Object.defineProperty(exports, "logSuccess", { enumerable: true, get: function () { return log_utils_1.logSuccess; } });
30
+ Object.defineProperty(exports, "logWarning", { enumerable: true, get: function () { return log_utils_1.logWarning; } });
31
+ Object.defineProperty(exports, "logError", { enumerable: true, get: function () { return log_utils_1.logError; } });
32
+ Object.defineProperty(exports, "logInfo", { enumerable: true, get: function () { return log_utils_1.logInfo; } });
33
+ Object.defineProperty(exports, "logExists", { enumerable: true, get: function () { return log_utils_1.logExists; } });
34
+ // Path utilities
35
+ var path_utils_1 = require("./path-utils");
36
+ Object.defineProperty(exports, "getBaseDir", { enumerable: true, get: function () { return path_utils_1.getBaseDir; } });
37
+ Object.defineProperty(exports, "getDataDir", { enumerable: true, get: function () { return path_utils_1.getDataDir; } });
38
+ Object.defineProperty(exports, "getConfigDir", { enumerable: true, get: function () { return path_utils_1.getConfigDir; } });
39
+ Object.defineProperty(exports, "getAgentsDir", { enumerable: true, get: function () { return path_utils_1.getAgentsDir; } });
40
+ Object.defineProperty(exports, "getDocsDir", { enumerable: true, get: function () { return path_utils_1.getDocsDir; } });
41
+ Object.defineProperty(exports, "getRelativePath", { enumerable: true, get: function () { return path_utils_1.getRelativePath; } });
42
+ // Validation utilities
43
+ var validation_utils_1 = require("./validation-utils");
44
+ Object.defineProperty(exports, "validateRange", { enumerable: true, get: function () { return validation_utils_1.validateRange; } });
45
+ Object.defineProperty(exports, "validateEnum", { enumerable: true, get: function () { return validation_utils_1.validateEnum; } });
46
+ Object.defineProperty(exports, "parseCommaSeparated", { enumerable: true, get: function () { return validation_utils_1.parseCommaSeparated; } });
47
+ Object.defineProperty(exports, "getPackageVersion", { enumerable: true, get: function () { return validation_utils_1.getPackageVersion; } });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/init/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,wBAAwB;AACxB,2CASsB;AARpB,6GAAA,eAAe,OAAA;AACf,wGAAA,UAAU,OAAA;AACV,6GAAA,eAAe,OAAA;AACf,2GAAA,aAAa,OAAA;AACb,0GAAA,YAAY,OAAA;AACZ,2GAAA,aAAa,OAAA;AACb,+GAAA,iBAAiB,OAAA;AACjB,4GAAA,cAAc,OAAA;AAGhB,oBAAoB;AACpB,yCAMqB;AALnB,uGAAA,UAAU,OAAA;AACV,uGAAA,UAAU,OAAA;AACV,qGAAA,QAAQ,OAAA;AACR,oGAAA,OAAO,OAAA;AACP,sGAAA,SAAS,OAAA;AAGX,iBAAiB;AACjB,2CAOsB;AANpB,wGAAA,UAAU,OAAA;AACV,wGAAA,UAAU,OAAA;AACV,0GAAA,YAAY,OAAA;AACZ,0GAAA,YAAY,OAAA;AACZ,wGAAA,UAAU,OAAA;AACV,6GAAA,eAAe,OAAA;AAGjB,uBAAuB;AACvB,uDAK4B;AAJ1B,iHAAA,aAAa,OAAA;AACb,gHAAA,YAAY,OAAA;AACZ,uHAAA,mBAAmB,OAAA;AACnB,qHAAA,iBAAiB,OAAA"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Logging utilities module
3
+ *
4
+ * Formatted console logging with chalk:
5
+ * - Success messages (green)
6
+ * - Warning messages (yellow)
7
+ * - Error messages (red)
8
+ * - Info messages (gray)
9
+ * - Existence messages (gray)
10
+ *
11
+ * @module cli/init/utils/log-utils
12
+ */
13
+ /**
14
+ * Log success message with green checkmark
15
+ *
16
+ * @param message - Success message
17
+ * @param prefix - Optional prefix (default: '✓')
18
+ */
19
+ export declare function logSuccess(message: string, prefix?: string): void;
20
+ /**
21
+ * Log warning message with yellow color
22
+ *
23
+ * @param message - Warning message
24
+ * @param prefix - Optional prefix (default: '⚠️')
25
+ */
26
+ export declare function logWarning(message: string, prefix?: string): void;
27
+ /**
28
+ * Log error message with red color
29
+ *
30
+ * @param message - Error message
31
+ * @param prefix - Optional prefix (default: '✗')
32
+ */
33
+ export declare function logError(message: string, prefix?: string): void;
34
+ /**
35
+ * Log info message with gray color
36
+ *
37
+ * @param message - Info message
38
+ * @param prefix - Optional prefix (default: '•')
39
+ */
40
+ export declare function logInfo(message: string, prefix?: string): void;
41
+ /**
42
+ * Log message indicating existing resource (gray checkmark)
43
+ *
44
+ * @param message - Message about existing resource
45
+ */
46
+ export declare function logExists(message: string): void;
47
+ //# sourceMappingURL=log-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-utils.d.ts","sourceRoot":"","sources":["../../../../src/cli/init/utils/log-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY,GAAG,IAAI,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAa,GAAG,IAAI,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY,GAAG,IAAI,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY,GAAG,IAAI,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE/C"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /**
3
+ * Logging utilities module
4
+ *
5
+ * Formatted console logging with chalk:
6
+ * - Success messages (green)
7
+ * - Warning messages (yellow)
8
+ * - Error messages (red)
9
+ * - Info messages (gray)
10
+ * - Existence messages (gray)
11
+ *
12
+ * @module cli/init/utils/log-utils
13
+ */
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.logSuccess = logSuccess;
19
+ exports.logWarning = logWarning;
20
+ exports.logError = logError;
21
+ exports.logInfo = logInfo;
22
+ exports.logExists = logExists;
23
+ const chalk_1 = __importDefault(require("chalk"));
24
+ /**
25
+ * Log success message with green checkmark
26
+ *
27
+ * @param message - Success message
28
+ * @param prefix - Optional prefix (default: '✓')
29
+ */
30
+ function logSuccess(message, prefix = '✓') {
31
+ console.log(chalk_1.default.green(` ${prefix} ${message}`));
32
+ }
33
+ /**
34
+ * Log warning message with yellow color
35
+ *
36
+ * @param message - Warning message
37
+ * @param prefix - Optional prefix (default: '⚠️')
38
+ */
39
+ function logWarning(message, prefix = '⚠️') {
40
+ console.log(chalk_1.default.yellow(` ${prefix} ${message}`));
41
+ }
42
+ /**
43
+ * Log error message with red color
44
+ *
45
+ * @param message - Error message
46
+ * @param prefix - Optional prefix (default: '✗')
47
+ */
48
+ function logError(message, prefix = '✗') {
49
+ console.log(chalk_1.default.red(` ${prefix} ${message}`));
50
+ }
51
+ /**
52
+ * Log info message with gray color
53
+ *
54
+ * @param message - Info message
55
+ * @param prefix - Optional prefix (default: '•')
56
+ */
57
+ function logInfo(message, prefix = '•') {
58
+ console.log(chalk_1.default.gray(` ${prefix} ${message}`));
59
+ }
60
+ /**
61
+ * Log message indicating existing resource (gray checkmark)
62
+ *
63
+ * @param message - Message about existing resource
64
+ */
65
+ function logExists(message) {
66
+ console.log(chalk_1.default.gray(` ✓ ${message}`));
67
+ }
68
+ //# sourceMappingURL=log-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-utils.js","sourceRoot":"","sources":["../../../../src/cli/init/utils/log-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;AAUH,gCAEC;AAQD,gCAEC;AAQD,4BAEC;AAQD,0BAEC;AAOD,8BAEC;AAjDD,kDAA0B;AAE1B;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAAe,EAAE,SAAiB,GAAG;IAC9D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAAe,EAAE,SAAiB,IAAI;IAC/D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,SAAiB,GAAG;IAC5D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,KAAK,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,OAAe,EAAE,SAAiB,GAAG;IAC3D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,KAAK,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Path utilities module
3
+ *
4
+ * Path handling for Agentic QE Fleet directories:
5
+ * - Base directory (.agentic-qe)
6
+ * - Data directory (databases)
7
+ * - Config directory
8
+ * - Agents directory
9
+ * - Docs directory
10
+ * - Template resolution (centralized)
11
+ * - Relative path conversion
12
+ *
13
+ * @module cli/init/utils/path-utils
14
+ */
15
+ /**
16
+ * Get the base directory for Agentic QE Fleet (.agentic-qe)
17
+ *
18
+ * @param cwd - Current working directory (default: process.cwd())
19
+ * @returns Absolute path to .agentic-qe directory
20
+ */
21
+ export declare function getBaseDir(cwd?: string): string;
22
+ /**
23
+ * Get the data directory for databases
24
+ *
25
+ * @param cwd - Current working directory (default: process.cwd())
26
+ * @returns Absolute path to .agentic-qe/data directory
27
+ */
28
+ export declare function getDataDir(cwd?: string): string;
29
+ /**
30
+ * Get the config directory
31
+ *
32
+ * @param cwd - Current working directory (default: process.cwd())
33
+ * @returns Absolute path to .agentic-qe/config directory
34
+ */
35
+ export declare function getConfigDir(cwd?: string): string;
36
+ /**
37
+ * Get the agents directory
38
+ *
39
+ * @param cwd - Current working directory (default: process.cwd())
40
+ * @returns Absolute path to .agentic-qe/agents directory
41
+ */
42
+ export declare function getAgentsDir(cwd?: string): string;
43
+ /**
44
+ * Get the docs directory
45
+ *
46
+ * @param cwd - Current working directory (default: process.cwd())
47
+ * @returns Absolute path to .agentic-qe/docs directory
48
+ */
49
+ export declare function getDocsDir(cwd?: string): string;
50
+ /**
51
+ * Get relative path from base directory
52
+ *
53
+ * @param fullPath - Absolute path
54
+ * @param baseDir - Base directory (default: process.cwd())
55
+ * @returns Relative path from base directory
56
+ */
57
+ export declare function getRelativePath(fullPath: string, baseDir?: string): string;
58
+ /**
59
+ * Get the package root directory (where package.json lives)
60
+ *
61
+ * Searches upward from __dirname until package.json is found.
62
+ * Handles both development and installed package scenarios.
63
+ *
64
+ * @returns Absolute path to package root directory
65
+ * @throws Error if package.json cannot be found
66
+ */
67
+ export declare function getPackageRoot(): string;
68
+ /**
69
+ * Resolve template file path with centralized fallback logic
70
+ *
71
+ * Searches for templates in this order:
72
+ * 1. Project root templates/ directory (for user customization)
73
+ * 2. Package root templates/ directory (development)
74
+ * 3. node_modules/agentic-qe/templates/ (installed package)
75
+ *
76
+ * @param templateFileName - Template file name (e.g., 'aqe.sh')
77
+ * @param projectRoot - Project root directory (default: process.cwd())
78
+ * @returns Absolute path to template file
79
+ * @throws Error if template not found in any location
80
+ */
81
+ export declare function resolveTemplatePath(templateFileName: string, projectRoot?: string): Promise<string>;
82
+ /**
83
+ * Synchronous version of resolveTemplatePath for use in non-async contexts
84
+ *
85
+ * @param templateFileName - Template file name
86
+ * @param projectRoot - Project root directory (default: process.cwd())
87
+ * @returns Absolute path to template file
88
+ * @throws Error if template not found
89
+ */
90
+ export declare function resolveTemplatePathSync(templateFileName: string, projectRoot?: string): string;
91
+ //# sourceMappingURL=path-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../../../src/cli/init/utils/path-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,MAAM,CAEzF;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CA6BvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACvC,gBAAgB,EAAE,MAAM,EACxB,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,MAAM,EACxB,WAAW,GAAE,MAAsB,GAClC,MAAM,CAiBR"}