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,207 @@
1
+ "use strict";
2
+ /**
3
+ * Constitution Module - Main Entry Point
4
+ *
5
+ * Provides the complete constitution framework for the Agentic QE Fleet,
6
+ * enabling quality evaluation criteria definition and validation.
7
+ *
8
+ * @module constitution
9
+ * @version 1.0.0
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import {
14
+ * loadConstitution,
15
+ * validateConstitution,
16
+ * getConstitutionForAgent,
17
+ * Constitution,
18
+ * Principle,
19
+ * Rule
20
+ * } from './constitution';
21
+ *
22
+ * // Load a specific constitution
23
+ * const constitution = loadConstitution('./path/to/constitution.json');
24
+ *
25
+ * // Get constitution for an agent type
26
+ * const agentConstitution = getConstitutionForAgent('test-generator');
27
+ *
28
+ * // Validate a constitution object
29
+ * const result = validateConstitution(myConstitution);
30
+ * if (!result.valid) {
31
+ * console.error('Validation errors:', result.errors);
32
+ * }
33
+ * ```
34
+ */
35
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
36
+ if (k2 === undefined) k2 = k;
37
+ var desc = Object.getOwnPropertyDescriptor(m, k);
38
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
39
+ desc = { enumerable: true, get: function() { return m[k]; } };
40
+ }
41
+ Object.defineProperty(o, k2, desc);
42
+ }) : (function(o, m, k, k2) {
43
+ if (k2 === undefined) k2 = k;
44
+ o[k2] = m[k];
45
+ }));
46
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
47
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
48
+ }) : function(o, v) {
49
+ o["default"] = v;
50
+ });
51
+ var __importStar = (this && this.__importStar) || (function () {
52
+ var ownKeys = function(o) {
53
+ ownKeys = Object.getOwnPropertyNames || function (o) {
54
+ var ar = [];
55
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
56
+ return ar;
57
+ };
58
+ return ownKeys(o);
59
+ };
60
+ return function (mod) {
61
+ if (mod && mod.__esModule) return mod;
62
+ var result = {};
63
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
64
+ __setModuleDefault(result, mod);
65
+ return result;
66
+ };
67
+ })();
68
+ Object.defineProperty(exports, "__esModule", { value: true });
69
+ exports.AGENT_CONSTITUTION_MAP = exports.DEFAULT_CONSTITUTIONS = exports.SCHEMA_VERSION = exports.CONSTITUTION_VERSION = exports.listAvailableConstitutions = exports.getBaseConstitutionsPath = exports.getConstitutionForAgent = exports.validateConstitution = exports.mergeConstitutions = exports.loadConstitutions = exports.loadConstitution = exports.getDefaultLoader = exports.ConstitutionLoader = exports.isMetricDefinition = exports.isRule = exports.isPrinciple = exports.isConstitution = void 0;
70
+ exports.loadDefaultConstitution = loadDefaultConstitution;
71
+ exports.loadTestGenerationConstitution = loadTestGenerationConstitution;
72
+ exports.loadCodeReviewConstitution = loadCodeReviewConstitution;
73
+ exports.loadPerformanceConstitution = loadPerformanceConstitution;
74
+ exports.loadAllBaseConstitutions = loadAllBaseConstitutions;
75
+ exports.getRecommendedConstitutionId = getRecommendedConstitutionId;
76
+ exports.getConstitutionModuleInfo = getConstitutionModuleInfo;
77
+ // Export type guards
78
+ var schema_1 = require("./schema");
79
+ Object.defineProperty(exports, "isConstitution", { enumerable: true, get: function () { return schema_1.isConstitution; } });
80
+ Object.defineProperty(exports, "isPrinciple", { enumerable: true, get: function () { return schema_1.isPrinciple; } });
81
+ Object.defineProperty(exports, "isRule", { enumerable: true, get: function () { return schema_1.isRule; } });
82
+ Object.defineProperty(exports, "isMetricDefinition", { enumerable: true, get: function () { return schema_1.isMetricDefinition; } });
83
+ // Export loader class and functions
84
+ var loader_1 = require("./loader");
85
+ Object.defineProperty(exports, "ConstitutionLoader", { enumerable: true, get: function () { return loader_1.ConstitutionLoader; } });
86
+ Object.defineProperty(exports, "getDefaultLoader", { enumerable: true, get: function () { return loader_1.getDefaultLoader; } });
87
+ Object.defineProperty(exports, "loadConstitution", { enumerable: true, get: function () { return loader_1.loadConstitution; } });
88
+ Object.defineProperty(exports, "loadConstitutions", { enumerable: true, get: function () { return loader_1.loadConstitutions; } });
89
+ Object.defineProperty(exports, "mergeConstitutions", { enumerable: true, get: function () { return loader_1.mergeConstitutions; } });
90
+ Object.defineProperty(exports, "validateConstitution", { enumerable: true, get: function () { return loader_1.validateConstitution; } });
91
+ Object.defineProperty(exports, "getConstitutionForAgent", { enumerable: true, get: function () { return loader_1.getConstitutionForAgent; } });
92
+ Object.defineProperty(exports, "getBaseConstitutionsPath", { enumerable: true, get: function () { return loader_1.getBaseConstitutionsPath; } });
93
+ Object.defineProperty(exports, "listAvailableConstitutions", { enumerable: true, get: function () { return loader_1.listAvailableConstitutions; } });
94
+ // Re-export for convenience
95
+ const loader_2 = require("./loader");
96
+ const path = __importStar(require("path"));
97
+ /**
98
+ * Load the default constitution
99
+ *
100
+ * @returns The default base constitution
101
+ */
102
+ function loadDefaultConstitution() {
103
+ const loader = new loader_2.ConstitutionLoader();
104
+ const basePath = (0, loader_2.getBaseConstitutionsPath)();
105
+ return loader.loadConstitution(path.join(basePath, 'default.constitution.json'));
106
+ }
107
+ /**
108
+ * Load the test generation constitution
109
+ *
110
+ * @returns The test generation constitution (merged with default)
111
+ */
112
+ function loadTestGenerationConstitution() {
113
+ const loader = new loader_2.ConstitutionLoader();
114
+ const basePath = (0, loader_2.getBaseConstitutionsPath)();
115
+ return loader.loadConstitution(path.join(basePath, 'test-generation.constitution.json'), { resolveInheritance: true });
116
+ }
117
+ /**
118
+ * Load the code review constitution
119
+ *
120
+ * @returns The code review constitution (merged with default)
121
+ */
122
+ function loadCodeReviewConstitution() {
123
+ const loader = new loader_2.ConstitutionLoader();
124
+ const basePath = (0, loader_2.getBaseConstitutionsPath)();
125
+ return loader.loadConstitution(path.join(basePath, 'code-review.constitution.json'), { resolveInheritance: true });
126
+ }
127
+ /**
128
+ * Load the performance testing constitution
129
+ *
130
+ * @returns The performance testing constitution (merged with default)
131
+ */
132
+ function loadPerformanceConstitution() {
133
+ const loader = new loader_2.ConstitutionLoader();
134
+ const basePath = (0, loader_2.getBaseConstitutionsPath)();
135
+ return loader.loadConstitution(path.join(basePath, 'performance.constitution.json'), { resolveInheritance: true });
136
+ }
137
+ /**
138
+ * Get all available base constitutions
139
+ *
140
+ * @returns Map of constitution ID to Constitution object
141
+ */
142
+ function loadAllBaseConstitutions() {
143
+ const loader = new loader_2.ConstitutionLoader();
144
+ const basePath = (0, loader_2.getBaseConstitutionsPath)();
145
+ return loader.loadConstitutions(basePath, { resolveInheritance: true });
146
+ }
147
+ /**
148
+ * Constitution module version
149
+ */
150
+ exports.CONSTITUTION_VERSION = '1.0.0';
151
+ /**
152
+ * Supported constitution schema version
153
+ */
154
+ exports.SCHEMA_VERSION = 'draft-07';
155
+ /**
156
+ * Default constitution IDs
157
+ */
158
+ exports.DEFAULT_CONSTITUTIONS = {
159
+ DEFAULT: 'default',
160
+ TEST_GENERATION: 'test-generation',
161
+ CODE_REVIEW: 'code-review',
162
+ PERFORMANCE: 'performance'
163
+ };
164
+ /**
165
+ * Agent type to default constitution mapping
166
+ */
167
+ exports.AGENT_CONSTITUTION_MAP = {
168
+ 'test-generator': 'test-generation',
169
+ 'qe-test-generator': 'test-generation',
170
+ 'code-reviewer': 'code-review',
171
+ 'qe-code-reviewer': 'code-review',
172
+ 'quality-analyzer': 'code-review',
173
+ 'performance-tester': 'performance',
174
+ 'qe-performance-tester': 'performance',
175
+ // Other agents fall back to default
176
+ 'coverage-analyzer': 'default',
177
+ 'security-scanner': 'default',
178
+ 'quality-gate': 'default',
179
+ 'flaky-test-hunter': 'default',
180
+ 'requirements-validator': 'default',
181
+ 'production-intelligence': 'default',
182
+ 'deployment-readiness': 'default',
183
+ 'regression-risk-analyzer': 'default',
184
+ 'test-data-architect': 'default',
185
+ 'api-contract-validator': 'default'
186
+ };
187
+ /**
188
+ * Get the recommended constitution ID for an agent type
189
+ *
190
+ * @param agentType - The agent type
191
+ * @returns The recommended constitution ID
192
+ */
193
+ function getRecommendedConstitutionId(agentType) {
194
+ return exports.AGENT_CONSTITUTION_MAP[agentType] || 'default';
195
+ }
196
+ /**
197
+ * Summary information about the constitution module
198
+ */
199
+ function getConstitutionModuleInfo() {
200
+ return {
201
+ version: exports.CONSTITUTION_VERSION,
202
+ schemaVersion: exports.SCHEMA_VERSION,
203
+ availableConstitutions: (0, loader_2.listAvailableConstitutions)(),
204
+ basePath: (0, loader_2.getBaseConstitutionsPath)()
205
+ };
206
+ }
207
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constitution/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EH,0DAMC;AAOD,wEAOC;AAOD,gEAOC;AAOD,kEAOC;AAOD,4DAIC;AAoDD,oEAEC;AAKD,8DAYC;AArKD,qBAAqB;AACrB,mCAKkB;AAJhB,wGAAA,cAAc,OAAA;AACd,qGAAA,WAAW,OAAA;AACX,gGAAA,MAAM,OAAA;AACN,4GAAA,kBAAkB,OAAA;AAGpB,oCAAoC;AACpC,mCAUkB;AAThB,4GAAA,kBAAkB,OAAA;AAClB,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA;AAChB,2GAAA,iBAAiB,OAAA;AACjB,4GAAA,kBAAkB,OAAA;AAClB,8GAAA,oBAAoB,OAAA;AACpB,iHAAA,uBAAuB,OAAA;AACvB,kHAAA,wBAAwB,OAAA;AACxB,oHAAA,0BAA0B,OAAA;AAG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D,QAAQ,EAAE,IAAA,iCAAwB,GAAE;KACrC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Constitution Loader - Load, validate, and manage constitutions
3
+ *
4
+ * Provides functionality to load constitution files, validate against schema,
5
+ * and support inheritance/composition patterns.
6
+ *
7
+ * @module constitution/loader
8
+ * @version 1.0.0
9
+ */
10
+ import { Constitution, ValidationResult, LoadOptions, MergeOptions } from './schema';
11
+ /**
12
+ * Constitution loader class for managing quality constitutions
13
+ */
14
+ export declare class ConstitutionLoader {
15
+ private ajv;
16
+ private validateFn;
17
+ private constitutionCache;
18
+ private schemaLoaded;
19
+ constructor();
20
+ /**
21
+ * Load and compile the JSON schema for validation
22
+ */
23
+ private loadSchema;
24
+ /**
25
+ * Load a single constitution from a file path
26
+ *
27
+ * @param filePath - Path to the constitution JSON file
28
+ * @param options - Loading options
29
+ * @returns Loaded and optionally validated constitution
30
+ */
31
+ loadConstitution(filePath: string, options?: LoadOptions): Constitution;
32
+ /**
33
+ * Load all constitutions from a directory
34
+ *
35
+ * @param directory - Directory containing constitution files
36
+ * @param options - Loading options
37
+ * @returns Map of constitution ID to Constitution object
38
+ */
39
+ loadConstitutions(directory: string, options?: LoadOptions): Map<string, Constitution>;
40
+ /**
41
+ * Merge two constitutions with inheritance support
42
+ *
43
+ * @param base - Base constitution to inherit from
44
+ * @param override - Constitution with overrides
45
+ * @param options - Merge options
46
+ * @returns Merged constitution
47
+ */
48
+ mergeConstitutions(base: Constitution, override: Constitution, options?: MergeOptions): Constitution;
49
+ /**
50
+ * Merge arrays based on strategy
51
+ */
52
+ private mergeArrays;
53
+ /**
54
+ * Validate a constitution against the JSON schema
55
+ *
56
+ * @param constitution - Constitution object to validate
57
+ * @returns Validation result with errors and warnings
58
+ */
59
+ validateConstitution(constitution: unknown): ValidationResult;
60
+ /**
61
+ * Convert Ajv error to ValidationError
62
+ */
63
+ private ajvErrorToValidationError;
64
+ /**
65
+ * Get constitution for a specific agent type
66
+ *
67
+ * @param agentType - Type of agent
68
+ * @param constitutionsDir - Directory containing constitutions
69
+ * @returns Constitution applicable to the agent
70
+ */
71
+ getConstitutionForAgent(agentType: string, constitutionsDir?: string): Constitution;
72
+ /**
73
+ * Clear the constitution cache
74
+ */
75
+ clearCache(): void;
76
+ /**
77
+ * Get cache statistics
78
+ */
79
+ getCacheStats(): {
80
+ size: number;
81
+ keys: string[];
82
+ };
83
+ }
84
+ /**
85
+ * Get the default constitution loader instance
86
+ */
87
+ export declare function getDefaultLoader(): ConstitutionLoader;
88
+ /**
89
+ * Load a single constitution from file
90
+ * Convenience function using default loader
91
+ *
92
+ * @param filePath - Path to constitution file
93
+ * @param options - Loading options
94
+ * @returns Loaded constitution
95
+ */
96
+ export declare function loadConstitution(filePath: string, options?: LoadOptions): Constitution;
97
+ /**
98
+ * Load all constitutions from directory
99
+ * Convenience function using default loader
100
+ *
101
+ * @param directory - Directory containing constitutions
102
+ * @param options - Loading options
103
+ * @returns Map of constitution ID to Constitution
104
+ */
105
+ export declare function loadConstitutions(directory: string, options?: LoadOptions): Map<string, Constitution>;
106
+ /**
107
+ * Merge two constitutions
108
+ * Convenience function using default loader
109
+ *
110
+ * @param base - Base constitution
111
+ * @param override - Override constitution
112
+ * @param options - Merge options
113
+ * @returns Merged constitution
114
+ */
115
+ export declare function mergeConstitutions(base: Constitution, override: Constitution, options?: MergeOptions): Constitution;
116
+ /**
117
+ * Validate a constitution
118
+ * Convenience function using default loader
119
+ *
120
+ * @param constitution - Constitution to validate
121
+ * @returns Validation result
122
+ */
123
+ export declare function validateConstitution(constitution: unknown): ValidationResult;
124
+ /**
125
+ * Get constitution for agent type
126
+ * Convenience function using default loader
127
+ *
128
+ * @param agentType - Agent type
129
+ * @param constitutionsDir - Optional directory
130
+ * @returns Constitution for agent
131
+ */
132
+ export declare function getConstitutionForAgent(agentType: string, constitutionsDir?: string): Constitution;
133
+ /**
134
+ * Get the base constitutions directory path
135
+ */
136
+ export declare function getBaseConstitutionsPath(): string;
137
+ /**
138
+ * List available constitution files in the base directory
139
+ */
140
+ export declare function listAvailableConstitutions(): string[];
141
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/constitution/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EACL,YAAY,EACZ,gBAAgB,EAGhB,WAAW,EACX,YAAY,EAKb,MAAM,UAAU,CAAC;AAKlB;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,iBAAiB,CAAwC;IACjE,OAAO,CAAC,YAAY,CAAkB;;IAWtC;;OAEG;IACH,OAAO,CAAC,UAAU;IAmBlB;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,YAAY;IAwD3E;;;;;;OAMG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC;IA+B1F;;;;;;;OAOG;IACH,kBAAkB,CAChB,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,YAAiB,GACzB,YAAY;IAiDf;;OAEG;IACH,OAAO,CAAC,WAAW;IAuCnB;;;;;OAKG;IACH,oBAAoB,CAAC,YAAY,EAAE,OAAO,GAAG,gBAAgB;IAuG7D;;OAEG;IACH,OAAO,CAAC,yBAAyB;IASjC;;;;;;OAMG;IACH,uBAAuB,CACrB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,GACxB,YAAY;IA4Cf;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,aAAa,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;CA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