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,84 @@
1
+ "use strict";
2
+ /**
3
+ * OpenTelemetry Module for Agentic QE Fleet
4
+ *
5
+ * Main entry point for telemetry functionality.
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
24
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
25
+ };
26
+ var __importStar = (this && this.__importStar) || (function () {
27
+ var ownKeys = function(o) {
28
+ ownKeys = Object.getOwnPropertyNames || function (o) {
29
+ var ar = [];
30
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
31
+ return ar;
32
+ };
33
+ return ownKeys(o);
34
+ };
35
+ return function (mod) {
36
+ if (mod && mod.__esModule) return mod;
37
+ var result = {};
38
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
39
+ __setModuleDefault(result, mod);
40
+ return result;
41
+ };
42
+ })();
43
+ Object.defineProperty(exports, "__esModule", { value: true });
44
+ exports.SPAN_NAMES = exports.HISTOGRAM_BOUNDARIES = exports.METRIC_NAMES = exports.defaultTelemetryConfig = exports.setSpanAttributes = exports.recordSpanEvent = exports.withSpan = exports.isTelemetryInitialized = exports.getMeter = exports.getTracer = exports.shutdownTelemetry = exports.initTelemetry = void 0;
45
+ exports.quickStartTelemetry = quickStartTelemetry;
46
+ // Bootstrap exports
47
+ var bootstrap_1 = require("./bootstrap");
48
+ Object.defineProperty(exports, "initTelemetry", { enumerable: true, get: function () { return bootstrap_1.initTelemetry; } });
49
+ Object.defineProperty(exports, "shutdownTelemetry", { enumerable: true, get: function () { return bootstrap_1.shutdownTelemetry; } });
50
+ Object.defineProperty(exports, "getTracer", { enumerable: true, get: function () { return bootstrap_1.getTracer; } });
51
+ Object.defineProperty(exports, "getMeter", { enumerable: true, get: function () { return bootstrap_1.getMeter; } });
52
+ Object.defineProperty(exports, "isTelemetryInitialized", { enumerable: true, get: function () { return bootstrap_1.isTelemetryInitialized; } });
53
+ Object.defineProperty(exports, "withSpan", { enumerable: true, get: function () { return bootstrap_1.withSpan; } });
54
+ Object.defineProperty(exports, "recordSpanEvent", { enumerable: true, get: function () { return bootstrap_1.recordSpanEvent; } });
55
+ Object.defineProperty(exports, "setSpanAttributes", { enumerable: true, get: function () { return bootstrap_1.setSpanAttributes; } });
56
+ Object.defineProperty(exports, "defaultTelemetryConfig", { enumerable: true, get: function () { return bootstrap_1.defaultTelemetryConfig; } });
57
+ // Type exports
58
+ var types_1 = require("./types");
59
+ Object.defineProperty(exports, "METRIC_NAMES", { enumerable: true, get: function () { return types_1.METRIC_NAMES; } });
60
+ Object.defineProperty(exports, "HISTOGRAM_BOUNDARIES", { enumerable: true, get: function () { return types_1.HISTOGRAM_BOUNDARIES; } });
61
+ Object.defineProperty(exports, "SPAN_NAMES", { enumerable: true, get: function () { return types_1.SPAN_NAMES; } });
62
+ // Metrics exports
63
+ __exportStar(require("./metrics"), exports);
64
+ /**
65
+ * Quick start function for initializing telemetry with defaults
66
+ *
67
+ * @param serviceName - Optional service name override
68
+ * @returns Initialization result
69
+ */
70
+ async function quickStartTelemetry(serviceName) {
71
+ const { initTelemetry } = await Promise.resolve().then(() => __importStar(require('./bootstrap')));
72
+ const { initializeAllMetrics } = await Promise.resolve().then(() => __importStar(require('./metrics')));
73
+ const result = await initTelemetry({
74
+ serviceName: serviceName || 'agentic-qe-fleet',
75
+ enableConsoleExport: process.env.NODE_ENV === 'development',
76
+ enableAutoInstrumentation: true,
77
+ });
78
+ if (result.success) {
79
+ // Initialize all metrics
80
+ initializeAllMetrics();
81
+ }
82
+ return result;
83
+ }
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCH,kDAgBC;AArDD,oBAAoB;AACpB,yCAUqB;AATnB,0GAAA,aAAa,OAAA;AACb,8GAAA,iBAAiB,OAAA;AACjB,sGAAA,SAAS,OAAA;AACT,qGAAA,QAAQ,OAAA;AACR,mHAAA,sBAAsB,OAAA;AACtB,qGAAA,QAAQ,OAAA;AACR,4GAAA,eAAe,OAAA;AACf,8GAAA,iBAAiB,OAAA;AACjB,mHAAA,sBAAsB,OAAA;AAGxB,eAAe;AACf,iCAYiB;AAHf,qGAAA,YAAY,OAAA;AACZ,6GAAA,oBAAoB,OAAA;AACpB,mGAAA,UAAU,OAAA;AAGZ,kBAAkB;AAClB,4CAA0B;AAE1B;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB,CAAC,WAAoB;IAC5D,MAAM,EAAE,aAAa,EAAE,GAAG,wDAAa,aAAa,GAAC,CAAC;IACtD,MAAM,EAAE,oBAAoB,EAAE,GAAG,wDAAa,WAAW,GAAC,CAAC;IAE3D,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;QACjC,WAAW,EAAE,WAAW,IAAI,kBAAkB;QAC9C,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;QAC3D,yBAAyB,EAAE,IAAI;KAChC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,yBAAyB;QACzB,oBAAoB,EAAE,CAAC;IACzB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Agent Instrumentation - OpenTelemetry spans for agent lifecycle
3
+ *
4
+ * Provides comprehensive tracing for all 18 QE agents with semantic attributes
5
+ * following OpenTelemetry conventions. Automatically instruments agent lifecycle
6
+ * events: spawn, execute, complete, error.
7
+ *
8
+ * @module telemetry/instrumentation/agent
9
+ */
10
+ import { Span, Context } from '@opentelemetry/api';
11
+ import { AgentId, AgentStatus, QETask, AgentCapability } from '../../types';
12
+ /**
13
+ * Agent span configuration
14
+ */
15
+ export interface AgentSpanConfig {
16
+ /** Agent identifier */
17
+ agentId: AgentId;
18
+ /** Agent capabilities */
19
+ capabilities?: AgentCapability[];
20
+ /** Fleet identifier */
21
+ fleetId?: string;
22
+ /** Fleet topology */
23
+ topology?: string;
24
+ /** Parent span context */
25
+ parentContext?: Context;
26
+ }
27
+ /**
28
+ * Task execution span configuration
29
+ */
30
+ export interface TaskSpanConfig {
31
+ /** Task to execute */
32
+ task: QETask;
33
+ /** Agent executing the task */
34
+ agentId: AgentId;
35
+ /** Parent span context */
36
+ parentContext?: Context;
37
+ }
38
+ /**
39
+ * Agent lifecycle span manager
40
+ *
41
+ * Manages OpenTelemetry spans for agent operations with automatic
42
+ * context propagation and semantic attribute attachment.
43
+ */
44
+ export declare class AgentSpanManager {
45
+ private readonly tracer;
46
+ private activeSpans;
47
+ private spanCleanupTimeouts?;
48
+ /**
49
+ * Start agent spawn span
50
+ *
51
+ * Records agent creation with full metadata including capabilities,
52
+ * fleet topology, and resource allocation.
53
+ *
54
+ * @param config - Agent span configuration
55
+ * @returns Active span
56
+ */
57
+ startSpawnSpan(config: AgentSpanConfig): Span;
58
+ /**
59
+ * Complete agent spawn span
60
+ *
61
+ * @param agentId - Agent identifier
62
+ * @param success - Whether spawn was successful
63
+ * @param error - Error if spawn failed
64
+ */
65
+ completeSpawnSpan(agentId: AgentId, success: boolean, error?: Error): void;
66
+ /**
67
+ * Start agent execution span
68
+ *
69
+ * Records agent task execution with semantic attributes for task type,
70
+ * priority, and execution strategy.
71
+ *
72
+ * @param config - Task span configuration
73
+ * @returns Active span with context
74
+ */
75
+ startExecutionSpan(config: TaskSpanConfig): {
76
+ span: Span;
77
+ context: Context;
78
+ };
79
+ /**
80
+ * Complete agent execution span
81
+ *
82
+ * @param agentId - Agent identifier
83
+ * @param taskId - Task identifier
84
+ * @param success - Whether execution was successful
85
+ * @param result - Task execution result
86
+ * @param error - Error if execution failed
87
+ */
88
+ completeExecutionSpan(agentId: AgentId, taskId: string, success: boolean, result?: any, error?: Error): void;
89
+ /**
90
+ * Record agent status change
91
+ *
92
+ * @param agentId - Agent identifier
93
+ * @param oldStatus - Previous status
94
+ * @param newStatus - New status
95
+ */
96
+ recordStatusChange(agentId: AgentId, oldStatus: AgentStatus, newStatus: AgentStatus): void;
97
+ /**
98
+ * Record agent error
99
+ *
100
+ * @param agentId - Agent identifier
101
+ * @param error - Error that occurred
102
+ * @param context - Additional context
103
+ */
104
+ recordError(agentId: AgentId, error: Error, context?: Record<string, any>): void;
105
+ /**
106
+ * Start specialized agent operation span
107
+ *
108
+ * For agent-specific operations like test generation, coverage analysis, etc.
109
+ *
110
+ * @param operationName - Operation name (e.g., 'generate_tests', 'analyze_coverage')
111
+ * @param agentId - Agent identifier
112
+ * @param attributes - Additional attributes
113
+ * @returns Active span
114
+ */
115
+ startOperationSpan(operationName: string, agentId: AgentId, attributes?: Record<string, any>): Span;
116
+ /**
117
+ * Complete specialized operation span
118
+ *
119
+ * @param operationName - Operation name
120
+ * @param agentId - Agent identifier
121
+ * @param success - Whether operation was successful
122
+ * @param error - Error if operation failed
123
+ */
124
+ completeOperationSpan(operationName: string, agentId: AgentId, success: boolean, error?: Error): void;
125
+ /**
126
+ * Cleanup all active spans (for graceful shutdown)
127
+ */
128
+ cleanup(): void;
129
+ /**
130
+ * Build agent semantic attributes
131
+ */
132
+ private buildAgentAttributes;
133
+ /**
134
+ * Build task semantic attributes
135
+ */
136
+ private buildTaskAttributes;
137
+ }
138
+ /**
139
+ * Global agent span manager instance
140
+ */
141
+ export declare const agentSpanManager: AgentSpanManager;
142
+ /**
143
+ * Decorator for automatically instrumenting agent methods
144
+ *
145
+ * @param operationName - Operation name for the span
146
+ */
147
+ export declare function InstrumentAgent(operationName: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
148
+ /**
149
+ * Execute function within agent span context
150
+ *
151
+ * @param operationName - Operation name
152
+ * @param agentId - Agent identifier
153
+ * @param fn - Function to execute
154
+ * @param attributes - Additional span attributes
155
+ * @returns Function result
156
+ */
157
+ export declare function withAgentSpan<T>(operationName: string, agentId: AgentId, fn: () => Promise<T>, attributes?: Record<string, any>): Promise<T>;
158
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/telemetry/instrumentation/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAkC,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGnF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACr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B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,EAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,IAAI;IAcP;;;;;;;OAOG;IACH,qBAAqB,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,KAAK,CAAC,EAAE,KAAK,GACZ,IAAI;IAwBP;;OAEG;IACH,OAAO,IAAI,IAAI;IAYf;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAsB5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAS5B;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,kBAAyB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,IAEjD,QAAQ,GAAG,EACX,aAAa,MAAM,EACnB,YAAY,kBAAkB,wBAyBjC;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,OAAO,CAAC,CAAC,CAAC,CAoBZ"}
@@ -0,0 +1,372 @@
1
+ "use strict";
2
+ /**
3
+ * Agent Instrumentation - OpenTelemetry spans for agent lifecycle
4
+ *
5
+ * Provides comprehensive tracing for all 18 QE agents with semantic attributes
6
+ * following OpenTelemetry conventions. Automatically instruments agent lifecycle
7
+ * events: spawn, execute, complete, error.
8
+ *
9
+ * @module telemetry/instrumentation/agent
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.agentSpanManager = exports.AgentSpanManager = void 0;
13
+ exports.InstrumentAgent = InstrumentAgent;
14
+ exports.withAgentSpan = withAgentSpan;
15
+ const api_1 = require("@opentelemetry/api");
16
+ const bootstrap_1 = require("../bootstrap");
17
+ const types_1 = require("../types");
18
+ /**
19
+ * Agent lifecycle span manager
20
+ *
21
+ * Manages OpenTelemetry spans for agent operations with automatic
22
+ * context propagation and semantic attribute attachment.
23
+ */
24
+ class AgentSpanManager {
25
+ constructor() {
26
+ this.tracer = (0, bootstrap_1.getTracer)();
27
+ this.activeSpans = new Map();
28
+ }
29
+ /**
30
+ * Start agent spawn span
31
+ *
32
+ * Records agent creation with full metadata including capabilities,
33
+ * fleet topology, and resource allocation.
34
+ *
35
+ * @param config - Agent span configuration
36
+ * @returns Active span
37
+ */
38
+ startSpawnSpan(config) {
39
+ const { agentId, capabilities, fleetId, topology, parentContext } = config;
40
+ const spanContext = parentContext || api_1.context.active();
41
+ const span = this.tracer.startSpan(types_1.SPAN_NAMES.FLEET_SPAWN_AGENT, {
42
+ attributes: this.buildAgentAttributes(agentId, fleetId, topology),
43
+ }, spanContext);
44
+ // Add capability attributes
45
+ if (capabilities && capabilities.length > 0) {
46
+ span.setAttribute('agent.capabilities.count', capabilities.length);
47
+ span.setAttribute('agent.capabilities.names', capabilities.map(c => c.name).join(','));
48
+ }
49
+ // Store span for lifecycle tracking
50
+ this.activeSpans.set(`spawn:${agentId.id}`, span);
51
+ span.addEvent('agent.spawn.started', {
52
+ 'agent.id': agentId.id,
53
+ 'agent.type': agentId.type,
54
+ });
55
+ return span;
56
+ }
57
+ /**
58
+ * Complete agent spawn span
59
+ *
60
+ * @param agentId - Agent identifier
61
+ * @param success - Whether spawn was successful
62
+ * @param error - Error if spawn failed
63
+ */
64
+ completeSpawnSpan(agentId, success, error) {
65
+ const spanKey = `spawn:${agentId.id}`;
66
+ const span = this.activeSpans.get(spanKey);
67
+ if (!span) {
68
+ console.warn(`[AgentSpanManager] No spawn span found for agent ${agentId.id}`);
69
+ return;
70
+ }
71
+ if (success) {
72
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
73
+ span.addEvent('agent.spawn.completed', {
74
+ 'agent.id': agentId.id,
75
+ });
76
+ }
77
+ else {
78
+ span.setStatus({
79
+ code: api_1.SpanStatusCode.ERROR,
80
+ message: error?.message || 'Agent spawn failed',
81
+ });
82
+ if (error) {
83
+ span.recordException(error);
84
+ }
85
+ span.addEvent('agent.spawn.failed', {
86
+ 'agent.id': agentId.id,
87
+ 'error.message': error?.message || 'Unknown error',
88
+ });
89
+ }
90
+ span.end();
91
+ this.activeSpans.delete(spanKey);
92
+ }
93
+ /**
94
+ * Start agent execution span
95
+ *
96
+ * Records agent task execution with semantic attributes for task type,
97
+ * priority, and execution strategy.
98
+ *
99
+ * @param config - Task span configuration
100
+ * @returns Active span with context
101
+ */
102
+ startExecutionSpan(config) {
103
+ const { task, agentId, parentContext } = config;
104
+ const spanContext = parentContext || api_1.context.active();
105
+ const span = this.tracer.startSpan(types_1.SPAN_NAMES.AGENT_EXECUTE_TASK, {
106
+ attributes: {
107
+ ...this.buildAgentAttributes(agentId),
108
+ ...this.buildTaskAttributes(task),
109
+ },
110
+ }, spanContext);
111
+ // Store span for lifecycle tracking
112
+ const spanKey = `execute:${agentId.id}:${task.id}`;
113
+ this.activeSpans.set(spanKey, span);
114
+ // Auto-cleanup orphaned span after 5 minutes
115
+ const cleanupTimeout = setTimeout(() => {
116
+ if (this.activeSpans.has(spanKey)) {
117
+ console.warn(`[AgentSpanManager] Auto-cleaning orphaned span: ${spanKey}`);
118
+ this.completeExecutionSpan(agentId, task.id, false, undefined, new Error('Span timeout - auto-cleanup after 5 minutes'));
119
+ }
120
+ }, 300000); // 5 minutes
121
+ // Store cleanup timeout for cancellation
122
+ if (!this.spanCleanupTimeouts) {
123
+ this.spanCleanupTimeouts = new Map();
124
+ }
125
+ this.spanCleanupTimeouts.set(spanKey, cleanupTimeout);
126
+ span.addEvent('agent.task.started', {
127
+ 'task.id': task.id,
128
+ 'task.type': task.type,
129
+ 'agent.id': agentId.id,
130
+ });
131
+ // Create context with active span
132
+ const spanContext2 = api_1.trace.setSpan(api_1.context.active(), span);
133
+ return { span, context: spanContext2 };
134
+ }
135
+ /**
136
+ * Complete agent execution span
137
+ *
138
+ * @param agentId - Agent identifier
139
+ * @param taskId - Task identifier
140
+ * @param success - Whether execution was successful
141
+ * @param result - Task execution result
142
+ * @param error - Error if execution failed
143
+ */
144
+ completeExecutionSpan(agentId, taskId, success, result, error) {
145
+ const spanKey = `execute:${agentId.id}:${taskId}`;
146
+ const span = this.activeSpans.get(spanKey);
147
+ if (!span) {
148
+ console.warn(`[AgentSpanManager] No execution span found for task ${taskId}`);
149
+ return;
150
+ }
151
+ // Cancel auto-cleanup timeout
152
+ if (this.spanCleanupTimeouts?.has(spanKey)) {
153
+ clearTimeout(this.spanCleanupTimeouts.get(spanKey));
154
+ this.spanCleanupTimeouts.delete(spanKey);
155
+ }
156
+ // Add result metrics if available
157
+ if (result) {
158
+ if (typeof result.executionTime === 'number') {
159
+ span.setAttribute('task.execution_time_ms', result.executionTime);
160
+ }
161
+ if (typeof result.tokensUsed === 'number') {
162
+ span.setAttribute('task.tokens_used', result.tokensUsed);
163
+ }
164
+ if (typeof result.cost === 'number') {
165
+ span.setAttribute('task.cost_usd', result.cost);
166
+ }
167
+ }
168
+ if (success) {
169
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
170
+ span.addEvent('agent.task.completed', {
171
+ 'task.id': taskId,
172
+ 'agent.id': agentId.id,
173
+ });
174
+ }
175
+ else {
176
+ span.setStatus({
177
+ code: api_1.SpanStatusCode.ERROR,
178
+ message: error?.message || 'Task execution failed',
179
+ });
180
+ if (error) {
181
+ span.recordException(error);
182
+ }
183
+ span.addEvent('agent.task.failed', {
184
+ 'task.id': taskId,
185
+ 'agent.id': agentId.id,
186
+ 'error.message': error?.message || 'Unknown error',
187
+ });
188
+ }
189
+ span.end();
190
+ this.activeSpans.delete(spanKey);
191
+ }
192
+ /**
193
+ * Record agent status change
194
+ *
195
+ * @param agentId - Agent identifier
196
+ * @param oldStatus - Previous status
197
+ * @param newStatus - New status
198
+ */
199
+ recordStatusChange(agentId, oldStatus, newStatus) {
200
+ const span = api_1.trace.getActiveSpan();
201
+ if (span) {
202
+ span.addEvent('agent.status.changed', {
203
+ 'agent.id': agentId.id,
204
+ 'agent.status.old': oldStatus,
205
+ 'agent.status.new': newStatus,
206
+ });
207
+ }
208
+ }
209
+ /**
210
+ * Record agent error
211
+ *
212
+ * @param agentId - Agent identifier
213
+ * @param error - Error that occurred
214
+ * @param context - Additional context
215
+ */
216
+ recordError(agentId, error, context) {
217
+ const span = api_1.trace.getActiveSpan();
218
+ if (span) {
219
+ span.recordException(error);
220
+ span.addEvent('agent.error', {
221
+ 'agent.id': agentId.id,
222
+ 'error.message': error.message,
223
+ 'error.stack': error.stack,
224
+ ...context,
225
+ });
226
+ }
227
+ }
228
+ /**
229
+ * Start specialized agent operation span
230
+ *
231
+ * For agent-specific operations like test generation, coverage analysis, etc.
232
+ *
233
+ * @param operationName - Operation name (e.g., 'generate_tests', 'analyze_coverage')
234
+ * @param agentId - Agent identifier
235
+ * @param attributes - Additional attributes
236
+ * @returns Active span
237
+ */
238
+ startOperationSpan(operationName, agentId, attributes) {
239
+ const spanName = `aqe.agent.${operationName}`;
240
+ const span = this.tracer.startSpan(spanName, {
241
+ attributes: {
242
+ ...this.buildAgentAttributes(agentId),
243
+ ...attributes,
244
+ },
245
+ });
246
+ this.activeSpans.set(`operation:${agentId.id}:${operationName}`, span);
247
+ return span;
248
+ }
249
+ /**
250
+ * Complete specialized operation span
251
+ *
252
+ * @param operationName - Operation name
253
+ * @param agentId - Agent identifier
254
+ * @param success - Whether operation was successful
255
+ * @param error - Error if operation failed
256
+ */
257
+ completeOperationSpan(operationName, agentId, success, error) {
258
+ const spanKey = `operation:${agentId.id}:${operationName}`;
259
+ const span = this.activeSpans.get(spanKey);
260
+ if (!span) {
261
+ return;
262
+ }
263
+ if (success) {
264
+ span.setStatus({ code: api_1.SpanStatusCode.OK });
265
+ }
266
+ else {
267
+ span.setStatus({
268
+ code: api_1.SpanStatusCode.ERROR,
269
+ message: error?.message || 'Operation failed',
270
+ });
271
+ if (error) {
272
+ span.recordException(error);
273
+ }
274
+ }
275
+ span.end();
276
+ this.activeSpans.delete(spanKey);
277
+ }
278
+ /**
279
+ * Cleanup all active spans (for graceful shutdown)
280
+ */
281
+ cleanup() {
282
+ for (const [key, span] of this.activeSpans.entries()) {
283
+ console.warn(`[AgentSpanManager] Force-ending orphaned span: ${key}`);
284
+ span.setStatus({
285
+ code: api_1.SpanStatusCode.ERROR,
286
+ message: 'Span ended during cleanup',
287
+ });
288
+ span.end();
289
+ }
290
+ this.activeSpans.clear();
291
+ }
292
+ /**
293
+ * Build agent semantic attributes
294
+ */
295
+ buildAgentAttributes(agentId, fleetId, topology) {
296
+ const attrs = {
297
+ 'agent.id': agentId.id,
298
+ 'agent.type': agentId.type,
299
+ 'agent.name': agentId.id,
300
+ };
301
+ if (fleetId) {
302
+ attrs['fleet.id'] = fleetId;
303
+ }
304
+ if (topology) {
305
+ attrs['fleet.topology'] = topology;
306
+ }
307
+ return attrs;
308
+ }
309
+ /**
310
+ * Build task semantic attributes
311
+ */
312
+ buildTaskAttributes(task) {
313
+ return {
314
+ 'task.id': task.id,
315
+ 'task.type': task.type,
316
+ 'task.status': task.status,
317
+ 'task.priority': task.priority,
318
+ 'task.parent_id': task.parentId || '',
319
+ };
320
+ }
321
+ }
322
+ exports.AgentSpanManager = AgentSpanManager;
323
+ /**
324
+ * Global agent span manager instance
325
+ */
326
+ exports.agentSpanManager = new AgentSpanManager();
327
+ /**
328
+ * Decorator for automatically instrumenting agent methods
329
+ *
330
+ * @param operationName - Operation name for the span
331
+ */
332
+ function InstrumentAgent(operationName) {
333
+ return function (target, propertyKey, descriptor) {
334
+ const originalMethod = descriptor.value;
335
+ descriptor.value = async function (...args) {
336
+ const agentId = this.agentId;
337
+ const span = exports.agentSpanManager.startOperationSpan(operationName, agentId);
338
+ try {
339
+ const result = await originalMethod.apply(this, args);
340
+ exports.agentSpanManager.completeOperationSpan(operationName, agentId, true);
341
+ return result;
342
+ }
343
+ catch (error) {
344
+ exports.agentSpanManager.completeOperationSpan(operationName, agentId, false, error);
345
+ throw error;
346
+ }
347
+ };
348
+ return descriptor;
349
+ };
350
+ }
351
+ /**
352
+ * Execute function within agent span context
353
+ *
354
+ * @param operationName - Operation name
355
+ * @param agentId - Agent identifier
356
+ * @param fn - Function to execute
357
+ * @param attributes - Additional span attributes
358
+ * @returns Function result
359
+ */
360
+ async function withAgentSpan(operationName, agentId, fn, attributes) {
361
+ const span = exports.agentSpanManager.startOperationSpan(operationName, agentId, attributes);
362
+ try {
363
+ const result = await fn();
364
+ exports.agentSpanManager.completeOperationSpan(operationName, agentId, true);
365
+ return result;
366
+ }
367
+ catch (error) {
368
+ exports.agentSpanManager.completeOperationSpan(operationName, agentId, false, error);
369
+ throw error;
370
+ }
371
+ }
372
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/telemetry/instrumentation/agent.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA2aH,0CA6BC;AAWD,sCAyBC;AA1eD,4CAAmF;AACnF,4CAAyC;AACzC,oCAAqF;AA+BrF;;;;;GAKG;AACH,MAAa,gBAAgB;IAA7B;QACmB,WAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;QAC9B,gBAAW,GAAG,IAAI,GAAG,EAAgB,CAAC;IAoXhD,CAAC;IAjXC;;;;;;;;OAQG;IACH,cAAc,CAAC,MAAuB;QACpC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;QAE3E,MAAM,WAAW,GAAG,aAAa,IAAI,aAAO,CAAC,MAAM,EAAE,CAAC;QACtD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAChC,kBAAU,CAAC,iBAAiB,EAC5B;YACE,UAAU,EAAE,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAQ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AG,wBAAgB,CAAC,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;YAEzE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACtD,wBAAgB,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;gBACrE,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,wBAAgB,CAAC,qBAAqB,CACpC,aAAa,EACb,OAAO,EACP,KAAK,EACL,KAAc,CACf,CAAC;gBACF,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CACjC,aAAqB,EACrB,OAAgB,EAChB,EAAoB,EACpB,UAAgC;IAEhC,MAAM,IAAI,GAAG,wBAAgB,CAAC,kBAAkB,CAC9C,aAAa,EACb,OAAO,EACP,UAAU,CACX,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,wBAAgB,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,wBAAgB,CAAC,qBAAqB,CACpC,aAAa,EACb,OAAO,EACP,KAAK,EACL,KAAc,CACf,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Telemetry Instrumentation - Agent and Task Tracing
3
+ *
4
+ * Comprehensive OpenTelemetry instrumentation for all 18 QE agents
5
+ * with automatic span management, context propagation, and semantic attributes.
6
+ *
7
+ * @module telemetry/instrumentation
8
+ */
9
+ export { AgentSpanManager, agentSpanManager, AgentSpanConfig, TaskSpanConfig, InstrumentAgent, withAgentSpan, } from './agent';
10
+ export { TaskSpanManager, taskSpanManager, TaskSpanConfig as TaskExecutionSpanConfig, TaskResult, withTaskSpan, } from './task';
11
+ export { MemorySpanManager, memorySpanManager, MemoryStoreConfig, MemoryRetrieveConfig, MemorySearchConfig, MemoryDeleteConfig, MemoryStoreResult, MemoryRetrieveResult, MemorySearchResult, MemoryDeleteResult, withMemoryStore, withMemoryRetrieve, withMemorySearch, withMemoryDelete, } from './memory';
12
+ /**
13
+ * Initialize all instrumentation managers
14
+ *
15
+ * Call this during application startup to ensure proper cleanup on shutdown.
16
+ */
17
+ export declare function initializeInstrumentation(): void;
18
+ /**
19
+ * Cleanup all active instrumentation spans
20
+ *
21
+ * Ensures all spans are properly ended during graceful shutdown.
22
+ */
23
+ export declare function cleanupInstrumentation(): void;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/telemetry/instrumentation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,eAAe,EACf,eAAe,EACf,cAAc,IAAI,uBAAuB,EACzC,UAAU,EACV,YAAY,GACb,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAKhD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAQ7C"}