@bluefly/openstandardagents 0.4.3 → 0.4.5

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 (1526) hide show
  1. package/.version.json +3 -3
  2. package/CHANGELOG.md +770 -0
  3. package/README.md +497 -360
  4. package/bin/ossa +3 -0
  5. package/dist/.version.json +7 -0
  6. package/dist/adapters/a2a/__tests__/mcp-integration.spec.d.ts +5 -0
  7. package/dist/adapters/a2a/__tests__/mcp-integration.spec.d.ts.map +1 -0
  8. package/dist/adapters/a2a/__tests__/mcp-integration.spec.js +267 -0
  9. package/dist/adapters/a2a/__tests__/mcp-integration.spec.js.map +1 -0
  10. package/dist/adapters/a2a/__tests__/mcp-transport.spec.d.ts +5 -0
  11. package/dist/adapters/a2a/__tests__/mcp-transport.spec.d.ts.map +1 -0
  12. package/dist/adapters/a2a/__tests__/mcp-transport.spec.js +202 -0
  13. package/dist/adapters/a2a/__tests__/mcp-transport.spec.js.map +1 -0
  14. package/dist/adapters/a2a/a2a-protocol.d.ts +398 -0
  15. package/dist/adapters/a2a/a2a-protocol.d.ts.map +1 -0
  16. package/dist/adapters/a2a/a2a-protocol.js +257 -0
  17. package/dist/adapters/a2a/a2a-protocol.js.map +1 -0
  18. package/dist/adapters/a2a/a2a-tool.d.ts +110 -0
  19. package/dist/adapters/a2a/a2a-tool.d.ts.map +1 -0
  20. package/dist/adapters/a2a/a2a-tool.js +349 -0
  21. package/dist/adapters/a2a/a2a-tool.js.map +1 -0
  22. package/dist/adapters/a2a/agent-mesh.d.ts +195 -0
  23. package/dist/adapters/a2a/agent-mesh.d.ts.map +1 -0
  24. package/dist/adapters/a2a/agent-mesh.js +347 -0
  25. package/dist/adapters/a2a/agent-mesh.js.map +1 -0
  26. package/dist/adapters/a2a/delegation.d.ts +232 -0
  27. package/dist/adapters/a2a/delegation.d.ts.map +1 -0
  28. package/dist/adapters/a2a/delegation.js +236 -0
  29. package/dist/adapters/a2a/delegation.js.map +1 -0
  30. package/dist/adapters/a2a/index.d.ts +18 -0
  31. package/dist/adapters/a2a/index.d.ts.map +1 -0
  32. package/dist/adapters/a2a/index.js +24 -0
  33. package/dist/adapters/a2a/index.js.map +1 -0
  34. package/dist/adapters/a2a/mcp-integration.d.ts +258 -0
  35. package/dist/adapters/a2a/mcp-integration.d.ts.map +1 -0
  36. package/dist/adapters/a2a/mcp-integration.js +328 -0
  37. package/dist/adapters/a2a/mcp-integration.js.map +1 -0
  38. package/dist/adapters/a2a/mcp-transport.d.ts +118 -0
  39. package/dist/adapters/a2a/mcp-transport.d.ts.map +1 -0
  40. package/dist/adapters/a2a/mcp-transport.js +287 -0
  41. package/dist/adapters/a2a/mcp-transport.js.map +1 -0
  42. package/dist/adapters/a2a/swarm-orchestration.d.ts +278 -0
  43. package/dist/adapters/a2a/swarm-orchestration.d.ts.map +1 -0
  44. package/dist/adapters/a2a/swarm-orchestration.js +322 -0
  45. package/dist/adapters/a2a/swarm-orchestration.js.map +1 -0
  46. package/dist/adapters/agent-skills/exporter.d.ts +98 -0
  47. package/dist/adapters/agent-skills/exporter.d.ts.map +1 -0
  48. package/dist/adapters/agent-skills/exporter.js +460 -0
  49. package/dist/adapters/agent-skills/exporter.js.map +1 -0
  50. package/dist/adapters/agent-skills/index.d.ts +7 -0
  51. package/dist/adapters/agent-skills/index.d.ts.map +1 -0
  52. package/dist/adapters/agent-skills/index.js +6 -0
  53. package/dist/adapters/agent-skills/index.js.map +1 -0
  54. package/dist/adapters/anthropic/claude-optimizations.d.ts +44 -0
  55. package/dist/adapters/anthropic/claude-optimizations.d.ts.map +1 -0
  56. package/dist/adapters/anthropic/claude-optimizations.js +187 -0
  57. package/dist/adapters/anthropic/claude-optimizations.js.map +1 -0
  58. package/dist/adapters/anthropic/client.d.ts +33 -121
  59. package/dist/adapters/anthropic/client.d.ts.map +1 -1
  60. package/dist/adapters/anthropic/client.js +67 -334
  61. package/dist/adapters/anthropic/client.js.map +1 -1
  62. package/dist/adapters/anthropic/index.d.ts +4 -25
  63. package/dist/adapters/anthropic/index.d.ts.map +1 -1
  64. package/dist/adapters/anthropic/index.js +5 -25
  65. package/dist/adapters/anthropic/index.js.map +1 -1
  66. package/dist/adapters/anthropic/messages.d.ts +3 -3
  67. package/dist/adapters/anthropic/messages.d.ts.map +1 -1
  68. package/dist/adapters/anthropic/messages.js +60 -99
  69. package/dist/adapters/anthropic/messages.js.map +1 -1
  70. package/dist/adapters/anthropic/tools.d.ts +0 -15
  71. package/dist/adapters/anthropic/tools.d.ts.map +1 -1
  72. package/dist/adapters/anthropic/tools.js +20 -84
  73. package/dist/adapters/anthropic/tools.js.map +1 -1
  74. package/dist/adapters/base/adapter.interface.d.ts +67 -2
  75. package/dist/adapters/base/adapter.interface.d.ts.map +1 -1
  76. package/dist/adapters/base/adapter.interface.js +41 -0
  77. package/dist/adapters/base/adapter.interface.js.map +1 -1
  78. package/dist/adapters/base/base-exporter.d.ts +108 -0
  79. package/dist/adapters/base/base-exporter.d.ts.map +1 -0
  80. package/dist/adapters/base/base-exporter.js +165 -0
  81. package/dist/adapters/base/base-exporter.js.map +1 -0
  82. package/dist/adapters/base/common-file-generator.d.ts +217 -0
  83. package/dist/adapters/base/common-file-generator.d.ts.map +1 -0
  84. package/dist/adapters/base/common-file-generator.js +682 -0
  85. package/dist/adapters/base/common-file-generator.js.map +1 -0
  86. package/dist/adapters/base/index.d.ts +23 -0
  87. package/dist/adapters/base/index.d.ts.map +1 -0
  88. package/dist/adapters/base/index.js +29 -0
  89. package/dist/adapters/base/index.js.map +1 -0
  90. package/dist/adapters/base/manifest-validator.d.ts +84 -0
  91. package/dist/adapters/base/manifest-validator.d.ts.map +1 -0
  92. package/dist/adapters/base/manifest-validator.js +266 -0
  93. package/dist/adapters/base/manifest-validator.js.map +1 -0
  94. package/dist/adapters/base/perfect-agent-utils.d.ts +29 -0
  95. package/dist/adapters/base/perfect-agent-utils.d.ts.map +1 -0
  96. package/dist/adapters/base/perfect-agent-utils.js +234 -0
  97. package/dist/adapters/base/perfect-agent-utils.js.map +1 -0
  98. package/dist/adapters/base/template-engine.d.ts +52 -0
  99. package/dist/adapters/base/template-engine.d.ts.map +1 -0
  100. package/dist/adapters/base/template-engine.js +157 -0
  101. package/dist/adapters/base/template-engine.js.map +1 -0
  102. package/dist/adapters/base/tool-params.d.ts +42 -0
  103. package/dist/adapters/base/tool-params.d.ts.map +1 -0
  104. package/dist/adapters/base/tool-params.js +123 -0
  105. package/dist/adapters/base/tool-params.js.map +1 -0
  106. package/dist/adapters/claude-code/adapter.d.ts +64 -0
  107. package/dist/adapters/claude-code/adapter.d.ts.map +1 -0
  108. package/dist/adapters/claude-code/adapter.js +336 -0
  109. package/dist/adapters/claude-code/adapter.js.map +1 -0
  110. package/dist/adapters/claude-code/types.d.ts +154 -0
  111. package/dist/adapters/claude-code/types.d.ts.map +1 -0
  112. package/dist/adapters/claude-code/types.js +6 -0
  113. package/dist/adapters/claude-code/types.js.map +1 -0
  114. package/dist/adapters/crewai/adapter.d.ts +54 -1
  115. package/dist/adapters/crewai/adapter.d.ts.map +1 -1
  116. package/dist/adapters/crewai/adapter.js +1494 -41
  117. package/dist/adapters/crewai/adapter.js.map +1 -1
  118. package/dist/adapters/crewai/converter.d.ts +8 -0
  119. package/dist/adapters/crewai/converter.d.ts.map +1 -1
  120. package/dist/adapters/crewai/converter.js +56 -25
  121. package/dist/adapters/crewai/converter.js.map +1 -1
  122. package/dist/adapters/cursor/adapter.d.ts +75 -0
  123. package/dist/adapters/cursor/adapter.d.ts.map +1 -0
  124. package/dist/adapters/cursor/adapter.js +474 -0
  125. package/dist/adapters/cursor/adapter.js.map +1 -0
  126. package/dist/adapters/cursor/types.d.ts +221 -0
  127. package/dist/adapters/cursor/types.d.ts.map +1 -0
  128. package/dist/adapters/cursor/types.js +6 -0
  129. package/dist/adapters/cursor/types.js.map +1 -0
  130. package/dist/adapters/docker/docker-exporter.d.ts +38 -0
  131. package/dist/adapters/docker/docker-exporter.d.ts.map +1 -0
  132. package/dist/adapters/docker/docker-exporter.js +648 -0
  133. package/dist/adapters/docker/docker-exporter.js.map +1 -0
  134. package/dist/adapters/docker/generators.d.ts +73 -7
  135. package/dist/adapters/docker/generators.d.ts.map +1 -1
  136. package/dist/adapters/docker/generators.js +733 -43
  137. package/dist/adapters/docker/generators.js.map +1 -1
  138. package/dist/adapters/docker/index.d.ts +4 -3
  139. package/dist/adapters/docker/index.d.ts.map +1 -1
  140. package/dist/adapters/docker/index.js +3 -2
  141. package/dist/adapters/docker/index.js.map +1 -1
  142. package/dist/adapters/docker/types.d.ts +70 -0
  143. package/dist/adapters/docker/types.d.ts.map +1 -1
  144. package/dist/adapters/drupal/adapter.d.ts +1 -0
  145. package/dist/adapters/drupal/adapter.d.ts.map +1 -1
  146. package/dist/adapters/drupal/adapter.js +5 -2
  147. package/dist/adapters/drupal/adapter.js.map +1 -1
  148. package/dist/adapters/drupal/generator.d.ts +1 -0
  149. package/dist/adapters/drupal/generator.d.ts.map +1 -1
  150. package/dist/adapters/drupal/generator.js +17 -9
  151. package/dist/adapters/drupal/generator.js.map +1 -1
  152. package/dist/adapters/drupal/index.d.ts +2 -1
  153. package/dist/adapters/drupal/index.d.ts.map +1 -1
  154. package/dist/adapters/drupal/index.js +3 -1
  155. package/dist/adapters/drupal/index.js.map +1 -1
  156. package/dist/adapters/drupal/manifest-exporter.d.ts +87 -0
  157. package/dist/adapters/drupal/manifest-exporter.d.ts.map +1 -0
  158. package/dist/adapters/drupal/manifest-exporter.js +406 -0
  159. package/dist/adapters/drupal/manifest-exporter.js.map +1 -0
  160. package/dist/adapters/gitlab/agent-generator.d.ts +103 -0
  161. package/dist/adapters/gitlab/agent-generator.d.ts.map +1 -0
  162. package/dist/adapters/gitlab/agent-generator.js +898 -0
  163. package/dist/adapters/gitlab/agent-generator.js.map +1 -0
  164. package/dist/adapters/gitlab/converter.d.ts +12 -2
  165. package/dist/adapters/gitlab/converter.d.ts.map +1 -1
  166. package/dist/adapters/gitlab/converter.js +19 -2
  167. package/dist/adapters/gitlab/converter.js.map +1 -1
  168. package/dist/adapters/gitlab/external-agent-generator.d.ts +70 -0
  169. package/dist/adapters/gitlab/external-agent-generator.d.ts.map +1 -0
  170. package/dist/adapters/gitlab/external-agent-generator.js +347 -0
  171. package/dist/adapters/gitlab/external-agent-generator.js.map +1 -0
  172. package/dist/adapters/gitlab/flow-generator.d.ts +73 -0
  173. package/dist/adapters/gitlab/flow-generator.d.ts.map +1 -0
  174. package/dist/adapters/gitlab/flow-generator.js +710 -0
  175. package/dist/adapters/gitlab/flow-generator.js.map +1 -0
  176. package/dist/adapters/gitlab/index.d.ts +10 -2
  177. package/dist/adapters/gitlab/index.d.ts.map +1 -1
  178. package/dist/adapters/gitlab/index.js +6 -1
  179. package/dist/adapters/gitlab/index.js.map +1 -1
  180. package/dist/adapters/gitlab/package-generator.d.ts +180 -0
  181. package/dist/adapters/gitlab/package-generator.d.ts.map +1 -0
  182. package/dist/adapters/gitlab/package-generator.js +2401 -0
  183. package/dist/adapters/gitlab/package-generator.js.map +1 -0
  184. package/dist/adapters/gitlab/router-generator.d.ts +113 -0
  185. package/dist/adapters/gitlab/router-generator.d.ts.map +1 -0
  186. package/dist/adapters/gitlab/router-generator.js +545 -0
  187. package/dist/adapters/gitlab/router-generator.js.map +1 -0
  188. package/dist/adapters/gitlab/trigger-generator.d.ts +154 -0
  189. package/dist/adapters/gitlab/trigger-generator.d.ts.map +1 -0
  190. package/dist/adapters/gitlab/trigger-generator.js +279 -0
  191. package/dist/adapters/gitlab/trigger-generator.js.map +1 -0
  192. package/dist/adapters/gitlab/types.d.ts +98 -0
  193. package/dist/adapters/gitlab/types.d.ts.map +1 -1
  194. package/dist/adapters/gitlab-duo/adapter.d.ts +1 -0
  195. package/dist/adapters/gitlab-duo/adapter.d.ts.map +1 -1
  196. package/dist/adapters/gitlab-duo/adapter.js +3 -0
  197. package/dist/adapters/gitlab-duo/adapter.js.map +1 -1
  198. package/dist/adapters/index.d.ts.map +1 -1
  199. package/dist/adapters/index.js +12 -0
  200. package/dist/adapters/index.js.map +1 -1
  201. package/dist/adapters/kubernetes/generator.d.ts +93 -5
  202. package/dist/adapters/kubernetes/generator.d.ts.map +1 -1
  203. package/dist/adapters/kubernetes/generator.js +1286 -33
  204. package/dist/adapters/kubernetes/generator.js.map +1 -1
  205. package/dist/adapters/kubernetes/index.d.ts +2 -2
  206. package/dist/adapters/kubernetes/index.d.ts.map +1 -1
  207. package/dist/adapters/kubernetes/index.js +1 -1
  208. package/dist/adapters/kubernetes/kagent-crd-generator.d.ts +72 -0
  209. package/dist/adapters/kubernetes/kagent-crd-generator.d.ts.map +1 -0
  210. package/dist/adapters/kubernetes/kagent-crd-generator.js +237 -0
  211. package/dist/adapters/kubernetes/kagent-crd-generator.js.map +1 -0
  212. package/dist/adapters/kubernetes/types.d.ts +45 -0
  213. package/dist/adapters/kubernetes/types.d.ts.map +1 -1
  214. package/dist/adapters/langchain/adapter.d.ts +2 -9
  215. package/dist/adapters/langchain/adapter.d.ts.map +1 -1
  216. package/dist/adapters/langchain/adapter.js +38 -131
  217. package/dist/adapters/langchain/adapter.js.map +1 -1
  218. package/dist/adapters/langchain/converter.d.ts.map +1 -1
  219. package/dist/adapters/langchain/converter.js +17 -6
  220. package/dist/adapters/langchain/converter.js.map +1 -1
  221. package/dist/adapters/langfuse.adapter.d.ts +1 -1
  222. package/dist/adapters/langsmith.adapter.d.ts +1 -1
  223. package/dist/adapters/mcp/adapter.d.ts +12 -20
  224. package/dist/adapters/mcp/adapter.d.ts.map +1 -1
  225. package/dist/adapters/mcp/adapter.js +67 -213
  226. package/dist/adapters/mcp/adapter.js.map +1 -1
  227. package/dist/adapters/mcp/converter.d.ts +1 -0
  228. package/dist/adapters/mcp/converter.d.ts.map +1 -1
  229. package/dist/adapters/mcp/converter.js +5 -2
  230. package/dist/adapters/mcp/converter.js.map +1 -1
  231. package/dist/adapters/mobile-agent/adapter.d.ts +63 -0
  232. package/dist/adapters/mobile-agent/adapter.d.ts.map +1 -0
  233. package/dist/adapters/mobile-agent/adapter.js +678 -0
  234. package/dist/adapters/mobile-agent/adapter.js.map +1 -0
  235. package/dist/adapters/npm/adapter.d.ts +2 -5
  236. package/dist/adapters/npm/adapter.d.ts.map +1 -1
  237. package/dist/adapters/npm/adapter.js +49 -86
  238. package/dist/adapters/npm/adapter.js.map +1 -1
  239. package/dist/adapters/npm/converter.d.ts +6 -9
  240. package/dist/adapters/npm/converter.d.ts.map +1 -1
  241. package/dist/adapters/npm/converter.js +50 -83
  242. package/dist/adapters/npm/converter.js.map +1 -1
  243. package/dist/adapters/npm/package-generator.d.ts +93 -0
  244. package/dist/adapters/npm/package-generator.d.ts.map +1 -0
  245. package/dist/adapters/npm/package-generator.js +240 -0
  246. package/dist/adapters/npm/package-generator.js.map +1 -0
  247. package/dist/adapters/npm/type-aware-dependencies.d.ts +19 -0
  248. package/dist/adapters/npm/type-aware-dependencies.d.ts.map +1 -0
  249. package/dist/adapters/npm/type-aware-dependencies.js +160 -0
  250. package/dist/adapters/npm/type-aware-dependencies.js.map +1 -0
  251. package/dist/adapters/openai-agents/adapter.d.ts +31 -0
  252. package/dist/adapters/openai-agents/adapter.d.ts.map +1 -0
  253. package/dist/adapters/openai-agents/adapter.js +344 -0
  254. package/dist/adapters/openai-agents/adapter.js.map +1 -0
  255. package/dist/adapters/openai-agents/index.d.ts +10 -0
  256. package/dist/adapters/openai-agents/index.d.ts.map +1 -0
  257. package/dist/adapters/openai-agents/index.js +10 -0
  258. package/dist/adapters/openai-agents/index.js.map +1 -0
  259. package/dist/adapters/opentelemetry.adapter.d.ts +8 -2
  260. package/dist/adapters/opentelemetry.adapter.d.ts.map +1 -1
  261. package/dist/adapters/opentelemetry.adapter.js +92 -11
  262. package/dist/adapters/opentelemetry.adapter.js.map +1 -1
  263. package/dist/adapters/phoenix.adapter.d.ts +1 -1
  264. package/dist/adapters/registry/platform-registry.d.ts +1 -0
  265. package/dist/adapters/registry/platform-registry.d.ts.map +1 -1
  266. package/dist/adapters/registry/platform-registry.js +1 -0
  267. package/dist/adapters/registry/platform-registry.js.map +1 -1
  268. package/dist/adapters/warp/adapter.d.ts +52 -0
  269. package/dist/adapters/warp/adapter.d.ts.map +1 -0
  270. package/dist/adapters/warp/adapter.js +383 -0
  271. package/dist/adapters/warp/adapter.js.map +1 -0
  272. package/dist/adapters/warp/types.d.ts +140 -0
  273. package/dist/adapters/warp/types.d.ts.map +1 -0
  274. package/dist/adapters/warp/types.js +6 -0
  275. package/dist/adapters/warp/types.js.map +1 -0
  276. package/dist/bot/agent-compliance.js +1 -1
  277. package/dist/cli/banner.d.ts.map +1 -1
  278. package/dist/cli/banner.js +11 -4
  279. package/dist/cli/banner.js.map +1 -1
  280. package/dist/cli/commands/agent/discover-type.command.d.ts +39 -0
  281. package/dist/cli/commands/agent/discover-type.command.d.ts.map +1 -0
  282. package/dist/cli/commands/agent/discover-type.command.js +332 -0
  283. package/dist/cli/commands/agent/discover-type.command.js.map +1 -0
  284. package/dist/cli/commands/agent-card.command.d.ts +3 -9
  285. package/dist/cli/commands/agent-card.command.d.ts.map +1 -1
  286. package/dist/cli/commands/agent-card.command.js +109 -255
  287. package/dist/cli/commands/agent-card.command.js.map +1 -1
  288. package/dist/cli/commands/agent-wizard.command.d.ts.map +1 -1
  289. package/dist/cli/commands/agent-wizard.command.js +396 -1
  290. package/dist/cli/commands/agent-wizard.command.js.map +1 -1
  291. package/dist/cli/commands/agents/persona.command.d.ts +10 -0
  292. package/dist/cli/commands/agents/persona.command.d.ts.map +1 -0
  293. package/dist/cli/commands/agents/persona.command.js +519 -0
  294. package/dist/cli/commands/agents/persona.command.js.map +1 -0
  295. package/dist/cli/commands/agents-local.command.d.ts +10 -0
  296. package/dist/cli/commands/agents-local.command.d.ts.map +1 -0
  297. package/dist/cli/commands/agents-local.command.js +283 -0
  298. package/dist/cli/commands/agents-local.command.js.map +1 -0
  299. package/dist/cli/commands/agents-md.command.d.ts.map +1 -1
  300. package/dist/cli/commands/agents-md.command.js.map +1 -1
  301. package/dist/cli/commands/agents.command.d.ts +4 -4
  302. package/dist/cli/commands/agents.command.d.ts.map +1 -1
  303. package/dist/cli/commands/agents.command.js +9 -136
  304. package/dist/cli/commands/agents.command.js.map +1 -1
  305. package/dist/cli/commands/audit.d.ts.map +1 -1
  306. package/dist/cli/commands/audit.js +26 -9
  307. package/dist/cli/commands/audit.js.map +1 -1
  308. package/dist/cli/commands/build.command.d.ts.map +1 -1
  309. package/dist/cli/commands/build.command.js +8 -31
  310. package/dist/cli/commands/build.command.js.map +1 -1
  311. package/dist/cli/commands/capability/create.command.d.ts +7 -0
  312. package/dist/cli/commands/capability/create.command.d.ts.map +1 -0
  313. package/dist/cli/commands/capability/create.command.js +225 -0
  314. package/dist/cli/commands/capability/create.command.js.map +1 -0
  315. package/dist/cli/commands/capability/index.d.ts +7 -0
  316. package/dist/cli/commands/capability/index.d.ts.map +1 -0
  317. package/dist/cli/commands/capability/index.js +10 -0
  318. package/dist/cli/commands/capability/index.js.map +1 -0
  319. package/dist/cli/commands/catalog/index.d.ts +0 -4
  320. package/dist/cli/commands/catalog/index.d.ts.map +1 -1
  321. package/dist/cli/commands/catalog/index.js +0 -12
  322. package/dist/cli/commands/catalog/index.js.map +1 -1
  323. package/dist/cli/commands/catalog/schemas.d.ts +1 -1
  324. package/dist/cli/commands/deploy-enhanced.command.d.ts +15 -0
  325. package/dist/cli/commands/deploy-enhanced.command.d.ts.map +1 -0
  326. package/dist/cli/commands/deploy-enhanced.command.js +334 -0
  327. package/dist/cli/commands/deploy-enhanced.command.js.map +1 -0
  328. package/dist/cli/commands/deploy.command.d.ts.map +1 -1
  329. package/dist/cli/commands/deploy.command.js +4 -3
  330. package/dist/cli/commands/deploy.command.js.map +1 -1
  331. package/dist/cli/commands/deploy.d.ts.map +1 -1
  332. package/dist/cli/commands/deploy.js +6 -5
  333. package/dist/cli/commands/deploy.js.map +1 -1
  334. package/dist/cli/commands/discover.d.ts +15 -0
  335. package/dist/cli/commands/discover.d.ts.map +1 -0
  336. package/dist/cli/commands/discover.js +215 -0
  337. package/dist/cli/commands/discover.js.map +1 -0
  338. package/dist/cli/commands/estimate.command.js +1 -1
  339. package/dist/cli/commands/estimate.command.js.map +1 -1
  340. package/dist/cli/commands/export.command.d.ts.map +1 -1
  341. package/dist/cli/commands/export.command.js +567 -89
  342. package/dist/cli/commands/export.command.js.map +1 -1
  343. package/dist/cli/commands/framework.command.d.ts.map +1 -1
  344. package/dist/cli/commands/framework.command.js +2 -1
  345. package/dist/cli/commands/framework.command.js.map +1 -1
  346. package/dist/cli/commands/generate-gaid.command.d.ts +14 -0
  347. package/dist/cli/commands/generate-gaid.command.d.ts.map +1 -0
  348. package/dist/cli/commands/generate-gaid.command.js +141 -0
  349. package/dist/cli/commands/generate-gaid.command.js.map +1 -0
  350. package/dist/cli/commands/governance.command.d.ts +11 -0
  351. package/dist/cli/commands/governance.command.d.ts.map +1 -0
  352. package/dist/cli/commands/governance.command.js +166 -0
  353. package/dist/cli/commands/governance.command.js.map +1 -0
  354. package/dist/cli/commands/import.command.d.ts.map +1 -1
  355. package/dist/cli/commands/import.command.js +11 -0
  356. package/dist/cli/commands/import.command.js.map +1 -1
  357. package/dist/cli/commands/init.command.d.ts.map +1 -1
  358. package/dist/cli/commands/init.command.js +23 -14
  359. package/dist/cli/commands/init.command.js.map +1 -1
  360. package/dist/cli/commands/lint.command.js +3 -1
  361. package/dist/cli/commands/lint.command.js.map +1 -1
  362. package/dist/cli/commands/manifest/diff.command.d.ts +7 -0
  363. package/dist/cli/commands/manifest/diff.command.d.ts.map +1 -0
  364. package/dist/cli/commands/manifest/diff.command.js +186 -0
  365. package/dist/cli/commands/manifest/diff.command.js.map +1 -0
  366. package/dist/cli/commands/manifest/explain.command.d.ts +7 -0
  367. package/dist/cli/commands/manifest/explain.command.d.ts.map +1 -0
  368. package/dist/cli/commands/manifest/explain.command.js +193 -0
  369. package/dist/cli/commands/manifest/explain.command.js.map +1 -0
  370. package/dist/cli/commands/manifest/index.d.ts +7 -0
  371. package/dist/cli/commands/manifest/index.d.ts.map +1 -0
  372. package/dist/cli/commands/manifest/index.js +12 -0
  373. package/dist/cli/commands/manifest/index.js.map +1 -0
  374. package/dist/cli/commands/migrate-langchain.command.js +3 -3
  375. package/dist/cli/commands/migrate-langchain.command.js.map +1 -1
  376. package/dist/cli/commands/migrate.command.d.ts +4 -1
  377. package/dist/cli/commands/migrate.command.d.ts.map +1 -1
  378. package/dist/cli/commands/migrate.command.js +56 -81
  379. package/dist/cli/commands/migrate.command.js.map +1 -1
  380. package/dist/cli/commands/publish.command.d.ts.map +1 -1
  381. package/dist/cli/commands/publish.command.js.map +1 -1
  382. package/dist/cli/commands/quickstart.command.d.ts.map +1 -1
  383. package/dist/cli/commands/quickstart.command.js +32 -49
  384. package/dist/cli/commands/quickstart.command.js.map +1 -1
  385. package/dist/cli/commands/register.d.ts +12 -0
  386. package/dist/cli/commands/register.d.ts.map +1 -0
  387. package/dist/cli/commands/register.js +200 -0
  388. package/dist/cli/commands/register.js.map +1 -0
  389. package/dist/cli/commands/rollback.command.d.ts +13 -0
  390. package/dist/cli/commands/rollback.command.d.ts.map +1 -0
  391. package/dist/cli/commands/rollback.command.js +156 -0
  392. package/dist/cli/commands/rollback.command.js.map +1 -0
  393. package/dist/cli/commands/run.command.d.ts.map +1 -1
  394. package/dist/cli/commands/run.command.js +19 -4
  395. package/dist/cli/commands/run.command.js.map +1 -1
  396. package/dist/cli/commands/skills.command.d.ts.map +1 -1
  397. package/dist/cli/commands/skills.command.js +177 -0
  398. package/dist/cli/commands/skills.command.js.map +1 -1
  399. package/dist/cli/commands/standardize.command.js +3 -6
  400. package/dist/cli/commands/standardize.command.js.map +1 -1
  401. package/dist/cli/commands/test.command.d.ts.map +1 -1
  402. package/dist/cli/commands/test.command.js +1 -1
  403. package/dist/cli/commands/test.command.js.map +1 -1
  404. package/dist/cli/commands/tool/create.command.d.ts +12 -0
  405. package/dist/cli/commands/tool/create.command.d.ts.map +1 -0
  406. package/dist/cli/commands/tool/create.command.js +276 -0
  407. package/dist/cli/commands/tool/create.command.js.map +1 -0
  408. package/dist/cli/commands/tool/index.d.ts +7 -0
  409. package/dist/cli/commands/tool/index.d.ts.map +1 -0
  410. package/dist/cli/commands/tool/index.js +14 -0
  411. package/dist/cli/commands/tool/index.js.map +1 -0
  412. package/dist/cli/commands/tool/list.command.d.ts +7 -0
  413. package/dist/cli/commands/tool/list.command.d.ts.map +1 -0
  414. package/dist/cli/commands/tool/list.command.js +268 -0
  415. package/dist/cli/commands/tool/list.command.js.map +1 -0
  416. package/dist/cli/commands/tool/validate.command.d.ts +7 -0
  417. package/dist/cli/commands/tool/validate.command.d.ts.map +1 -0
  418. package/dist/cli/commands/tool/validate.command.js +103 -0
  419. package/dist/cli/commands/tool/validate.command.js.map +1 -0
  420. package/dist/cli/commands/types/wizard-config.types.d.ts.map +1 -1
  421. package/dist/cli/commands/types/wizard-config.types.js.map +1 -1
  422. package/dist/cli/commands/upgrade.command.d.ts.map +1 -1
  423. package/dist/cli/commands/upgrade.command.js +12 -0
  424. package/dist/cli/commands/upgrade.command.js.map +1 -1
  425. package/dist/cli/commands/validate.command.js +1 -3
  426. package/dist/cli/commands/validate.command.js.map +1 -1
  427. package/dist/cli/commands/verify.d.ts +15 -0
  428. package/dist/cli/commands/verify.d.ts.map +1 -0
  429. package/dist/cli/commands/verify.js +274 -0
  430. package/dist/cli/commands/verify.js.map +1 -0
  431. package/dist/cli/commands/wizard-api-first.command.d.ts.map +1 -1
  432. package/dist/cli/commands/wizard-api-first.command.js +77 -2
  433. package/dist/cli/commands/wizard-api-first.command.js.map +1 -1
  434. package/dist/cli/commands/wizard-interactive.command.d.ts.map +1 -1
  435. package/dist/cli/commands/wizard-interactive.command.js +1503 -118
  436. package/dist/cli/commands/wizard-interactive.command.js.map +1 -1
  437. package/dist/cli/commands/wizard.command.js +1 -1
  438. package/dist/cli/commands/wizard.command.js.map +1 -1
  439. package/dist/cli/extensions/gitlab.extension.js +1 -1
  440. package/dist/cli/index.js +107 -63
  441. package/dist/cli/index.js.map +1 -1
  442. package/dist/cli/schema-driven/schema-loader.d.ts.map +1 -1
  443. package/dist/cli/schema-driven/schema-loader.js +2 -2
  444. package/dist/cli/schema-driven/schema-loader.js.map +1 -1
  445. package/dist/cli/schema-driven/ui-generator.d.ts.map +1 -1
  446. package/dist/cli/schema-driven/ui-generator.js +13 -4
  447. package/dist/cli/schema-driven/ui-generator.js.map +1 -1
  448. package/dist/cli/templates/enhanced-templates.d.ts.map +1 -1
  449. package/dist/cli/templates/enhanced-templates.js +2 -1
  450. package/dist/cli/templates/enhanced-templates.js.map +1 -1
  451. package/dist/cli/utils/error-formatter.js +3 -3
  452. package/dist/cli/utils/index.d.ts +1 -0
  453. package/dist/cli/utils/index.d.ts.map +1 -1
  454. package/dist/cli/utils/index.js +2 -0
  455. package/dist/cli/utils/index.js.map +1 -1
  456. package/dist/cli/utils/logo.d.ts +10 -0
  457. package/dist/cli/utils/logo.d.ts.map +1 -0
  458. package/dist/cli/utils/logo.js +49 -0
  459. package/dist/cli/utils/logo.js.map +1 -0
  460. package/dist/cli/utils/standard-options.d.ts +21 -0
  461. package/dist/cli/utils/standard-options.d.ts.map +1 -1
  462. package/dist/cli/utils/standard-options.js +31 -0
  463. package/dist/cli/utils/standard-options.js.map +1 -1
  464. package/dist/cli/utils/validation-builder.d.ts +121 -0
  465. package/dist/cli/utils/validation-builder.d.ts.map +1 -0
  466. package/dist/cli/utils/validation-builder.js +322 -0
  467. package/dist/cli/utils/validation-builder.js.map +1 -0
  468. package/dist/cli/wizard/data/taxonomy.d.ts.map +1 -1
  469. package/dist/cli/wizard/data/taxonomy.js +5 -1
  470. package/dist/cli/wizard/data/taxonomy.js.map +1 -1
  471. package/dist/cli/wizard/interactive-wizard.d.ts.map +1 -1
  472. package/dist/cli/wizard/interactive-wizard.js +26 -13
  473. package/dist/cli/wizard/interactive-wizard.js.map +1 -1
  474. package/dist/cli/wizard/steps/02-basic-info.js +1 -1
  475. package/dist/cli/wizard/steps/04a-persona.d.ts +16 -0
  476. package/dist/cli/wizard/steps/04a-persona.d.ts.map +1 -0
  477. package/dist/cli/wizard/steps/04a-persona.js +297 -0
  478. package/dist/cli/wizard/steps/04a-persona.js.map +1 -0
  479. package/dist/cli/wizard/steps/05-tools.d.ts.map +1 -1
  480. package/dist/cli/wizard/steps/05-tools.js +32 -4
  481. package/dist/cli/wizard/steps/05-tools.js.map +1 -1
  482. package/dist/cli/wizard/steps/06-autonomy.js +1 -1
  483. package/dist/cli/wizard/steps/07-observability.js +1 -1
  484. package/dist/cli/wizard/steps/08-deployment.js +1 -1
  485. package/dist/cli/wizard/steps/09-advanced.js +1 -1
  486. package/dist/cli/wizard/steps/09-advanced.js.map +1 -1
  487. package/dist/cli/wizard/steps/10-review.d.ts.map +1 -1
  488. package/dist/cli/wizard/steps/10-review.js +6 -4
  489. package/dist/cli/wizard/steps/10-review.js.map +1 -1
  490. package/dist/cli/wizard/steps/12-agents-folder.d.ts.map +1 -1
  491. package/dist/cli/wizard/steps/12-agents-folder.js +14 -10
  492. package/dist/cli/wizard/steps/12-agents-folder.js.map +1 -1
  493. package/dist/cli/wizard/steps/13-openapi-generation.d.ts.map +1 -1
  494. package/dist/cli/wizard/steps/13-openapi-generation.js +10 -2
  495. package/dist/cli/wizard/steps/13-openapi-generation.js.map +1 -1
  496. package/dist/cli/wizard/steps/14-workspace-registration.d.ts.map +1 -1
  497. package/dist/cli/wizard/steps/14-workspace-registration.js +10 -2
  498. package/dist/cli/wizard/steps/14-workspace-registration.js.map +1 -1
  499. package/dist/cli/wizard/steps/15-cost-estimation.d.ts.map +1 -1
  500. package/dist/cli/wizard/steps/15-cost-estimation.js +27 -11
  501. package/dist/cli/wizard/steps/15-cost-estimation.js.map +1 -1
  502. package/dist/cli/wizard/steps/16-best-practices.d.ts.map +1 -1
  503. package/dist/cli/wizard/steps/16-best-practices.js +14 -13
  504. package/dist/cli/wizard/steps/16-best-practices.js.map +1 -1
  505. package/dist/cli/wizard/ui/banner.d.ts +20 -0
  506. package/dist/cli/wizard/ui/banner.d.ts.map +1 -0
  507. package/dist/cli/wizard/ui/banner.js +66 -0
  508. package/dist/cli/wizard/ui/banner.js.map +1 -0
  509. package/dist/cli/wizard/ui/console.d.ts.map +1 -1
  510. package/dist/cli/wizard/ui/console.js +21 -23
  511. package/dist/cli/wizard/ui/console.js.map +1 -1
  512. package/dist/cli/wizard/ui/wizard-ui.d.ts.map +1 -1
  513. package/dist/cli/wizard/ui/wizard-ui.js +54 -75
  514. package/dist/cli/wizard/ui/wizard-ui.js.map +1 -1
  515. package/dist/cli/wizard/use-cases.d.ts.map +1 -1
  516. package/dist/cli/wizard/use-cases.js.map +1 -1
  517. package/dist/config/defaults.d.ts +59 -0
  518. package/dist/config/defaults.d.ts.map +1 -1
  519. package/dist/config/defaults.js +73 -1
  520. package/dist/config/defaults.js.map +1 -1
  521. package/dist/deploy/cloud/aws-driver.d.ts +75 -0
  522. package/dist/deploy/cloud/aws-driver.d.ts.map +1 -0
  523. package/dist/deploy/cloud/aws-driver.js +344 -0
  524. package/dist/deploy/cloud/aws-driver.js.map +1 -0
  525. package/dist/deploy/cloud/azure-driver.d.ts +54 -0
  526. package/dist/deploy/cloud/azure-driver.d.ts.map +1 -0
  527. package/dist/deploy/cloud/azure-driver.js +221 -0
  528. package/dist/deploy/cloud/azure-driver.js.map +1 -0
  529. package/dist/deploy/cloud/gcp-driver.d.ts +56 -0
  530. package/dist/deploy/cloud/gcp-driver.d.ts.map +1 -0
  531. package/dist/deploy/cloud/gcp-driver.js +216 -0
  532. package/dist/deploy/cloud/gcp-driver.js.map +1 -0
  533. package/dist/dev-cli/commands/release-prep.command.d.ts +1 -5
  534. package/dist/dev-cli/commands/release-prep.command.d.ts.map +1 -1
  535. package/dist/dev-cli/commands/release-prep.command.js +4 -8
  536. package/dist/dev-cli/commands/release-prep.command.js.map +1 -1
  537. package/dist/dev-cli/commands/version.command.js +18 -18
  538. package/dist/dev-cli/commands/version.command.js.map +1 -1
  539. package/dist/dev-cli/services/spec-generate.service.d.ts +8 -1
  540. package/dist/dev-cli/services/spec-generate.service.d.ts.map +1 -1
  541. package/dist/dev-cli/services/spec-generate.service.js +96 -11
  542. package/dist/dev-cli/services/spec-generate.service.js.map +1 -1
  543. package/dist/dev-cli/services/spec-validate.service.d.ts.map +1 -1
  544. package/dist/dev-cli/services/spec-validate.service.js +66 -5
  545. package/dist/dev-cli/services/spec-validate.service.js.map +1 -1
  546. package/dist/dev-cli/services/version-check.service.d.ts.map +1 -1
  547. package/dist/dev-cli/services/version-check.service.js +2 -1
  548. package/dist/dev-cli/services/version-check.service.js.map +1 -1
  549. package/dist/dev-cli/services/version-validate.service.d.ts.map +1 -1
  550. package/dist/dev-cli/services/version-validate.service.js +1 -3
  551. package/dist/dev-cli/services/version-validate.service.js.map +1 -1
  552. package/dist/di-container.d.ts +5 -0
  553. package/dist/di-container.d.ts.map +1 -1
  554. package/dist/di-container.js +30 -6
  555. package/dist/di-container.js.map +1 -1
  556. package/dist/errors/index.d.ts +154 -0
  557. package/dist/errors/index.d.ts.map +1 -0
  558. package/dist/errors/index.js +327 -0
  559. package/dist/errors/index.js.map +1 -0
  560. package/dist/generated/types.d.ts +91 -91
  561. package/dist/generated/types.d.ts.map +1 -1
  562. package/dist/interfaces/governance-provider.interface.d.ts +98 -0
  563. package/dist/interfaces/governance-provider.interface.d.ts.map +1 -0
  564. package/dist/interfaces/governance-provider.interface.js +20 -0
  565. package/dist/interfaces/governance-provider.interface.js.map +1 -0
  566. package/dist/mesh/advanced-routing.d.ts +181 -0
  567. package/dist/mesh/advanced-routing.d.ts.map +1 -0
  568. package/dist/mesh/advanced-routing.js +479 -0
  569. package/dist/mesh/advanced-routing.js.map +1 -0
  570. package/dist/mesh/agent-graph.d.ts +218 -0
  571. package/dist/mesh/agent-graph.d.ts.map +1 -0
  572. package/dist/mesh/agent-graph.js +493 -0
  573. package/dist/mesh/agent-graph.js.map +1 -0
  574. package/dist/mesh/discovery-providers.d.ts +162 -0
  575. package/dist/mesh/discovery-providers.d.ts.map +1 -0
  576. package/dist/mesh/discovery-providers.js +520 -0
  577. package/dist/mesh/discovery-providers.js.map +1 -0
  578. package/dist/mesh/index.d.ts +3 -0
  579. package/dist/mesh/index.d.ts.map +1 -1
  580. package/dist/mesh/index.js +6 -0
  581. package/dist/mesh/index.js.map +1 -1
  582. package/dist/mesh/types.d.ts +212 -1
  583. package/dist/mesh/types.d.ts.map +1 -1
  584. package/dist/messaging/channels.d.ts +1 -1
  585. package/dist/messaging/channels.js +1 -1
  586. package/dist/messaging/protocols/memory.d.ts +1 -1
  587. package/dist/messaging/protocols/memory.js +1 -1
  588. package/dist/messenger/Commands/MessengerConsumeCommand.d.ts +57 -0
  589. package/dist/messenger/Commands/MessengerConsumeCommand.d.ts.map +1 -0
  590. package/dist/messenger/Commands/MessengerConsumeCommand.js +49 -0
  591. package/dist/messenger/Commands/MessengerConsumeCommand.js.map +1 -0
  592. package/dist/messenger/Commands/MessengerFailedCommand.d.ts +76 -0
  593. package/dist/messenger/Commands/MessengerFailedCommand.d.ts.map +1 -0
  594. package/dist/messenger/Commands/MessengerFailedCommand.js +120 -0
  595. package/dist/messenger/Commands/MessengerFailedCommand.js.map +1 -0
  596. package/dist/messenger/Commands/MessengerStatsCommand.d.ts +61 -0
  597. package/dist/messenger/Commands/MessengerStatsCommand.d.ts.map +1 -0
  598. package/dist/messenger/Commands/MessengerStatsCommand.js +80 -0
  599. package/dist/messenger/Commands/MessengerStatsCommand.js.map +1 -0
  600. package/dist/messenger/Commands/index.d.ts +10 -0
  601. package/dist/messenger/Commands/index.d.ts.map +1 -0
  602. package/dist/messenger/Commands/index.js +10 -0
  603. package/dist/messenger/Commands/index.js.map +1 -0
  604. package/dist/messenger/EventSubscriber/FailedMessageSubscriber.d.ts +44 -0
  605. package/dist/messenger/EventSubscriber/FailedMessageSubscriber.d.ts.map +1 -0
  606. package/dist/messenger/EventSubscriber/FailedMessageSubscriber.js +64 -0
  607. package/dist/messenger/EventSubscriber/FailedMessageSubscriber.js.map +1 -0
  608. package/dist/messenger/Handler/AgentBatchHandler.d.ts +80 -0
  609. package/dist/messenger/Handler/AgentBatchHandler.d.ts.map +1 -0
  610. package/dist/messenger/Handler/AgentBatchHandler.js +211 -0
  611. package/dist/messenger/Handler/AgentBatchHandler.js.map +1 -0
  612. package/dist/messenger/Handler/AgentExecutionHandler.d.ts +76 -0
  613. package/dist/messenger/Handler/AgentExecutionHandler.d.ts.map +1 -0
  614. package/dist/messenger/Handler/AgentExecutionHandler.js +131 -0
  615. package/dist/messenger/Handler/AgentExecutionHandler.js.map +1 -0
  616. package/dist/messenger/Handler/index.d.ts +9 -0
  617. package/dist/messenger/Handler/index.d.ts.map +1 -0
  618. package/dist/messenger/Handler/index.js +9 -0
  619. package/dist/messenger/Handler/index.js.map +1 -0
  620. package/dist/messenger/Message/AgentBatchMessage.d.ts +115 -0
  621. package/dist/messenger/Message/AgentBatchMessage.d.ts.map +1 -0
  622. package/dist/messenger/Message/AgentBatchMessage.js +102 -0
  623. package/dist/messenger/Message/AgentBatchMessage.js.map +1 -0
  624. package/dist/messenger/Message/AgentExecutionMessage.d.ts +98 -0
  625. package/dist/messenger/Message/AgentExecutionMessage.d.ts.map +1 -0
  626. package/dist/messenger/Message/AgentExecutionMessage.js +77 -0
  627. package/dist/messenger/Message/AgentExecutionMessage.js.map +1 -0
  628. package/dist/messenger/Message/index.d.ts +9 -0
  629. package/dist/messenger/Message/index.d.ts.map +1 -0
  630. package/dist/messenger/Message/index.js +9 -0
  631. package/dist/messenger/Message/index.js.map +1 -0
  632. package/dist/messenger/Middleware/AuthenticationMiddleware.d.ts +41 -0
  633. package/dist/messenger/Middleware/AuthenticationMiddleware.d.ts.map +1 -0
  634. package/dist/messenger/Middleware/AuthenticationMiddleware.js +84 -0
  635. package/dist/messenger/Middleware/AuthenticationMiddleware.js.map +1 -0
  636. package/dist/messenger/Middleware/LoggingMiddleware.d.ts +30 -0
  637. package/dist/messenger/Middleware/LoggingMiddleware.d.ts.map +1 -0
  638. package/dist/messenger/Middleware/LoggingMiddleware.js +59 -0
  639. package/dist/messenger/Middleware/LoggingMiddleware.js.map +1 -0
  640. package/dist/messenger/Middleware/RateLimitMiddleware.d.ts +67 -0
  641. package/dist/messenger/Middleware/RateLimitMiddleware.d.ts.map +1 -0
  642. package/dist/messenger/Middleware/RateLimitMiddleware.js +90 -0
  643. package/dist/messenger/Middleware/RateLimitMiddleware.js.map +1 -0
  644. package/dist/messenger/Middleware/ValidationMiddleware.d.ts +39 -0
  645. package/dist/messenger/Middleware/ValidationMiddleware.d.ts.map +1 -0
  646. package/dist/messenger/Middleware/ValidationMiddleware.js +96 -0
  647. package/dist/messenger/Middleware/ValidationMiddleware.js.map +1 -0
  648. package/dist/messenger/Middleware/index.d.ts +11 -0
  649. package/dist/messenger/Middleware/index.d.ts.map +1 -0
  650. package/dist/messenger/Middleware/index.js +11 -0
  651. package/dist/messenger/Middleware/index.js.map +1 -0
  652. package/dist/messenger/Monitoring/MetricsCollector.d.ts +107 -0
  653. package/dist/messenger/Monitoring/MetricsCollector.d.ts.map +1 -0
  654. package/dist/messenger/Monitoring/MetricsCollector.js +80 -0
  655. package/dist/messenger/Monitoring/MetricsCollector.js.map +1 -0
  656. package/dist/messenger/Monitoring/QueueMonitor.d.ts +74 -0
  657. package/dist/messenger/Monitoring/QueueMonitor.d.ts.map +1 -0
  658. package/dist/messenger/Monitoring/QueueMonitor.js +160 -0
  659. package/dist/messenger/Monitoring/QueueMonitor.js.map +1 -0
  660. package/dist/messenger/Monitoring/index.d.ts +9 -0
  661. package/dist/messenger/Monitoring/index.d.ts.map +1 -0
  662. package/dist/messenger/Monitoring/index.js +9 -0
  663. package/dist/messenger/Monitoring/index.js.map +1 -0
  664. package/dist/messenger/index.d.ts +38 -0
  665. package/dist/messenger/index.d.ts.map +1 -0
  666. package/dist/messenger/index.js +44 -0
  667. package/dist/messenger/index.js.map +1 -0
  668. package/dist/observability/index.d.ts +13 -0
  669. package/dist/observability/index.d.ts.map +1 -0
  670. package/dist/observability/index.js +14 -0
  671. package/dist/observability/index.js.map +1 -0
  672. package/dist/observability/metrics.d.ts +131 -0
  673. package/dist/observability/metrics.d.ts.map +1 -0
  674. package/dist/observability/metrics.js +308 -0
  675. package/dist/observability/metrics.js.map +1 -0
  676. package/dist/observability/middleware.d.ts +64 -0
  677. package/dist/observability/middleware.d.ts.map +1 -0
  678. package/dist/observability/middleware.js +225 -0
  679. package/dist/observability/middleware.js.map +1 -0
  680. package/dist/package.json +49 -28
  681. package/dist/repositories/schema.repository.d.ts.map +1 -1
  682. package/dist/repositories/schema.repository.js +10 -4
  683. package/dist/repositories/schema.repository.js.map +1 -1
  684. package/dist/runtime/agent-runner.d.ts.map +1 -1
  685. package/dist/runtime/agent-runner.js +23 -23
  686. package/dist/runtime/agent-runner.js.map +1 -1
  687. package/dist/sdks/kagent/crd-generator.d.ts +63 -1
  688. package/dist/sdks/kagent/crd-generator.d.ts.map +1 -1
  689. package/dist/sdks/kagent/crd-generator.js +770 -20
  690. package/dist/sdks/kagent/crd-generator.js.map +1 -1
  691. package/dist/sdks/kagent/crd-parser.d.ts.map +1 -1
  692. package/dist/sdks/kagent/crd-parser.js +2 -1
  693. package/dist/sdks/kagent/crd-parser.js.map +1 -1
  694. package/dist/sdks/kagent/index.d.ts +1 -1
  695. package/dist/sdks/kagent/index.d.ts.map +1 -1
  696. package/dist/sdks/kagent/k8s-resources-generator.d.ts.map +1 -1
  697. package/dist/sdks/kagent/k8s-resources-generator.js.map +1 -1
  698. package/dist/sdks/kagent/types.d.ts +30 -0
  699. package/dist/sdks/kagent/types.d.ts.map +1 -1
  700. package/dist/sdks/shared/validation.d.ts +4 -4
  701. package/dist/sdks/typescript/builders/autonomy.builder.d.ts +119 -0
  702. package/dist/sdks/typescript/builders/autonomy.builder.d.ts.map +1 -0
  703. package/dist/sdks/typescript/builders/autonomy.builder.js +165 -0
  704. package/dist/sdks/typescript/builders/autonomy.builder.js.map +1 -0
  705. package/dist/sdks/typescript/builders/index.d.ts +12 -0
  706. package/dist/sdks/typescript/builders/index.d.ts.map +1 -0
  707. package/dist/sdks/typescript/builders/index.js +11 -0
  708. package/dist/sdks/typescript/builders/index.js.map +1 -0
  709. package/dist/sdks/typescript/builders/llm.builder.d.ts +74 -0
  710. package/dist/sdks/typescript/builders/llm.builder.d.ts.map +1 -0
  711. package/dist/sdks/typescript/builders/llm.builder.js +123 -0
  712. package/dist/sdks/typescript/builders/llm.builder.js.map +1 -0
  713. package/dist/sdks/typescript/builders/manifest.builder.d.ts +153 -0
  714. package/dist/sdks/typescript/builders/manifest.builder.d.ts.map +1 -0
  715. package/dist/sdks/typescript/builders/manifest.builder.js +343 -0
  716. package/dist/sdks/typescript/builders/manifest.builder.js.map +1 -0
  717. package/dist/sdks/typescript/builders/safety.builder.d.ts +79 -0
  718. package/dist/sdks/typescript/builders/safety.builder.d.ts.map +1 -0
  719. package/dist/sdks/typescript/builders/safety.builder.js +147 -0
  720. package/dist/sdks/typescript/builders/safety.builder.js.map +1 -0
  721. package/dist/sdks/typescript/builders/tool.builder.d.ts +179 -0
  722. package/dist/sdks/typescript/builders/tool.builder.d.ts.map +1 -0
  723. package/dist/sdks/typescript/builders/tool.builder.js +305 -0
  724. package/dist/sdks/typescript/builders/tool.builder.js.map +1 -0
  725. package/dist/sdks/typescript/client.d.ts +1 -3
  726. package/dist/sdks/typescript/client.d.ts.map +1 -1
  727. package/dist/sdks/typescript/client.js +1 -3
  728. package/dist/sdks/typescript/client.js.map +1 -1
  729. package/dist/sdks/typescript/constants.d.ts +24 -0
  730. package/dist/sdks/typescript/constants.d.ts.map +1 -0
  731. package/dist/sdks/typescript/constants.js +102 -0
  732. package/dist/sdks/typescript/constants.js.map +1 -0
  733. package/dist/sdks/typescript/index.d.ts +4 -0
  734. package/dist/sdks/typescript/index.d.ts.map +1 -1
  735. package/dist/sdks/typescript/index.js +4 -0
  736. package/dist/sdks/typescript/index.js.map +1 -1
  737. package/dist/sdks/typescript/manifest.d.ts +8 -3
  738. package/dist/sdks/typescript/manifest.d.ts.map +1 -1
  739. package/dist/sdks/typescript/manifest.js +12 -28
  740. package/dist/sdks/typescript/manifest.js.map +1 -1
  741. package/dist/sdks/typescript/types.d.ts +5 -3
  742. package/dist/sdks/typescript/types.d.ts.map +1 -1
  743. package/dist/sdks/typescript/types.js +6 -3
  744. package/dist/sdks/typescript/types.js.map +1 -1
  745. package/dist/sdks/typescript/validator.d.ts +31 -0
  746. package/dist/sdks/typescript/validator.d.ts.map +1 -1
  747. package/dist/sdks/typescript/validator.js +205 -1
  748. package/dist/sdks/typescript/validator.js.map +1 -1
  749. package/dist/services/agent-card-generator.d.ts +57 -0
  750. package/dist/services/agent-card-generator.d.ts.map +1 -0
  751. package/dist/services/agent-card-generator.js +592 -0
  752. package/dist/services/agent-card-generator.js.map +1 -0
  753. package/dist/services/agent-type-detector.service.d.ts +72 -0
  754. package/dist/services/agent-type-detector.service.d.ts.map +1 -0
  755. package/dist/services/agent-type-detector.service.js +197 -0
  756. package/dist/services/agent-type-detector.service.js.map +1 -0
  757. package/dist/services/agents-md/agents-md-generator.service.d.ts +29 -0
  758. package/dist/services/agents-md/agents-md-generator.service.d.ts.map +1 -0
  759. package/dist/services/agents-md/agents-md-generator.service.js +252 -0
  760. package/dist/services/agents-md/agents-md-generator.service.js.map +1 -0
  761. package/dist/services/ai-architect.service.js +1 -1
  762. package/dist/services/ai-architect.service.js.map +1 -1
  763. package/dist/services/audit.d.ts +7 -1
  764. package/dist/services/audit.d.ts.map +1 -1
  765. package/dist/services/audit.js +70 -40
  766. package/dist/services/audit.js.map +1 -1
  767. package/dist/services/codegen/generators/vscode.generator.js +2 -2
  768. package/dist/services/codegen/generators/vscode.generator.js.map +1 -1
  769. package/dist/services/cost-estimation/token-counter.service.js +1 -1
  770. package/dist/services/cost-estimation/token-counter.service.js.map +1 -1
  771. package/dist/services/dev-server/websocket-server.d.ts.map +1 -1
  772. package/dist/services/dev-server/websocket-server.js +2 -1
  773. package/dist/services/dev-server/websocket-server.js.map +1 -1
  774. package/dist/services/evals/evals-generator.service.d.ts +90 -0
  775. package/dist/services/evals/evals-generator.service.d.ts.map +1 -0
  776. package/dist/services/evals/evals-generator.service.js +1603 -0
  777. package/dist/services/evals/evals-generator.service.js.map +1 -0
  778. package/dist/services/export/anthropic/anthropic-exporter.d.ts +1 -0
  779. package/dist/services/export/anthropic/anthropic-exporter.d.ts.map +1 -1
  780. package/dist/services/export/anthropic/anthropic-exporter.js +19 -5
  781. package/dist/services/export/anthropic/anthropic-exporter.js.map +1 -1
  782. package/dist/services/export/anthropic/index.d.ts +1 -1
  783. package/dist/services/export/anthropic/index.d.ts.map +1 -1
  784. package/dist/services/export/anthropic/index.js +1 -1
  785. package/dist/services/export/anthropic/index.js.map +1 -1
  786. package/dist/services/export/export-orchestrator.d.ts +1 -0
  787. package/dist/services/export/export-orchestrator.d.ts.map +1 -1
  788. package/dist/services/export/langchain/callbacks-generator.d.ts.map +1 -1
  789. package/dist/services/export/langchain/callbacks-generator.js +16 -8
  790. package/dist/services/export/langchain/callbacks-generator.js.map +1 -1
  791. package/dist/services/export/langchain/error-handling-generator.d.ts.map +1 -1
  792. package/dist/services/export/langchain/error-handling-generator.js +9 -5
  793. package/dist/services/export/langchain/error-handling-generator.js.map +1 -1
  794. package/dist/services/export/langchain/langchain-exporter.d.ts.map +1 -1
  795. package/dist/services/export/langchain/langchain-exporter.js +16 -8
  796. package/dist/services/export/langchain/langchain-exporter.js.map +1 -1
  797. package/dist/services/export/langchain/langgraph-generator.d.ts.map +1 -1
  798. package/dist/services/export/langchain/langgraph-generator.js +34 -20
  799. package/dist/services/export/langchain/langgraph-generator.js.map +1 -1
  800. package/dist/services/export/langchain/langserve-generator.d.ts.map +1 -1
  801. package/dist/services/export/langchain/langserve-generator.js +7 -1
  802. package/dist/services/export/langchain/langserve-generator.js.map +1 -1
  803. package/dist/services/export/langchain/memory-generator.d.ts.map +1 -1
  804. package/dist/services/export/langchain/memory-generator.js.map +1 -1
  805. package/dist/services/export/langchain/plan-execute-generator.d.ts.map +1 -1
  806. package/dist/services/export/langchain/plan-execute-generator.js.map +1 -1
  807. package/dist/services/export/langchain/streaming-generator.d.ts.map +1 -1
  808. package/dist/services/export/langchain/streaming-generator.js +12 -6
  809. package/dist/services/export/langchain/streaming-generator.js.map +1 -1
  810. package/dist/services/export/langchain/tools-generator.d.ts.map +1 -1
  811. package/dist/services/export/langchain/tools-generator.js.map +1 -1
  812. package/dist/services/export/npm/npm-exporter.d.ts +40 -0
  813. package/dist/services/export/npm/npm-exporter.d.ts.map +1 -1
  814. package/dist/services/export/npm/npm-exporter.js +1294 -1
  815. package/dist/services/export/npm/npm-exporter.js.map +1 -1
  816. package/dist/services/export/npm/package-json-generator.d.ts.map +1 -1
  817. package/dist/services/export/npm/package-json-generator.js +5 -2
  818. package/dist/services/export/npm/package-json-generator.js.map +1 -1
  819. package/dist/services/export/npm/typescript-generator.d.ts.map +1 -1
  820. package/dist/services/export/npm/typescript-generator.js +7 -3
  821. package/dist/services/export/npm/typescript-generator.js.map +1 -1
  822. package/dist/services/export/testing/index.d.ts +1 -1
  823. package/dist/services/export/testing/index.d.ts.map +1 -1
  824. package/dist/services/export/testing/test-generator.d.ts.map +1 -1
  825. package/dist/services/export/testing/test-generator.js +5 -1
  826. package/dist/services/export/testing/test-generator.js.map +1 -1
  827. package/dist/services/framework-import/langchain-importer.service.d.ts.map +1 -1
  828. package/dist/services/framework-import/langchain-importer.service.js +2 -1
  829. package/dist/services/framework-import/langchain-importer.service.js.map +1 -1
  830. package/dist/services/framework-import/langflow-importer.service.d.ts.map +1 -1
  831. package/dist/services/framework-import/langflow-importer.service.js +3 -2
  832. package/dist/services/framework-import/langflow-importer.service.js.map +1 -1
  833. package/dist/services/generation.service.d.ts +7 -0
  834. package/dist/services/generation.service.d.ts.map +1 -1
  835. package/dist/services/generation.service.js +31 -8
  836. package/dist/services/generation.service.js.map +1 -1
  837. package/dist/services/github-sync/schemas.d.ts +1 -1
  838. package/dist/services/governance/governance-generator.service.d.ts +120 -0
  839. package/dist/services/governance/governance-generator.service.d.ts.map +1 -0
  840. package/dist/services/governance/governance-generator.service.js +955 -0
  841. package/dist/services/governance/governance-generator.service.js.map +1 -0
  842. package/dist/services/governance-client.service.d.ts +39 -0
  843. package/dist/services/governance-client.service.d.ts.map +1 -0
  844. package/dist/services/governance-client.service.js +124 -0
  845. package/dist/services/governance-client.service.js.map +1 -0
  846. package/dist/services/id-card.service.d.ts +109 -0
  847. package/dist/services/id-card.service.d.ts.map +1 -0
  848. package/dist/services/id-card.service.js +236 -0
  849. package/dist/services/id-card.service.js.map +1 -0
  850. package/dist/services/llms-txt/llms-txt.service.d.ts +2 -2
  851. package/dist/services/llms-txt/llms-txt.service.js +2 -2
  852. package/dist/services/messaging/index.d.ts +0 -1
  853. package/dist/services/messaging/index.d.ts.map +1 -1
  854. package/dist/services/messaging/index.js +2 -1
  855. package/dist/services/messaging/index.js.map +1 -1
  856. package/dist/services/migration/langchain-migration.service.js +2 -2
  857. package/dist/services/migration/langchain-migration.service.js.map +1 -1
  858. package/dist/services/multi-agent/team-generator.service.d.ts +41 -0
  859. package/dist/services/multi-agent/team-generator.service.d.ts.map +1 -0
  860. package/dist/services/multi-agent/team-generator.service.js +560 -0
  861. package/dist/services/multi-agent/team-generator.service.js.map +1 -0
  862. package/dist/services/observability/observability-generator.service.d.ts +54 -0
  863. package/dist/services/observability/observability-generator.service.d.ts.map +1 -0
  864. package/dist/services/observability/observability-generator.service.js +1353 -0
  865. package/dist/services/observability/observability-generator.service.js.map +1 -0
  866. package/dist/services/registry/bundle.service.d.ts.map +1 -1
  867. package/dist/services/registry/bundle.service.js +2 -1
  868. package/dist/services/registry/bundle.service.js.map +1 -1
  869. package/dist/services/registry/index.service.js +1 -1
  870. package/dist/services/registry.service.d.ts.map +1 -1
  871. package/dist/services/registry.service.js +2 -1
  872. package/dist/services/registry.service.js.map +1 -1
  873. package/dist/services/release-automation/release-agent.service.js +1 -1
  874. package/dist/services/release-automation/release.service.d.ts +4 -4
  875. package/dist/services/release-automation/schemas/release.schema.d.ts +5 -5
  876. package/dist/services/release-automation/tag.service.d.ts +3 -3
  877. package/dist/services/runtime/anthropic.adapter.d.ts.map +1 -1
  878. package/dist/services/runtime/anthropic.adapter.js +2 -6
  879. package/dist/services/runtime/anthropic.adapter.js.map +1 -1
  880. package/dist/services/runtime/azure.adapter.d.ts +1 -1
  881. package/dist/services/runtime/azure.adapter.js +3 -3
  882. package/dist/services/runtime/azure.adapter.js.map +1 -1
  883. package/dist/services/runtime/bedrock.adapter.d.ts.map +1 -1
  884. package/dist/services/runtime/bedrock.adapter.js +2 -6
  885. package/dist/services/runtime/bedrock.adapter.js.map +1 -1
  886. package/dist/services/runtime/claude/claude-adapter.d.ts.map +1 -1
  887. package/dist/services/runtime/claude/claude-adapter.js +2 -6
  888. package/dist/services/runtime/claude/claude-adapter.js.map +1 -1
  889. package/dist/services/runtime/gemini.adapter.d.ts.map +1 -1
  890. package/dist/services/runtime/gemini.adapter.js +2 -6
  891. package/dist/services/runtime/gemini.adapter.js.map +1 -1
  892. package/dist/services/runtime/mistral.adapter.d.ts.map +1 -1
  893. package/dist/services/runtime/mistral.adapter.js +2 -6
  894. package/dist/services/runtime/mistral.adapter.js.map +1 -1
  895. package/dist/services/runtime/ollama.adapter.d.ts.map +1 -1
  896. package/dist/services/runtime/ollama.adapter.js +2 -6
  897. package/dist/services/runtime/ollama.adapter.js.map +1 -1
  898. package/dist/services/runtime/openai.adapter.js +2 -2
  899. package/dist/services/runtime/openai.adapter.js.map +1 -1
  900. package/dist/services/skills-pipeline/index.d.ts +8 -0
  901. package/dist/services/skills-pipeline/index.d.ts.map +1 -0
  902. package/dist/services/skills-pipeline/index.js +8 -0
  903. package/dist/services/skills-pipeline/index.js.map +1 -0
  904. package/dist/services/skills-pipeline/skills-export.service.d.ts +86 -0
  905. package/dist/services/skills-pipeline/skills-export.service.d.ts.map +1 -0
  906. package/dist/services/skills-pipeline/skills-export.service.js +483 -0
  907. package/dist/services/skills-pipeline/skills-export.service.js.map +1 -0
  908. package/dist/services/skills-pipeline/skills-generator.service.d.ts +118 -0
  909. package/dist/services/skills-pipeline/skills-generator.service.d.ts.map +1 -0
  910. package/dist/services/skills-pipeline/skills-generator.service.js +648 -0
  911. package/dist/services/skills-pipeline/skills-generator.service.js.map +1 -0
  912. package/dist/services/skills-pipeline/skills-research.service.d.ts +112 -0
  913. package/dist/services/skills-pipeline/skills-research.service.d.ts.map +1 -0
  914. package/dist/services/skills-pipeline/skills-research.service.js +471 -0
  915. package/dist/services/skills-pipeline/skills-research.service.js.map +1 -0
  916. package/dist/services/taxonomy-service.d.ts +4 -4
  917. package/dist/services/taxonomy-service.js +1 -1
  918. package/dist/services/template-processor.service.d.ts.map +1 -1
  919. package/dist/services/template-processor.service.js +7 -5
  920. package/dist/services/template-processor.service.js.map +1 -1
  921. package/dist/services/test-runner/mock-llm.service.d.ts.map +1 -1
  922. package/dist/services/test-runner/mock-llm.service.js +1 -2
  923. package/dist/services/test-runner/mock-llm.service.js.map +1 -1
  924. package/dist/services/test-runner/scenarios.d.ts.map +1 -1
  925. package/dist/services/test-runner/scenarios.js +9 -3
  926. package/dist/services/test-runner/scenarios.js.map +1 -1
  927. package/dist/services/test-runner/test-runner.service.d.ts.map +1 -1
  928. package/dist/services/test-runner/test-runner.service.js.map +1 -1
  929. package/dist/services/validation/best-practices-validator.d.ts.map +1 -1
  930. package/dist/services/validation/best-practices-validator.js.map +1 -1
  931. package/dist/services/validation/cost-estimator.d.ts.map +1 -1
  932. package/dist/services/validation/cost-estimator.js +4 -2
  933. package/dist/services/validation/cost-estimator.js.map +1 -1
  934. package/dist/services/validation/enhanced-validator.d.ts.map +1 -1
  935. package/dist/services/validation/enhanced-validator.js +2 -4
  936. package/dist/services/validation/enhanced-validator.js.map +1 -1
  937. package/dist/services/validation/security-validator.d.ts.map +1 -1
  938. package/dist/services/validation/security-validator.js +3 -1
  939. package/dist/services/validation/security-validator.js.map +1 -1
  940. package/dist/services/validation-zod.service.js +1 -1
  941. package/dist/services/validation-zod.service.js.map +1 -1
  942. package/dist/services/validation.service.d.ts +7 -2
  943. package/dist/services/validation.service.d.ts.map +1 -1
  944. package/dist/services/validation.service.js +7 -4
  945. package/dist/services/validation.service.js.map +1 -1
  946. package/dist/services/validators/a2a.validator.js +1 -1
  947. package/dist/services/validators/a2a.validator.js.map +1 -1
  948. package/dist/services/validators/autogen.validator.js +1 -1
  949. package/dist/services/validators/autogen.validator.js.map +1 -1
  950. package/dist/services/validators/contract.validator.js.map +1 -1
  951. package/dist/services/validators/crewai.validator.js +1 -1
  952. package/dist/services/validators/crewai.validator.js.map +1 -1
  953. package/dist/services/validators/dependencies.validator.d.ts +1 -1
  954. package/dist/services/validators/dependencies.validator.d.ts.map +1 -1
  955. package/dist/services/validators/kagent.validator.js +1 -1
  956. package/dist/services/validators/kagent.validator.js.map +1 -1
  957. package/dist/services/validators/langchain.validator.js +1 -1
  958. package/dist/services/validators/langchain.validator.js.map +1 -1
  959. package/dist/services/validators/langgraph.validator.js +1 -1
  960. package/dist/services/validators/langgraph.validator.js.map +1 -1
  961. package/dist/services/validators/mcp.validator.js +1 -1
  962. package/dist/services/validators/mcp.validator.js.map +1 -1
  963. package/dist/services/wizard/prompts.d.ts.map +1 -1
  964. package/dist/services/wizard/prompts.js +37 -14
  965. package/dist/services/wizard/prompts.js.map +1 -1
  966. package/dist/services/wizard/wizard.service.d.ts +1 -1
  967. package/dist/services/wizard/wizard.service.d.ts.map +1 -1
  968. package/dist/services/wizard/wizard.service.js +98 -30
  969. package/dist/services/wizard/wizard.service.js.map +1 -1
  970. package/dist/spec/extensions/knowledge-graph/knowledge-graph.schema.json +386 -0
  971. package/dist/spec/extensions/manifest-extensions.md +2 -2
  972. package/dist/spec/registry/README.md +1 -1
  973. package/dist/spec/registry/registry-spec.md +4 -4
  974. package/dist/spec/v0.4/agent-card.schema.json +390 -0
  975. package/dist/spec/v0.4/agent.schema.json +952 -39
  976. package/dist/spec/v0.4/extensions/drupal/drupal.schema.json +77 -0
  977. package/dist/spec/v0.4/extensions/evals/evals.schema.json +597 -0
  978. package/dist/spec/v0.4/extensions/governance/governance-extension.yaml +161 -0
  979. package/dist/spec/v0.4/extensions/identity/identity.schema.json +302 -0
  980. package/dist/spec/v0.4/extensions/kagent/README.md +1 -1
  981. package/dist/spec/v0.4/extensions/team/team.schema.json +304 -0
  982. package/dist/spec/v0.4/validator.schema.json +282 -0
  983. package/dist/spec/v0.5/agent.schema.json +768 -0
  984. package/dist/transports/websocket.d.ts +1 -0
  985. package/dist/transports/websocket.d.ts.map +1 -1
  986. package/dist/transports/websocket.js +10 -2
  987. package/dist/transports/websocket.js.map +1 -1
  988. package/dist/types/architect.d.ts +2 -2
  989. package/dist/types/architect.d.ts.map +1 -1
  990. package/dist/types/dynamic-agent-types.d.ts +158 -0
  991. package/dist/types/dynamic-agent-types.d.ts.map +1 -0
  992. package/dist/types/dynamic-agent-types.js +473 -0
  993. package/dist/types/dynamic-agent-types.js.map +1 -0
  994. package/dist/types/generated/ossa-0.3.4.types.d.ts +63 -0
  995. package/dist/types/generated/ossa-0.3.4.types.d.ts.map +1 -1
  996. package/dist/types/generated/ossa-0.3.4.zod.d.ts +303 -0
  997. package/dist/types/generated/ossa-0.3.4.zod.d.ts.map +1 -1
  998. package/dist/types/generated/ossa-0.3.4.zod.js +92 -0
  999. package/dist/types/generated/ossa-0.3.4.zod.js.map +1 -1
  1000. package/dist/types/identity.zod.d.ts +20 -20
  1001. package/dist/types/index.d.ts +238 -1
  1002. package/dist/types/index.d.ts.map +1 -1
  1003. package/dist/types/index.js +7 -0
  1004. package/dist/types/index.js.map +1 -1
  1005. package/dist/types/personality.zod.d.ts +69 -69
  1006. package/dist/types/prompts.zod.d.ts +2 -2
  1007. package/dist/types/protocols.d.ts +158 -0
  1008. package/dist/types/protocols.d.ts.map +1 -0
  1009. package/dist/types/protocols.js +8 -0
  1010. package/dist/types/protocols.js.map +1 -0
  1011. package/dist/types/security.d.ts +123 -0
  1012. package/dist/types/security.d.ts.map +1 -0
  1013. package/dist/types/security.js +9 -0
  1014. package/dist/types/security.js.map +1 -0
  1015. package/dist/types/tool.d.ts +73 -0
  1016. package/dist/types/tool.d.ts.map +1 -0
  1017. package/dist/types/tool.js +66 -0
  1018. package/dist/types/tool.js.map +1 -0
  1019. package/dist/utils/logger.d.ts +82 -0
  1020. package/dist/utils/logger.d.ts.map +1 -0
  1021. package/dist/utils/logger.js +250 -0
  1022. package/dist/utils/logger.js.map +1 -0
  1023. package/dist/utils/version.d.ts +9 -9
  1024. package/dist/utils/version.d.ts.map +1 -1
  1025. package/dist/utils/version.js +11 -18
  1026. package/dist/utils/version.js.map +1 -1
  1027. package/dist/validation/error-codes.js +5 -5
  1028. package/dist/validation/error-codes.js.map +1 -1
  1029. package/dist/validation/index.d.ts +3 -0
  1030. package/dist/validation/index.d.ts.map +1 -1
  1031. package/dist/validation/index.js +6 -0
  1032. package/dist/validation/index.js.map +1 -1
  1033. package/dist/validation/linter.d.ts +3 -3
  1034. package/dist/validation/linter.js +4 -4
  1035. package/dist/validation/linter.js.map +1 -1
  1036. package/dist/validation/progressive-scorer.d.ts +123 -0
  1037. package/dist/validation/progressive-scorer.d.ts.map +1 -0
  1038. package/dist/validation/progressive-scorer.js +353 -0
  1039. package/dist/validation/progressive-scorer.js.map +1 -0
  1040. package/dist/validation/validation-context.d.ts +86 -0
  1041. package/dist/validation/validation-context.d.ts.map +1 -0
  1042. package/dist/validation/validation-context.js +138 -0
  1043. package/dist/validation/validation-context.js.map +1 -0
  1044. package/dist/validation/validator-registry.d.ts +158 -0
  1045. package/dist/validation/validator-registry.d.ts.map +1 -0
  1046. package/dist/validation/validator-registry.js +245 -0
  1047. package/dist/validation/validator-registry.js.map +1 -0
  1048. package/dist/validation/validator.d.ts +3 -3
  1049. package/dist/validation/validator.d.ts.map +1 -1
  1050. package/dist/validation/validator.js +4 -4
  1051. package/dist/validation/validator.js.map +1 -1
  1052. package/dist/version-management/api/server.d.ts.map +1 -1
  1053. package/dist/version-management/api/server.js.map +1 -1
  1054. package/dist/version-management/cli/index.js +8 -1
  1055. package/dist/version-management/cli/index.js.map +1 -1
  1056. package/dist/version-management/core/version-manager.d.ts.map +1 -1
  1057. package/dist/version-management/core/version-manager.js +5 -2
  1058. package/dist/version-management/core/version-manager.js.map +1 -1
  1059. package/dist/version-management/core/version-manager.test.js.map +1 -1
  1060. package/dist/version.d.ts +1 -1
  1061. package/dist/version.d.ts.map +1 -1
  1062. package/dist/version.js +10 -7
  1063. package/dist/version.js.map +1 -1
  1064. package/examples/a2a/agent-handoff.ossa.yaml +1 -1
  1065. package/examples/a2a/service-discovery.ossa.yaml +1 -1
  1066. package/examples/adapters/drupal-eca-mapping.yaml +1 -1
  1067. package/examples/adapters/drupal-eca-task.yaml +1 -1
  1068. package/examples/adapters/drupal-flowdrop-mapping.yaml +1 -1
  1069. package/examples/adapters/drupal-maestro-mapping.yaml +1 -1
  1070. package/examples/adapters/mistral-README.md +1 -1
  1071. package/examples/adapters/mistral-agent.yaml +1 -1
  1072. package/examples/adapters/symfony-messenger-task.yaml +1 -1
  1073. package/examples/adapters/symfony-messenger-workflow.yaml +1 -1
  1074. package/examples/adk-integration/code-review-workflow.yml +1 -1
  1075. package/examples/adk-integration/customer-support.yml +1 -1
  1076. package/examples/adk-integration/data-pipeline.yml +1 -1
  1077. package/examples/advanced/reasoning-agent.yaml +1 -1
  1078. package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
  1079. package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
  1080. package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
  1081. package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
  1082. package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
  1083. package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
  1084. package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
  1085. package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
  1086. package/examples/agent-manifests/v0.5-identity-security-protocols.ossa.yaml +159 -0
  1087. package/examples/agent-manifests/v0.5-minimal.ossa.yaml +37 -0
  1088. package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
  1089. package/examples/agent-mesh/DISCOVERY.md +679 -0
  1090. package/examples/agent-mesh/discovery-system.ts +670 -0
  1091. package/examples/agent-taxonomy-example.ossa.yaml +89 -0
  1092. package/examples/agents/01-customer-support-bot/agent.ossa.yaml +1 -1
  1093. package/examples/agents/02-code-review-agent/agent.ossa.yaml +50 -1
  1094. package/examples/agents/03-data-analysis-agent/agent.ossa.yaml +56 -1
  1095. package/examples/agents/04-content-moderator/agent.ossa.yaml +1 -1
  1096. package/examples/agents/05-sales-assistant/agent.ossa.yaml +1 -1
  1097. package/examples/agents/06-devops-agent/agent.ossa.yaml +48 -1
  1098. package/examples/agents/07-research-assistant/agent.ossa.yaml +62 -2
  1099. package/examples/agents/08-email-triage-agent/agent.ossa.yaml +1 -1
  1100. package/examples/agents/09-security-scanner/agent.ossa.yaml +47 -1
  1101. package/examples/agents/10-meeting-assistant/agent.ossa.yaml +1 -1
  1102. package/examples/agents/architecture-healer-enterprise.yaml +1 -1
  1103. package/examples/agents/dependency-healer-npm.yaml +1 -1
  1104. package/examples/agents/spec-healer-openapi.yaml +1 -1
  1105. package/examples/agents/wiki-healer-production.yaml +1 -1
  1106. package/examples/agents-md/monorepo-agent.ossa.yaml +1 -1
  1107. package/examples/autonomous-evolution/self-evolving-agent.ossa.yaml +1 -1
  1108. package/examples/build-once-use-everywhere/README.md +3 -3
  1109. package/examples/build-once-use-everywhere/agent.ossa.yaml +1 -1
  1110. package/examples/claude-code/code-reviewer.ossa.yaml +1 -1
  1111. package/examples/claude-code/ossa-validator.ossa.yaml +1 -1
  1112. package/examples/common_npm/agent-router.ossa.yaml +1 -1
  1113. package/examples/contracts/data-consumer.ossa.yaml +1 -1
  1114. package/examples/contracts/data-producer-v2.ossa.yaml +1 -1
  1115. package/examples/contracts/data-producer.ossa.yaml +1 -1
  1116. package/examples/deployment-workflow.md +601 -0
  1117. package/examples/drupal/QUICKSTART.md +8 -8
  1118. package/examples/drupal/content-moderator.ossa.yaml +1 -1
  1119. package/examples/drupal/gitlab-ml-recommender.ossa.yaml +1 -1
  1120. package/examples/export/langchain/production-agent-with-memory/agent.ossa.yaml +1 -1
  1121. package/examples/export/langchain/production-agent-with-tools/agent.ossa.yaml +1 -1
  1122. package/examples/extensions/agents-md-advanced.yml +1 -1
  1123. package/examples/extensions/agents-md-basic.yml +1 -1
  1124. package/examples/extensions/agents-md-sync.yml +1 -1
  1125. package/examples/extensions/agents-md-v1.yml +3 -3
  1126. package/examples/extensions/drupal-v1.yml +1 -1
  1127. package/examples/extensions/encryption-multi-provider.yaml +4 -4
  1128. package/examples/extensions/kagent-v1.yml +1 -1
  1129. package/examples/extensions/knowledge-sources.yaml +1 -1
  1130. package/examples/extensions/mcp-full-featured.yaml +1 -1
  1131. package/examples/getting-started/01-minimal-agent.ossa.yaml +1 -1
  1132. package/examples/getting-started/02-agent-with-tools.ossa.yaml +1 -1
  1133. package/examples/getting-started/03-agent-with-safety.ossa.yaml +1 -1
  1134. package/examples/getting-started/04-agent-with-messaging.ossa.yaml +1 -1
  1135. package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
  1136. package/examples/getting-started/hello-world-complete.ossa.yaml +2 -1
  1137. package/examples/gitlab-agents/DEPLOYMENT.md +331 -0
  1138. package/examples/gitlab-agents/daily-code-scan/.env.example +11 -0
  1139. package/examples/gitlab-agents/daily-code-scan/.gitlab-ci.yml +34 -0
  1140. package/examples/gitlab-agents/daily-code-scan/Dockerfile +18 -0
  1141. package/examples/gitlab-agents/daily-code-scan/README.md +80 -0
  1142. package/examples/gitlab-agents/daily-code-scan/package.json +28 -0
  1143. package/examples/gitlab-agents/daily-code-scan/src/gitlab-client.ts +135 -0
  1144. package/examples/gitlab-agents/daily-code-scan/src/index.ts +50 -0
  1145. package/examples/gitlab-agents/daily-code-scan/src/types.ts +22 -0
  1146. package/examples/gitlab-agents/daily-code-scan/src/workflow.ts +109 -0
  1147. package/examples/gitlab-agents/daily-code-scan/tsconfig.json +24 -0
  1148. package/examples/gitlab-agents/duo-comment-responder/.env.example +14 -0
  1149. package/examples/gitlab-agents/duo-comment-responder/.gitlab-ci.yml +34 -0
  1150. package/examples/gitlab-agents/duo-comment-responder/Dockerfile +18 -0
  1151. package/examples/gitlab-agents/duo-comment-responder/README.md +98 -0
  1152. package/examples/gitlab-agents/duo-comment-responder/package.json +29 -0
  1153. package/examples/gitlab-agents/duo-comment-responder/src/gitlab-client.ts +56 -0
  1154. package/examples/gitlab-agents/duo-comment-responder/src/index.ts +103 -0
  1155. package/examples/gitlab-agents/duo-comment-responder/src/llm-client.ts +75 -0
  1156. package/examples/gitlab-agents/duo-comment-responder/src/types.ts +22 -0
  1157. package/examples/gitlab-agents/duo-comment-responder/src/workflow.ts +135 -0
  1158. package/examples/gitlab-agents/duo-comment-responder/tsconfig.json +24 -0
  1159. package/examples/gitlab-agents/duo-comment-responder/webhook-config.json +11 -0
  1160. package/examples/gitlab-agents/k8s/deploy-all.yaml +341 -0
  1161. package/examples/gitlab-agents/mr-reviewer/.env.example +14 -0
  1162. package/examples/gitlab-agents/mr-reviewer/.gitlab-ci.yml +34 -0
  1163. package/examples/gitlab-agents/mr-reviewer/Dockerfile +18 -0
  1164. package/examples/gitlab-agents/mr-reviewer/README.md +98 -0
  1165. package/examples/gitlab-agents/mr-reviewer/package.json +29 -0
  1166. package/examples/gitlab-agents/mr-reviewer/src/gitlab-client.ts +136 -0
  1167. package/examples/gitlab-agents/mr-reviewer/src/index.ts +103 -0
  1168. package/examples/gitlab-agents/mr-reviewer/src/llm-client.ts +95 -0
  1169. package/examples/gitlab-agents/mr-reviewer/src/types.ts +22 -0
  1170. package/examples/gitlab-agents/mr-reviewer/src/workflow.ts +144 -0
  1171. package/examples/gitlab-agents/mr-reviewer/tsconfig.json +24 -0
  1172. package/examples/gitlab-agents/mr-reviewer/webhook-config.json +11 -0
  1173. package/examples/gitlab-agents/pipeline-auto-fix/.env.example +14 -0
  1174. package/examples/gitlab-agents/pipeline-auto-fix/.gitlab-ci.yml +34 -0
  1175. package/examples/gitlab-agents/pipeline-auto-fix/Dockerfile +18 -0
  1176. package/examples/gitlab-agents/pipeline-auto-fix/README.md +98 -0
  1177. package/examples/gitlab-agents/pipeline-auto-fix/package.json +29 -0
  1178. package/examples/gitlab-agents/pipeline-auto-fix/src/gitlab-client.ts +76 -0
  1179. package/examples/gitlab-agents/pipeline-auto-fix/src/index.ts +103 -0
  1180. package/examples/gitlab-agents/pipeline-auto-fix/src/llm-client.ts +79 -0
  1181. package/examples/gitlab-agents/pipeline-auto-fix/src/types.ts +22 -0
  1182. package/examples/gitlab-agents/pipeline-auto-fix/src/workflow.ts +146 -0
  1183. package/examples/gitlab-agents/pipeline-auto-fix/tsconfig.json +24 -0
  1184. package/examples/gitlab-agents/pipeline-auto-fix/webhook-config.json +11 -0
  1185. package/examples/gitlab-agents/pre-commit-quality-check/.env.example +11 -0
  1186. package/examples/gitlab-agents/pre-commit-quality-check/.gitlab-ci.yml +34 -0
  1187. package/examples/gitlab-agents/pre-commit-quality-check/Dockerfile +18 -0
  1188. package/examples/gitlab-agents/pre-commit-quality-check/README.md +80 -0
  1189. package/examples/gitlab-agents/pre-commit-quality-check/package.json +28 -0
  1190. package/examples/gitlab-agents/pre-commit-quality-check/src/gitlab-client.ts +20 -0
  1191. package/examples/gitlab-agents/pre-commit-quality-check/src/index.ts +50 -0
  1192. package/examples/gitlab-agents/pre-commit-quality-check/src/types.ts +22 -0
  1193. package/examples/gitlab-agents/pre-commit-quality-check/src/workflow.ts +63 -0
  1194. package/examples/gitlab-agents/pre-commit-quality-check/tsconfig.json +24 -0
  1195. package/examples/gitlab-agents/pre-push-validation/.env.example +11 -0
  1196. package/examples/gitlab-agents/pre-push-validation/.gitlab-ci.yml +34 -0
  1197. package/examples/gitlab-agents/pre-push-validation/Dockerfile +18 -0
  1198. package/examples/gitlab-agents/pre-push-validation/README.md +80 -0
  1199. package/examples/gitlab-agents/pre-push-validation/package.json +28 -0
  1200. package/examples/gitlab-agents/pre-push-validation/src/gitlab-client.ts +20 -0
  1201. package/examples/gitlab-agents/pre-push-validation/src/index.ts +50 -0
  1202. package/examples/gitlab-agents/pre-push-validation/src/types.ts +22 -0
  1203. package/examples/gitlab-agents/pre-push-validation/src/workflow.ts +63 -0
  1204. package/examples/gitlab-agents/pre-push-validation/tsconfig.json +24 -0
  1205. package/examples/gitlab-duo/EXTERNAL_AGENTS.md +466 -0
  1206. package/examples/gitlab-duo/README.md +307 -0
  1207. package/examples/gitlab-duo/code-review-flow.yaml +62 -0
  1208. package/examples/gitlab-duo/external-agent-example.ts +192 -0
  1209. package/examples/gitlab-duo/generated/custom-vars-agent.yaml +45 -0
  1210. package/examples/gitlab-duo/generated/go-agent.yaml +41 -0
  1211. package/examples/gitlab-duo/generated/python-agent.yaml +43 -0
  1212. package/examples/gitlab-duo/generated/webhook-agent.yaml +52 -0
  1213. package/examples/hierarchical-agent.ossa.yaml +126 -0
  1214. package/examples/hierarchical-crewai.ossa.yaml +96 -0
  1215. package/examples/infrastructure/token-rotation/README.md +117 -0
  1216. package/examples/infrastructure/token-rotation/manifest.ossa.yaml +73 -0
  1217. package/examples/infrastructure/token-rotation/openapi.yaml +133 -0
  1218. package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +1 -1
  1219. package/examples/kagent/compliance-validator.ossa.yaml +1 -1
  1220. package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
  1221. package/examples/kagent/documentation-agent.ossa.yaml +1 -1
  1222. package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +1 -1
  1223. package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
  1224. package/examples/kagent/security-scanner.ossa.yaml +1 -1
  1225. package/examples/knowledge-graph/drupal-agent-with-kg.ossa.yaml +289 -0
  1226. package/examples/mcp/browser-puppeteer.ossa.yaml +232 -0
  1227. package/examples/mcp/database-mcp.ossa.yaml +1 -1
  1228. package/examples/mcp/filesystem-mcp.ossa.yaml +1 -1
  1229. package/examples/messaging/dependency-healer.ossa.yaml +1 -1
  1230. package/examples/messaging/incident-responder.ossa.yaml +1 -1
  1231. package/examples/messaging/routing-rules.ossa.yaml +1 -1
  1232. package/examples/messaging/security-scanner.ossa.yaml +1 -1
  1233. package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
  1234. package/examples/migrations/langchain/01-python-react-agent-after.ossa.yaml +1 -1
  1235. package/examples/migrations/langchain/02-typescript-conversational-after.ossa.yaml +1 -1
  1236. package/examples/migrations/langchain/03-sequential-chain-after.ossa.yaml +1 -1
  1237. package/examples/migrations/langchain/04-config-based-after.ossa.yaml +1 -1
  1238. package/examples/migrations/langchain/USAGE.txt +1 -1
  1239. package/examples/migrations/swarm-to-ossa/QUICKSTART.md +3 -3
  1240. package/examples/migrations/swarm-to-ossa/after-handoffs.ossa.yaml +6 -6
  1241. package/examples/migrations/swarm-to-ossa/after-triage-agent.ossa.yaml +3 -3
  1242. package/examples/minimal/agent.yml +1 -1
  1243. package/examples/mr-reviewer-with-governance.ossa.yaml +130 -0
  1244. package/examples/multi-agent/conditional-router.ossa.yaml +1 -1
  1245. package/examples/multi-agent/parallel-execution.ossa.yaml +1 -1
  1246. package/examples/multi-agent/sequential-pipeline.ossa.yaml +1 -1
  1247. package/examples/multi-agent-research-workflow.ossa.yaml +1 -1
  1248. package/examples/multi-platform/single-manifest/agent.ossa.yaml +1 -1
  1249. package/examples/observability/activity-stream-full.yaml +1 -1
  1250. package/examples/openai/basic-agent.ossa.yaml +1 -1
  1251. package/examples/ossa-templates/01-code-assistant.ossa.yaml +1 -1
  1252. package/examples/ossa-templates/02-security-scanner.ossa.yaml +1 -1
  1253. package/examples/ossa-templates/03-ci-pipeline.ossa.yaml +1 -1
  1254. package/examples/ossa-templates/04-code-reviewer.ossa.yaml +1 -1
  1255. package/examples/ossa-templates/05-doc-generator.ossa.yaml +1 -1
  1256. package/examples/ossa-templates/06-compliance-validator.ossa.yaml +1 -1
  1257. package/examples/ossa-templates/07-workflow-orchestrator.ossa.yaml +1 -1
  1258. package/examples/ossa-templates/08-content-writer.ossa.yaml +1 -1
  1259. package/examples/ossa-templates/09-test-generator.ossa.yaml +1 -1
  1260. package/examples/ossa-templates/10-data-transformer.ossa.yaml +1 -1
  1261. package/examples/ossa-templates/11-react-performance-expert.ossa.yaml +1 -1
  1262. package/examples/ossa-templates/12-typescript-type-safety-expert.ossa.yaml +1 -1
  1263. package/examples/ossa-templates/13-accessibility-champion.ossa.yaml +1 -1
  1264. package/examples/ossa-templates/14-security-hardening-agent.ossa.yaml +1 -1
  1265. package/examples/pipeline-agent.ossa.yaml +196 -0
  1266. package/examples/platform-specific/claude-code-subagent.yaml +185 -0
  1267. package/examples/platform-specific/cursor-coding-agent.yaml +175 -0
  1268. package/examples/platform-specific/warp-terminal-agent.yaml +122 -0
  1269. package/examples/production/document-analyzer-openai.yml +1 -1
  1270. package/examples/production-ready/01-customer-support-bot/agent.ossa.yaml +1 -1
  1271. package/examples/production-ready/02-code-review-agent/agent.ossa.yaml +1 -1
  1272. package/examples/production-ready/03-data-analysis-agent/agent.ossa.yaml +1 -1
  1273. package/examples/production-ready/04-content-moderator/agent.ossa.yaml +1 -1
  1274. package/examples/production-ready/05-sales-assistant/agent.ossa.yaml +1 -1
  1275. package/examples/production-ready/06-devops-agent/agent.ossa.yaml +1 -1
  1276. package/examples/production-ready/07-research-assistant/agent.ossa.yaml +1 -1
  1277. package/examples/production-ready/08-email-triage-agent/agent.ossa.yaml +1 -1
  1278. package/examples/production-ready/09-security-scanner/agent.ossa.yaml +1 -1
  1279. package/examples/production-ready/10-meeting-assistant/agent.ossa.yaml +1 -1
  1280. package/examples/quickstart/support-agent.ossa.yaml +1 -1
  1281. package/examples/real-world/gitlab-cicd-optimizer.ossa.yaml +1 -1
  1282. package/examples/real-world/rag-documentation-assistant.ossa.yaml +1 -1
  1283. package/examples/reference-implementations/python-client/README.md +2 -2
  1284. package/examples/reference-implementations/typescript-client/README.md +1 -1
  1285. package/examples/registry/agents/code-reviewer/agent.yaml +1 -1
  1286. package/examples/registry/agents/security-scanner/agent.yaml +1 -1
  1287. package/examples/runtime-adapters/bedrock-claude-example.ossa.yaml +1 -1
  1288. package/examples/schema/reusable-components.yaml +1 -1
  1289. package/examples/showcase/PRODUCTION_EXAMPLES.md +499 -0
  1290. package/examples/showcase/ci-pipeline.ossa.yaml +1 -1
  1291. package/examples/showcase/code-assistant.ossa.yaml +1 -1
  1292. package/examples/showcase/code-reviewer.ossa.yaml +1 -1
  1293. package/examples/showcase/compliance-checker.ossa.yaml +207 -0
  1294. package/examples/showcase/compliance-validator.ossa.yaml +1 -1
  1295. package/examples/showcase/content-writer.ossa.yaml +1 -1
  1296. package/examples/showcase/customer-support.ossa.yaml +344 -0
  1297. package/examples/showcase/data-processing-pipeline.ossa.yaml +254 -0
  1298. package/examples/showcase/data-transformer.ossa.yaml +1 -1
  1299. package/examples/showcase/doc-generator.ossa.yaml +1 -1
  1300. package/examples/showcase/full-power-agent.ossa.yaml +350 -0
  1301. package/examples/showcase/security-scanner-enhanced.ossa.yaml +304 -0
  1302. package/examples/showcase/security-scanner.ossa.yaml +1 -1
  1303. package/examples/showcase/team-leader.ossa.yaml +306 -0
  1304. package/examples/showcase/test-generator.ossa.yaml +1 -1
  1305. package/examples/showcase/workflow-orchestrator.ossa.yaml +1 -1
  1306. package/examples/single-agent.ossa.yaml +40 -0
  1307. package/examples/skills-example.ossa.yaml +1 -1
  1308. package/examples/subagents-pipeline.ossa.yaml +76 -0
  1309. package/examples/swarm-agent.ossa.yaml +136 -0
  1310. package/examples/swarm-handoff.ossa.yaml +67 -0
  1311. package/examples/tasks/batch-email-sender.yaml +1 -1
  1312. package/examples/tasks/data-transform.yaml +1 -1
  1313. package/examples/tasks/publish-content.yaml +1 -1
  1314. package/examples/team-agent.ossa.yaml +159 -0
  1315. package/examples/team-lead-teammate.ossa.yaml +83 -0
  1316. package/examples/templates/ossa-compliance.yaml +1 -1
  1317. package/examples/unified/security-scanner.ossa.yaml +1 -1
  1318. package/examples/workflows/batch-email-campaign.yaml +1 -1
  1319. package/examples/workflows/content-review-publish.yaml +1 -1
  1320. package/examples/workflows/simple-etl.yaml +1 -1
  1321. package/openapi/agents-md-service.yaml +1 -1
  1322. package/openapi/core/unified-agent-gateway.openapi.yaml +1 -1
  1323. package/openapi/ossa-cli-enhancements.openapi.yaml +3 -3
  1324. package/openapi/ossa-cli.yaml +1 -1
  1325. package/openapi/protocols/sse-streams.yaml +1 -1
  1326. package/openapi/protocols/websocket-events.yaml +2 -2
  1327. package/openapi/release-automation.openapi.yaml +1 -1
  1328. package/package.json +49 -28
  1329. package/spec/extensions/knowledge-graph/knowledge-graph.schema.json +386 -0
  1330. package/spec/extensions/manifest-extensions.md +2 -2
  1331. package/spec/registry/README.md +1 -1
  1332. package/spec/registry/registry-spec.md +4 -4
  1333. package/spec/v0.4/agent-card.schema.json +390 -0
  1334. package/spec/v0.4/agent.schema.json +952 -39
  1335. package/spec/v0.4/extensions/drupal/drupal.schema.json +77 -0
  1336. package/spec/v0.4/extensions/evals/evals.schema.json +597 -0
  1337. package/spec/v0.4/extensions/governance/governance-extension.yaml +161 -0
  1338. package/spec/v0.4/extensions/identity/identity.schema.json +302 -0
  1339. package/spec/v0.4/extensions/kagent/README.md +1 -1
  1340. package/spec/v0.4/extensions/team/team.schema.json +304 -0
  1341. package/spec/v0.4/validator.schema.json +282 -0
  1342. package/spec/v0.5/agent.schema.json +768 -0
  1343. package/templates/agent-types/claude-agent.ossa.yaml +83 -0
  1344. package/templates/agent-types/kagent.ossa.yaml +110 -0
  1345. package/templates/agent-types/langchain-agent.ossa.yaml +106 -0
  1346. package/templates/agent-types/openapi-agent.ossa.yaml +121 -0
  1347. package/templates/agent-types/swarm-agents.ossa.yaml +168 -0
  1348. package/templates/ci-cd/github-actions.deploy.yml +272 -0
  1349. package/templates/ci-cd/gitlab-ci.deploy.yml +205 -0
  1350. package/templates/validators/capability-compatibility.ossa.yaml +174 -0
  1351. package/templates/validators/coordination-consistency.ossa.yaml +160 -0
  1352. package/templates/validators/pattern-requirements.ossa.yaml +182 -0
  1353. package/templates/validators/transport-compatibility.ossa.yaml +185 -0
  1354. package/.wiki-config.json +0 -24
  1355. package/DEMO.md +0 -212
  1356. package/dist/adapters/anthropic/runtime.d.ts +0 -136
  1357. package/dist/adapters/anthropic/runtime.d.ts.map +0 -1
  1358. package/dist/adapters/anthropic/runtime.js +0 -290
  1359. package/dist/adapters/anthropic/runtime.js.map +0 -1
  1360. package/dist/cli/commands/agent-create.command.d.ts +0 -18
  1361. package/dist/cli/commands/agent-create.command.d.ts.map +0 -1
  1362. package/dist/cli/commands/agent-create.command.js +0 -437
  1363. package/dist/cli/commands/agent-create.command.js.map +0 -1
  1364. package/dist/cli/commands/catalog/diff.command.d.ts +0 -8
  1365. package/dist/cli/commands/catalog/diff.command.d.ts.map +0 -1
  1366. package/dist/cli/commands/catalog/diff.command.js +0 -76
  1367. package/dist/cli/commands/catalog/diff.command.js.map +0 -1
  1368. package/dist/cli/commands/catalog/pull.command.d.ts +0 -8
  1369. package/dist/cli/commands/catalog/pull.command.d.ts.map +0 -1
  1370. package/dist/cli/commands/catalog/pull.command.js +0 -87
  1371. package/dist/cli/commands/catalog/pull.command.js.map +0 -1
  1372. package/dist/cli/commands/catalog/push.command.d.ts +0 -8
  1373. package/dist/cli/commands/catalog/push.command.d.ts.map +0 -1
  1374. package/dist/cli/commands/catalog/push.command.js +0 -98
  1375. package/dist/cli/commands/catalog/push.command.js.map +0 -1
  1376. package/dist/cli/commands/catalog/sync.command.d.ts +0 -8
  1377. package/dist/cli/commands/catalog/sync.command.d.ts.map +0 -1
  1378. package/dist/cli/commands/catalog/sync.command.js +0 -69
  1379. package/dist/cli/commands/catalog/sync.command.js.map +0 -1
  1380. package/dist/cli/commands/setup.command.d.ts +0 -11
  1381. package/dist/cli/commands/setup.command.d.ts.map +0 -1
  1382. package/dist/cli/commands/setup.command.js +0 -354
  1383. package/dist/cli/commands/setup.command.js.map +0 -1
  1384. package/dist/spec/v0.3/CHANGELOG.md +0 -237
  1385. package/dist/spec/v0.3/MIGRATION-v0.3.4-to-v0.3.5.md +0 -292
  1386. package/dist/spec/v0.3/MIGRATION-v0.3.5-to-v0.3.6.md +0 -552
  1387. package/dist/spec/v0.3/README.md +0 -366
  1388. package/dist/spec/v0.3/adoption-blockers.json +0 -142
  1389. package/dist/spec/v0.3/bat-framework.schema.json +0 -114
  1390. package/dist/spec/v0.3/capability-discovery.schema.json +0 -128
  1391. package/dist/spec/v0.3/checkpoint.schema.json +0 -132
  1392. package/dist/spec/v0.3/completion-signals.schema.json +0 -136
  1393. package/dist/spec/v0.3/conformance/IMPLEMENTATION.md +0 -402
  1394. package/dist/spec/v0.3/conformance/PROFILES.md +0 -210
  1395. package/dist/spec/v0.3/conformance/README.md +0 -263
  1396. package/dist/spec/v0.3/conformance/profiles/baseline.json +0 -27
  1397. package/dist/spec/v0.3/conformance/profiles/enterprise.json +0 -33
  1398. package/dist/spec/v0.3/conformance/profiles/gitlab-kagent.json +0 -36
  1399. package/dist/spec/v0.3/conformance/tests/baseline/invalid/missing-identity.yaml +0 -6
  1400. package/dist/spec/v0.3/conformance/tests/baseline/invalid/missing-kind.yaml +0 -7
  1401. package/dist/spec/v0.3/conformance/tests/baseline/valid/basic-agent.yaml +0 -22
  1402. package/dist/spec/v0.3/conformance/tests/baseline/valid/minimal-agent.yaml +0 -15
  1403. package/dist/spec/v0.3/conformance/tests/enterprise/valid/enterprise-agent.yaml +0 -88
  1404. package/dist/spec/v0.3/conformance/tests/enterprise/valid/production-agent.yaml +0 -112
  1405. package/dist/spec/v0.3/conformance/tests/gitlab-kagent/valid/kagent-agent.yaml +0 -117
  1406. package/dist/spec/v0.3/conformance/tests/gitlab-kagent/valid/kagent-full.yaml +0 -125
  1407. package/dist/spec/v0.3/examples/checkpoint-example.ossa.yaml +0 -81
  1408. package/dist/spec/v0.3/examples/flow-example.ossa.yaml +0 -119
  1409. package/dist/spec/v0.3/examples/forward-thinking-agent.ossa.yaml +0 -294
  1410. package/dist/spec/v0.3/examples/moe-example.ossa.yaml +0 -120
  1411. package/dist/spec/v0.3/extensions/a2a/README.md +0 -193
  1412. package/dist/spec/v0.3/extensions/a2a/a2a.schema.json +0 -77
  1413. package/dist/spec/v0.3/extensions/ag2/ag2.schema.json +0 -277
  1414. package/dist/spec/v0.3/extensions/crewai/crewai.schema.json +0 -256
  1415. package/dist/spec/v0.3/extensions/kagent/README.md +0 -315
  1416. package/dist/spec/v0.3/extensions/kagent/kagent.schema.json +0 -624
  1417. package/dist/spec/v0.3/extensions/langchain/langchain.schema.json +0 -243
  1418. package/dist/spec/v0.3/extensions/langgraph/langgraph.schema.json +0 -211
  1419. package/dist/spec/v0.3/extensions/mcp/README.md +0 -276
  1420. package/dist/spec/v0.3/extensions/mcp/mcp.schema.json +0 -84
  1421. package/dist/spec/v0.3/feedback-loops.schema.json +0 -145
  1422. package/dist/spec/v0.3/flow-kind.schema.json +0 -244
  1423. package/dist/spec/v0.3/infrastructure-substrate.schema.json +0 -190
  1424. package/dist/spec/v0.3/mixture-of-experts.schema.json +0 -159
  1425. package/dist/spec/v0.3/moe-metrics.schema.json +0 -162
  1426. package/dist/spec/v0.3/ossa-0.3.5.schema.json +0 -13534
  1427. package/dist/spec/v0.3/ossa-0.3.6.schema.json +0 -14920
  1428. package/dist/spec/v0.3/ossa-v0.3.schema.json +0 -15824
  1429. package/dist/spec/v0.3/registry/registry-contract.schema.json +0 -359
  1430. package/dist/spec/v0.3.6/CHANGELOG.md +0 -171
  1431. package/dist/spec/v0.3.6/README.md +0 -382
  1432. package/dist/spec/v0.3.6/taxonomy.yaml +0 -506
  1433. package/examples/bridges/__pycache__/test_aiflow_integration.cpython-313.pyc +0 -0
  1434. package/examples/migrations/swarm-to-ossa/before-handoffs.py +0 -373
  1435. package/examples/v0.3.6/full-featured-v0.3.6.ossa.yaml +0 -304
  1436. package/examples/v0.3.6/gitlab-duo-composite-identity.ossa.yaml +0 -119
  1437. package/examples/v0.3.6/knowledge-graph-integration.ossa.yaml +0 -109
  1438. package/examples/v0.3.6/token-efficiency-economy.ossa.yaml +0 -111
  1439. package/examples/v0.3.6-features/README.md +0 -433
  1440. package/examples/v0.3.6-features/genetics-breeding-advanced.ossa.yaml +0 -496
  1441. package/examples/v0.3.6-features/genetics-breeding-simple.ossa.yaml +0 -304
  1442. package/examples/v0.3.6-features/genetics-fitness-scoring.ossa.yaml +0 -551
  1443. package/junit.xml +0 -1469
  1444. package/llms-ctx-full.txt +0 -41
  1445. package/llms-ctx.txt +0 -41
  1446. package/schemas/capability-contract.v0.json +0 -116
  1447. package/schemas/identity.lock.schema.json +0 -59
  1448. package/schemas/identity.plan.schema.json +0 -132
  1449. package/spec/v0.3/CHANGELOG.md +0 -237
  1450. package/spec/v0.3/MIGRATION-v0.3.4-to-v0.3.5.md +0 -292
  1451. package/spec/v0.3/MIGRATION-v0.3.5-to-v0.3.6.md +0 -552
  1452. package/spec/v0.3/README.md +0 -366
  1453. package/spec/v0.3/adoption-blockers.json +0 -142
  1454. package/spec/v0.3/bat-framework.schema.json +0 -114
  1455. package/spec/v0.3/capability-discovery.schema.json +0 -128
  1456. package/spec/v0.3/checkpoint.schema.json +0 -132
  1457. package/spec/v0.3/completion-signals.schema.json +0 -136
  1458. package/spec/v0.3/conformance/IMPLEMENTATION.md +0 -402
  1459. package/spec/v0.3/conformance/PROFILES.md +0 -210
  1460. package/spec/v0.3/conformance/README.md +0 -263
  1461. package/spec/v0.3/conformance/profiles/baseline.json +0 -27
  1462. package/spec/v0.3/conformance/profiles/enterprise.json +0 -33
  1463. package/spec/v0.3/conformance/profiles/gitlab-kagent.json +0 -36
  1464. package/spec/v0.3/conformance/tests/baseline/invalid/missing-identity.yaml +0 -6
  1465. package/spec/v0.3/conformance/tests/baseline/invalid/missing-kind.yaml +0 -7
  1466. package/spec/v0.3/conformance/tests/baseline/valid/basic-agent.yaml +0 -22
  1467. package/spec/v0.3/conformance/tests/baseline/valid/minimal-agent.yaml +0 -15
  1468. package/spec/v0.3/conformance/tests/enterprise/valid/enterprise-agent.yaml +0 -88
  1469. package/spec/v0.3/conformance/tests/enterprise/valid/production-agent.yaml +0 -112
  1470. package/spec/v0.3/conformance/tests/gitlab-kagent/valid/kagent-agent.yaml +0 -117
  1471. package/spec/v0.3/conformance/tests/gitlab-kagent/valid/kagent-full.yaml +0 -125
  1472. package/spec/v0.3/examples/checkpoint-example.ossa.yaml +0 -81
  1473. package/spec/v0.3/examples/flow-example.ossa.yaml +0 -119
  1474. package/spec/v0.3/examples/forward-thinking-agent.ossa.yaml +0 -294
  1475. package/spec/v0.3/examples/moe-example.ossa.yaml +0 -120
  1476. package/spec/v0.3/extensions/a2a/README.md +0 -193
  1477. package/spec/v0.3/extensions/a2a/a2a.schema.json +0 -77
  1478. package/spec/v0.3/extensions/ag2/ag2.schema.json +0 -277
  1479. package/spec/v0.3/extensions/crewai/crewai.schema.json +0 -256
  1480. package/spec/v0.3/extensions/kagent/README.md +0 -315
  1481. package/spec/v0.3/extensions/kagent/kagent.schema.json +0 -624
  1482. package/spec/v0.3/extensions/langchain/langchain.schema.json +0 -243
  1483. package/spec/v0.3/extensions/langgraph/langgraph.schema.json +0 -211
  1484. package/spec/v0.3/extensions/mcp/README.md +0 -276
  1485. package/spec/v0.3/extensions/mcp/mcp.schema.json +0 -84
  1486. package/spec/v0.3/feedback-loops.schema.json +0 -145
  1487. package/spec/v0.3/flow-kind.schema.json +0 -244
  1488. package/spec/v0.3/infrastructure-substrate.schema.json +0 -190
  1489. package/spec/v0.3/mixture-of-experts.schema.json +0 -159
  1490. package/spec/v0.3/moe-metrics.schema.json +0 -162
  1491. package/spec/v0.3/ossa-0.3.5.schema.json +0 -13534
  1492. package/spec/v0.3/ossa-0.3.6.schema.json +0 -14920
  1493. package/spec/v0.3/ossa-v0.3.schema.json +0 -15824
  1494. package/spec/v0.3/registry/registry-contract.schema.json +0 -359
  1495. package/spec/v0.3.6/CHANGELOG.md +0 -171
  1496. package/spec/v0.3.6/README.md +0 -382
  1497. package/spec/v0.3.6/taxonomy.yaml +0 -506
  1498. package/templates/agent-types/analyzer/cost-analyzer.yaml +0 -38
  1499. package/templates/agent-types/analyzer/performance-profiler.yaml +0 -38
  1500. package/templates/agent-types/analyzer/security-scanner.yaml +0 -36
  1501. package/templates/agent-types/backend/api-validator.yaml +0 -37
  1502. package/templates/agent-types/backend/load-balancer.yaml +0 -39
  1503. package/templates/agent-types/content/content-generator.yaml +0 -40
  1504. package/templates/agent-types/content/seo-optimizer.yaml +0 -39
  1505. package/templates/agent-types/data/data-processor.yaml +0 -38
  1506. package/templates/agent-types/data/report-generator.yaml +0 -40
  1507. package/templates/agent-types/development/code-generator.yaml +0 -39
  1508. package/templates/agent-types/development/dependency-updater.yaml +0 -38
  1509. package/templates/agent-types/frontend/accessibility-checker.yaml +0 -38
  1510. package/templates/agent-types/frontend/ui-tester.yaml +0 -38
  1511. package/templates/agent-types/infrastructure/deployment-automator.yaml +0 -39
  1512. package/templates/agent-types/infrastructure/resource-optimizer.yaml +0 -38
  1513. package/templates/agent-types/monitor/health-checker.yaml +0 -37
  1514. package/templates/agent-types/monitor/log-analyzer.yaml +0 -37
  1515. package/templates/agent-types/orchestrator/multi-agent-coordinator.yaml +0 -38
  1516. package/templates/agent-types/orchestrator/workflow-manager.yaml +0 -39
  1517. package/templates/agent-types/security/compliance-checker.yaml +0 -38
  1518. package/templates/agent-types/security/vulnerability-scanner.yaml +0 -38
  1519. package/templates/agent-types/worker/api-tester.yaml +0 -43
  1520. package/templates/agent-types/worker/code-reviewer.yaml +0 -39
  1521. package/templates/agent-types/worker/database-migrator.yaml +0 -38
  1522. package/templates/platforms/cursor/code-assistant/manifest.ossa.yaml +0 -40
  1523. package/templates/platforms/drupal/content-agent/manifest.ossa.yaml +0 -39
  1524. package/templates/platforms/gitlab/ci-agent/manifest.ossa.yaml +0 -41
  1525. package/templates/platforms/kubernetes/operator-agent/manifest.ossa.yaml +0 -39
  1526. package/templates/platforms/langflow/workflow-agent/manifest.ossa.yaml +0 -38
@@ -0,0 +1,2401 @@
1
+ /**
2
+ * GitLab Duo Package Generator
3
+ * Orchestrates complete GitLab Duo agent package generation from OSSA manifests
4
+ *
5
+ * Extends BasePackageGenerator for shared npm package logic
6
+ *
7
+ * Generates complete directory structure (30+ files):
8
+ * {agent-name}-gitlab-duo/
9
+ * ├── .gitlab/duo/
10
+ * │ ├── flows/main.yaml, error.yaml, monitor.yaml, governance.yaml
11
+ * │ ├── agents/{name}.yaml
12
+ * │ ├── triggers/mention.yaml, assign.yaml, assign_reviewer.yaml,
13
+ * │ │ schedule.yaml, pipeline.yaml, webhook.yaml, file_pattern.yaml
14
+ * │ ├── routers/conditional.yaml, multi-agent.yaml
15
+ * │ ├── mcp-config.yaml
16
+ * │ ├── mcp-config.json
17
+ * │ ├── custom-tools.json
18
+ * │ └── AGENTS.md
19
+ * ├── src/
20
+ * ├── Dockerfile
21
+ * ├── package.json
22
+ * ├── README.md
23
+ * ├── DEPLOYMENT.md
24
+ * └── agent.ossa.yaml
25
+ */
26
+ import * as fs from 'fs/promises';
27
+ import * as path from 'path';
28
+ import YAML from 'yaml';
29
+ import { BasePackageGenerator } from '../npm/package-generator.js';
30
+ import { GitLabDuoFlowGenerator } from './flow-generator.js';
31
+ import { ExternalAgentGenerator } from './external-agent-generator.js';
32
+ import { GitLabDuoTriggerGenerator } from './trigger-generator.js';
33
+ import { GitLabDuoRouterGenerator } from './router-generator.js';
34
+ export class GitLabDuoPackageGenerator extends BasePackageGenerator {
35
+ flowGenerator;
36
+ externalAgentGenerator;
37
+ triggerGenerator;
38
+ routerGenerator;
39
+ constructor() {
40
+ super();
41
+ this.flowGenerator = new GitLabDuoFlowGenerator();
42
+ this.externalAgentGenerator = new ExternalAgentGenerator();
43
+ this.triggerGenerator = new GitLabDuoTriggerGenerator();
44
+ this.routerGenerator = new GitLabDuoRouterGenerator();
45
+ }
46
+ /**
47
+ * Generate complete GitLab Duo agent package
48
+ */
49
+ async generate(manifest, options) {
50
+ const errors = [];
51
+ try {
52
+ // Validate manifest
53
+ const validation = this.validateManifest(manifest);
54
+ if (!validation.valid) {
55
+ return {
56
+ success: false,
57
+ errors: validation.errors,
58
+ };
59
+ }
60
+ const agentName = this.getAgentName(manifest);
61
+ const packagePath = path.join(options.outputDir, `${agentName}-gitlab-duo`);
62
+ // Check if package already exists
63
+ if (!options.overwrite) {
64
+ try {
65
+ await fs.access(packagePath);
66
+ return {
67
+ success: false,
68
+ errors: [
69
+ `Package directory already exists: ${packagePath}. Use overwrite option to replace.`,
70
+ ],
71
+ };
72
+ }
73
+ catch {
74
+ // Directory doesn't exist, continue
75
+ }
76
+ }
77
+ // Generate all files
78
+ const files = await this.generateAllFiles(manifest, options);
79
+ // Create directory structure and write files
80
+ const generatedFiles = await this.writeFiles(packagePath, files);
81
+ return {
82
+ success: true,
83
+ packagePath,
84
+ generatedFiles,
85
+ };
86
+ }
87
+ catch (error) {
88
+ errors.push(error instanceof Error ? error.message : String(error));
89
+ return {
90
+ success: false,
91
+ errors,
92
+ };
93
+ }
94
+ }
95
+ /**
96
+ * Validate manifest before generation
97
+ */
98
+ validateManifest(manifest) {
99
+ const errors = [];
100
+ if (!manifest.metadata?.name) {
101
+ errors.push('Manifest must have metadata.name');
102
+ }
103
+ if (!manifest.spec) {
104
+ errors.push('Manifest must have spec section');
105
+ }
106
+ if (!manifest.spec?.role) {
107
+ errors.push('Manifest must have spec.role');
108
+ }
109
+ return {
110
+ valid: errors.length === 0,
111
+ errors,
112
+ };
113
+ }
114
+ /**
115
+ * Get sanitized agent name from manifest
116
+ * Overrides base class to support legacy manifest.agent.name fallback
117
+ */
118
+ getAgentName(manifest) {
119
+ const name = manifest.metadata?.name || manifest.agent?.name || 'agent';
120
+ return this.sanitizePackageName(name);
121
+ }
122
+ /**
123
+ * Generate all package files
124
+ *
125
+ * Generates a comprehensive GitLab Duo agent package:
126
+ * - 4 flows (main, error, monitor, governance)
127
+ * - 7 triggers (mention, assign, assign_reviewer, schedule, pipeline, webhook, file_pattern)
128
+ * - 2 routers (conditional, multi-agent)
129
+ * - 1 MCP config YAML
130
+ * - Agent definition, tools, documentation, and deployment files
131
+ */
132
+ async generateAllFiles(manifest, options) {
133
+ const files = [];
134
+ const agentName = this.getAgentName(manifest);
135
+ // ── Flows (4 files) ──────────────────────────────────────
136
+ const flowFiles = this.flowGenerator.generateAllFlowFiles(manifest);
137
+ for (const [fileName, content] of flowFiles.entries()) {
138
+ files.push({
139
+ path: `.gitlab/duo/flows/${fileName}`,
140
+ content,
141
+ });
142
+ }
143
+ // ── External Agent YAML ──────────────────────────────────
144
+ const externalAgentResult = this.externalAgentGenerator.generate(manifest);
145
+ if (externalAgentResult.success && externalAgentResult.yaml) {
146
+ files.push({
147
+ path: `.gitlab/duo/agents/${agentName}.yaml`,
148
+ content: externalAgentResult.yaml,
149
+ });
150
+ }
151
+ // ── Triggers (7 files - all types) ───────────────────────
152
+ const triggerFiles = this.triggerGenerator.generateAllTriggerFiles(manifest);
153
+ for (const [fileName, content] of triggerFiles.entries()) {
154
+ files.push({
155
+ path: `.gitlab/duo/triggers/${fileName}`,
156
+ content,
157
+ });
158
+ }
159
+ // ── Routers (2 files) ────────────────────────────────────
160
+ const routerFiles = this.routerGenerator.generateAllRouterFiles(manifest);
161
+ for (const [fileName, content] of routerFiles.entries()) {
162
+ files.push({
163
+ path: `.gitlab/duo/routers/${fileName}`,
164
+ content,
165
+ });
166
+ }
167
+ // ── MCP Configuration (YAML) ─────────────────────────────
168
+ files.push({
169
+ path: `.gitlab/duo/mcp-config.yaml`,
170
+ content: this.generateMCPConfigYAML(manifest),
171
+ });
172
+ // ── MCP Configuration (JSON - for tooling compatibility) ─
173
+ files.push({
174
+ path: `.gitlab/duo/mcp-config.json`,
175
+ content: this.generateMCPConfig(manifest),
176
+ });
177
+ // ── Custom Tools Definition ──────────────────────────────
178
+ files.push({
179
+ path: `.gitlab/duo/custom-tools.json`,
180
+ content: this.generateCustomTools(manifest),
181
+ });
182
+ // ── AGENTS.md ────────────────────────────────────────────
183
+ files.push({
184
+ path: `.gitlab/duo/AGENTS.md`,
185
+ content: this.generateAgentsMd(manifest),
186
+ });
187
+ // ── OSSA manifest ────────────────────────────────────────
188
+ files.push({
189
+ path: 'agent.ossa.yaml',
190
+ content: this.generateOssaManifest(manifest),
191
+ });
192
+ // ── Documentation ────────────────────────────────────────
193
+ files.push({
194
+ path: 'README.md',
195
+ content: this.generateReadme(manifest),
196
+ });
197
+ files.push({
198
+ path: 'DEPLOYMENT.md',
199
+ content: this.generateDeploymentGuide(manifest),
200
+ });
201
+ files.push({
202
+ path: 'SECURITY.md',
203
+ content: this.generateSecurityGuide(manifest),
204
+ });
205
+ files.push({
206
+ path: 'MONITORING.md',
207
+ content: this.generateMonitoringGuide(manifest),
208
+ });
209
+ files.push({
210
+ path: 'TROUBLESHOOTING.md',
211
+ content: this.generateTroubleshootingGuide(manifest),
212
+ });
213
+ files.push({
214
+ path: 'FAQ.md',
215
+ content: this.generateFAQ(manifest),
216
+ });
217
+ files.push({
218
+ path: 'ARCHITECTURE.md',
219
+ content: this.generateArchitecture(manifest),
220
+ });
221
+ files.push({
222
+ path: 'API.md',
223
+ content: this.generateAPIDocumentation(manifest),
224
+ });
225
+ // ── package.json ─────────────────────────────────────────
226
+ files.push({
227
+ path: 'package.json',
228
+ content: this.generatePackageJsonForManifest(manifest),
229
+ });
230
+ // ── Dockerfile (if enabled) ──────────────────────────────
231
+ if (options.includeDocker !== false) {
232
+ files.push({
233
+ path: 'Dockerfile',
234
+ content: this.generateDockerfile(manifest),
235
+ });
236
+ }
237
+ // ── Source templates (if enabled) ────────────────────────
238
+ if (options.includeSourceTemplates) {
239
+ files.push(...this.generateSourceTemplates(manifest));
240
+ }
241
+ // ── CI/CD configuration (if enabled) ─────────────────────
242
+ if (options.includeCI) {
243
+ files.push({
244
+ path: '.gitlab-ci.yml',
245
+ content: this.generateGitLabCI(manifest),
246
+ });
247
+ }
248
+ // ── .gitignore ───────────────────────────────────────────
249
+ files.push({
250
+ path: '.gitignore',
251
+ content: this.generateGitignore(),
252
+ });
253
+ return files;
254
+ }
255
+ /**
256
+ * Write files to disk
257
+ */
258
+ async writeFiles(packagePath, files) {
259
+ const generatedPaths = [];
260
+ for (const file of files) {
261
+ const filePath = path.join(packagePath, file.path);
262
+ const dir = path.dirname(filePath);
263
+ // Create directory
264
+ await fs.mkdir(dir, { recursive: true });
265
+ // Write file
266
+ await fs.writeFile(filePath, file.content, 'utf8');
267
+ generatedPaths.push(file.path);
268
+ }
269
+ return generatedPaths;
270
+ }
271
+ /**
272
+ * Generate AGENTS.md file
273
+ */
274
+ generateAgentsMd(manifest) {
275
+ const agentName = manifest.metadata?.name || 'Agent';
276
+ const description = manifest.metadata?.description || '';
277
+ const role = manifest.spec?.role || '';
278
+ const lines = [];
279
+ lines.push(`# ${agentName}`);
280
+ lines.push('');
281
+ lines.push(description);
282
+ lines.push('');
283
+ lines.push('## Role');
284
+ lines.push('');
285
+ lines.push(role);
286
+ lines.push('');
287
+ // Add capabilities section
288
+ const tools = manifest.spec?.tools || [];
289
+ if (tools.length > 0) {
290
+ lines.push('## Capabilities');
291
+ lines.push('');
292
+ lines.push('This agent has access to the following tools:');
293
+ lines.push('');
294
+ for (const tool of tools) {
295
+ const toolObj = tool;
296
+ lines.push(`- **${toolObj.name || toolObj.type}**: ${toolObj.description || 'No description'}`);
297
+ }
298
+ lines.push('');
299
+ }
300
+ // Add usage section
301
+ lines.push('## Usage');
302
+ lines.push('');
303
+ lines.push('### Trigger Agent');
304
+ lines.push('');
305
+ lines.push('```bash');
306
+ lines.push(`glab duo agent trigger ${this.getAgentName(manifest)}`);
307
+ lines.push('```');
308
+ lines.push('');
309
+ // Add configuration section
310
+ lines.push('## Configuration');
311
+ lines.push('');
312
+ lines.push('### Environment Variables');
313
+ lines.push('');
314
+ const externalAgentResult = this.externalAgentGenerator.generate(manifest);
315
+ if (externalAgentResult.success && externalAgentResult.config) {
316
+ for (const variable of externalAgentResult.config.variables) {
317
+ lines.push(`- \`${variable}\``);
318
+ }
319
+ }
320
+ lines.push('');
321
+ // Add LLM configuration
322
+ const llm = manifest.spec?.llm;
323
+ if (llm) {
324
+ lines.push('### LLM Configuration');
325
+ lines.push('');
326
+ const llmConfig = llm;
327
+ lines.push(`- **Provider**: ${llmConfig.provider || 'Not specified'}`);
328
+ lines.push(`- **Model**: ${llmConfig.model || 'Not specified'}`);
329
+ if (llmConfig.temperature !== undefined) {
330
+ lines.push(`- **Temperature**: ${llmConfig.temperature}`);
331
+ }
332
+ if (llmConfig.maxTokens) {
333
+ lines.push(`- **Max Tokens**: ${llmConfig.maxTokens}`);
334
+ }
335
+ lines.push('');
336
+ }
337
+ // Add deployment section
338
+ lines.push('## Deployment');
339
+ lines.push('');
340
+ lines.push('See [DEPLOYMENT.md](../../../DEPLOYMENT.md) for detailed deployment instructions.');
341
+ lines.push('');
342
+ // Add documentation link
343
+ lines.push('## Documentation');
344
+ lines.push('');
345
+ lines.push('- [GitLab Duo Documentation](https://docs.gitlab.com/ee/user/gitlab_duo/)');
346
+ lines.push('- [OSSA Specification](https://github.com/bluefly-io/ossa)');
347
+ lines.push('');
348
+ return lines.join('\n');
349
+ }
350
+ /**
351
+ * Generate OSSA manifest YAML
352
+ */
353
+ generateOssaManifest(manifest) {
354
+ return JSON.stringify(manifest, null, 2);
355
+ }
356
+ /**
357
+ * Generate README.md
358
+ */
359
+ generateReadme(manifest) {
360
+ const agentName = manifest.metadata?.name || 'Agent';
361
+ const description = manifest.metadata?.description || '';
362
+ const version = manifest.metadata?.version || '1.0.0';
363
+ const lines = [];
364
+ lines.push(`# ${agentName}`);
365
+ lines.push('');
366
+ lines.push(`> ${description}`);
367
+ lines.push('');
368
+ lines.push(`**Version**: ${version}`);
369
+ lines.push('');
370
+ lines.push('## Overview');
371
+ lines.push('');
372
+ lines.push('This is a GitLab Duo agent generated from an OSSA manifest. It integrates with GitLab Duo AI Gateway and can be deployed as a Flow or External Agent.');
373
+ lines.push('');
374
+ lines.push('## Quick Start');
375
+ lines.push('');
376
+ lines.push('### Prerequisites');
377
+ lines.push('');
378
+ lines.push('- GitLab account with Duo access');
379
+ lines.push('- `glab` CLI installed');
380
+ lines.push('- Docker (for local testing)');
381
+ lines.push('');
382
+ lines.push('### Install Dependencies');
383
+ lines.push('');
384
+ lines.push('```bash');
385
+ lines.push('npm install');
386
+ lines.push('```');
387
+ lines.push('');
388
+ lines.push('### Build');
389
+ lines.push('');
390
+ lines.push('```bash');
391
+ lines.push('npm run build');
392
+ lines.push('```');
393
+ lines.push('');
394
+ lines.push('### Deploy');
395
+ lines.push('');
396
+ lines.push('See [DEPLOYMENT.md](./DEPLOYMENT.md) for deployment instructions.');
397
+ lines.push('');
398
+ lines.push('## Directory Structure');
399
+ lines.push('');
400
+ lines.push('```');
401
+ lines.push('.gitlab/duo/');
402
+ lines.push(' flows/');
403
+ lines.push(' main.yaml # Primary agent flow');
404
+ lines.push(' error.yaml # Error handling with retry logic');
405
+ lines.push(' monitor.yaml # Monitoring and observability');
406
+ lines.push(' governance.yaml # Compliance and policy checks');
407
+ lines.push(` agents/${this.getAgentName(manifest)}.yaml # External Agent configuration`);
408
+ lines.push(' triggers/');
409
+ lines.push(' mention.yaml # @agent mention triggers');
410
+ lines.push(' assign.yaml # Issue/MR assignment triggers');
411
+ lines.push(' assign_reviewer.yaml # MR reviewer assignment triggers');
412
+ lines.push(' schedule.yaml # Cron-based scheduled triggers');
413
+ lines.push(' pipeline.yaml # CI/CD pipeline triggers');
414
+ lines.push(' webhook.yaml # External webhook triggers');
415
+ lines.push(' file_pattern.yaml # File change pattern triggers');
416
+ lines.push(' routers/');
417
+ lines.push(' conditional.yaml # Conditional routing logic');
418
+ lines.push(' multi-agent.yaml # Multi-agent orchestration');
419
+ lines.push(' mcp-config.yaml # MCP server configuration (YAML)');
420
+ lines.push(' mcp-config.json # MCP server configuration (JSON)');
421
+ lines.push(' custom-tools.json # Custom tool definitions');
422
+ lines.push(' AGENTS.md # Agent documentation');
423
+ lines.push('src/ # Source code');
424
+ lines.push('agent.ossa.yaml # OSSA manifest');
425
+ lines.push('package.json # Node.js dependencies');
426
+ lines.push('Dockerfile # Container image');
427
+ lines.push('```');
428
+ lines.push('');
429
+ lines.push('## Documentation');
430
+ lines.push('');
431
+ lines.push('- [AGENTS.md](./.gitlab/duo/AGENTS.md) - Agent capabilities and usage');
432
+ lines.push('- [DEPLOYMENT.md](./DEPLOYMENT.md) - Deployment guide');
433
+ lines.push('- [GitLab Duo Documentation](https://docs.gitlab.com/ee/user/gitlab_duo/)');
434
+ lines.push('');
435
+ lines.push('## License');
436
+ lines.push('');
437
+ lines.push(manifest.metadata?.license || 'MIT');
438
+ lines.push('');
439
+ return lines.join('\n');
440
+ }
441
+ /**
442
+ * Generate DEPLOYMENT.md
443
+ */
444
+ generateDeploymentGuide(manifest) {
445
+ const agentName = this.getAgentName(manifest);
446
+ const lines = [];
447
+ lines.push('# Deployment Guide');
448
+ lines.push('');
449
+ lines.push(`This guide explains how to deploy the **${manifest.metadata?.name || 'Agent'}** to GitLab Duo.`);
450
+ lines.push('');
451
+ lines.push('## Deployment Options');
452
+ lines.push('');
453
+ lines.push('This agent supports two deployment modes:');
454
+ lines.push('');
455
+ lines.push('1. **Flow Agent** - Runs within GitLab Duo infrastructure (recommended)');
456
+ lines.push('2. **External Agent** - Runs in your GitLab CI/CD pipeline');
457
+ lines.push('');
458
+ lines.push('## Option 1: Flow Agent (Recommended)');
459
+ lines.push('');
460
+ lines.push('### Register Flow');
461
+ lines.push('');
462
+ lines.push('```bash');
463
+ lines.push(`glab duo flow register .gitlab/duo/flows/${agentName}.yaml`);
464
+ lines.push('```');
465
+ lines.push('');
466
+ lines.push('### Test Flow');
467
+ lines.push('');
468
+ lines.push('```bash');
469
+ lines.push(`glab duo flow test ${agentName}`);
470
+ lines.push('```');
471
+ lines.push('');
472
+ lines.push('### Deploy Flow');
473
+ lines.push('');
474
+ lines.push('```bash');
475
+ lines.push(`glab duo flow deploy ${agentName}`);
476
+ lines.push('```');
477
+ lines.push('');
478
+ lines.push('## Option 2: External Agent');
479
+ lines.push('');
480
+ lines.push('### Build Container Image');
481
+ lines.push('');
482
+ lines.push('```bash');
483
+ lines.push('docker build -t registry.gitlab.com/<namespace>/<project>/<agent>:latest .');
484
+ lines.push('docker push registry.gitlab.com/<namespace>/<project>/<agent>:latest');
485
+ lines.push('```');
486
+ lines.push('');
487
+ lines.push('### Register External Agent');
488
+ lines.push('');
489
+ lines.push('```bash');
490
+ lines.push(`glab duo agent register external .gitlab/duo/agents/${agentName}.yaml`);
491
+ lines.push('```');
492
+ lines.push('');
493
+ lines.push('### Test External Agent');
494
+ lines.push('');
495
+ lines.push('```bash');
496
+ lines.push(`glab duo agent test ${agentName}`);
497
+ lines.push('```');
498
+ lines.push('');
499
+ lines.push('## Environment Variables');
500
+ lines.push('');
501
+ lines.push('Required environment variables:');
502
+ lines.push('');
503
+ const externalAgentResult = this.externalAgentGenerator.generate(manifest);
504
+ if (externalAgentResult.success && externalAgentResult.config) {
505
+ for (const variable of externalAgentResult.config.variables) {
506
+ lines.push(`- \`${variable}\``);
507
+ }
508
+ }
509
+ lines.push('');
510
+ lines.push('Set these in your GitLab project:');
511
+ lines.push('');
512
+ lines.push('```bash');
513
+ lines.push('glab variable set GITLAB_TOKEN <your-token>');
514
+ lines.push('glab variable set AI_GATEWAY_TOKEN <gateway-token>');
515
+ lines.push('```');
516
+ lines.push('');
517
+ lines.push('## Monitoring');
518
+ lines.push('');
519
+ lines.push('### View Agent Logs');
520
+ lines.push('');
521
+ lines.push('```bash');
522
+ lines.push(`glab duo agent logs ${agentName}`);
523
+ lines.push('```');
524
+ lines.push('');
525
+ lines.push('### Check Agent Status');
526
+ lines.push('');
527
+ lines.push('```bash');
528
+ lines.push(`glab duo agent status ${agentName}`);
529
+ lines.push('```');
530
+ lines.push('');
531
+ lines.push('## Troubleshooting');
532
+ lines.push('');
533
+ lines.push('### Agent Not Responding');
534
+ lines.push('');
535
+ lines.push('1. Check agent logs for errors');
536
+ lines.push('2. Verify environment variables are set correctly');
537
+ lines.push('3. Ensure AI Gateway token is valid');
538
+ lines.push('');
539
+ lines.push('### Authentication Errors');
540
+ lines.push('');
541
+ lines.push('1. Verify `GITLAB_TOKEN` has correct permissions');
542
+ lines.push('2. Check token expiration');
543
+ lines.push('3. Ensure token has `api` and `read_repository` scopes');
544
+ lines.push('');
545
+ lines.push('## Documentation');
546
+ lines.push('');
547
+ lines.push('- [GitLab Duo Flows](https://docs.gitlab.com/ee/user/gitlab_duo/flows.html)');
548
+ lines.push('- [GitLab Duo External Agents](https://docs.gitlab.com/ee/user/gitlab_duo/external_agents.html)');
549
+ lines.push('- [AI Gateway Documentation](https://docs.gitlab.com/ee/architecture/blueprints/ai_gateway/)');
550
+ lines.push('');
551
+ return lines.join('\n');
552
+ }
553
+ /**
554
+ * Generate package.json
555
+ */
556
+ /**
557
+ * Generate GitLab Duo package.json
558
+ * Uses base class generatePackageJson with GitLab-specific configuration
559
+ */
560
+ generatePackageJsonForManifest(manifest) {
561
+ return super.generatePackageJson({
562
+ scope: '@gitlab-duo',
563
+ name: this.getAgentName(manifest),
564
+ version: this.getAgentVersion(manifest),
565
+ description: this.getAgentDescription(manifest),
566
+ type: 'module',
567
+ main: './dist/index.js',
568
+ types: './dist/index.d.ts',
569
+ scripts: {
570
+ build: 'tsc',
571
+ dev: 'tsc --watch',
572
+ test: 'node --test',
573
+ lint: 'eslint src/',
574
+ 'lint:fix': 'eslint src/ --fix',
575
+ clean: 'rm -rf dist/',
576
+ },
577
+ dependencies: {
578
+ '@gitlab/duo': '^0.1.0',
579
+ '@gitbeaker/rest': '^41.0.0',
580
+ },
581
+ devDependencies: {
582
+ '@types/node': '^22.0.0',
583
+ typescript: '^5.7.0',
584
+ eslint: '^9.0.0',
585
+ },
586
+ engines: {
587
+ node: '>=22.0.0',
588
+ },
589
+ keywords: ['gitlab-duo', 'ai-agent', 'ossa'],
590
+ author: this.getAgentAuthor(manifest),
591
+ license: this.getAgentLicense(manifest),
592
+ });
593
+ }
594
+ /**
595
+ * Generate Dockerfile
596
+ */
597
+ generateDockerfile(manifest) {
598
+ const lines = [];
599
+ // Determine base image
600
+ const externalAgentResult = this.externalAgentGenerator.generate(manifest);
601
+ const baseImage = externalAgentResult.config?.image || 'node:22-slim';
602
+ lines.push(`FROM ${baseImage}`);
603
+ lines.push('');
604
+ lines.push('WORKDIR /app');
605
+ lines.push('');
606
+ if (baseImage.startsWith('node:')) {
607
+ lines.push('# Install dependencies');
608
+ lines.push('COPY package*.json ./');
609
+ lines.push('RUN npm ci --only=production');
610
+ lines.push('');
611
+ lines.push('# Copy source');
612
+ lines.push('COPY . .');
613
+ lines.push('');
614
+ lines.push('# Build');
615
+ lines.push('RUN npm run build');
616
+ lines.push('');
617
+ lines.push('# Run');
618
+ lines.push('CMD ["node", "dist/index.js"]');
619
+ }
620
+ else if (baseImage.startsWith('python:')) {
621
+ lines.push('# Install dependencies');
622
+ lines.push('COPY requirements.txt ./');
623
+ lines.push('RUN pip install --no-cache-dir -r requirements.txt');
624
+ lines.push('');
625
+ lines.push('# Copy source');
626
+ lines.push('COPY . .');
627
+ lines.push('');
628
+ lines.push('# Run');
629
+ lines.push('CMD ["python", "main.py"]');
630
+ }
631
+ else {
632
+ lines.push('# Copy source');
633
+ lines.push('COPY . .');
634
+ lines.push('');
635
+ lines.push('# Run');
636
+ lines.push('CMD ["./run.sh"]');
637
+ }
638
+ return lines.join('\n');
639
+ }
640
+ /**
641
+ * Generate source templates
642
+ */
643
+ generateSourceTemplates(manifest) {
644
+ const files = [];
645
+ // Generate index.ts
646
+ files.push({
647
+ path: 'src/index.ts',
648
+ content: this.generateIndexTemplate(manifest),
649
+ });
650
+ // Generate agent.ts
651
+ files.push({
652
+ path: 'src/agent.ts',
653
+ content: this.generateAgentTemplate(manifest),
654
+ });
655
+ // Generate tsconfig.json
656
+ files.push({
657
+ path: 'tsconfig.json',
658
+ content: this.generateTsConfig(),
659
+ });
660
+ return files;
661
+ }
662
+ /**
663
+ * Generate index.ts template
664
+ */
665
+ generateIndexTemplate(manifest) {
666
+ const lines = [];
667
+ lines.push('/**');
668
+ lines.push(` * ${manifest.metadata?.name || 'Agent'}`);
669
+ lines.push(` * ${manifest.metadata?.description || ''}`);
670
+ lines.push(' */');
671
+ lines.push('');
672
+ lines.push("import { Agent } from './agent.js';");
673
+ lines.push('');
674
+ lines.push('const agent = new Agent();');
675
+ lines.push('');
676
+ lines.push('// Start agent');
677
+ lines.push('agent.start().catch((error) => {');
678
+ lines.push(' console.error("Agent failed to start:", error);');
679
+ lines.push(' process.exit(1);');
680
+ lines.push('});');
681
+ lines.push('');
682
+ return lines.join('\n');
683
+ }
684
+ /**
685
+ * Generate agent.ts template
686
+ */
687
+ generateAgentTemplate(manifest) {
688
+ const role = manifest.spec?.role || 'You are a helpful AI assistant';
689
+ const lines = [];
690
+ lines.push('/**');
691
+ lines.push(' * Agent implementation');
692
+ lines.push(' */');
693
+ lines.push('');
694
+ lines.push('export class Agent {');
695
+ lines.push(' private role: string;');
696
+ lines.push('');
697
+ lines.push(' constructor() {');
698
+ lines.push(` this.role = \`${role}\`;`);
699
+ lines.push(' }');
700
+ lines.push('');
701
+ lines.push(' async start(): Promise<void> {');
702
+ lines.push(' console.log("Agent starting...");');
703
+ lines.push(' console.log("Role:", this.role);');
704
+ lines.push('');
705
+ lines.push(' // Get input from environment');
706
+ lines.push(' const input = process.env.AI_FLOW_INPUT || "Hello";');
707
+ lines.push('');
708
+ lines.push(' // Process input');
709
+ lines.push(' const response = await this.process(input);');
710
+ lines.push('');
711
+ lines.push(' // Output response');
712
+ lines.push(' console.log("Response:", response);');
713
+ lines.push(' }');
714
+ lines.push('');
715
+ lines.push(' async process(input: string): Promise<string> {');
716
+ lines.push(' // TODO: Implement agent logic');
717
+ lines.push(' return `Processed: ${input}`;');
718
+ lines.push(' }');
719
+ lines.push('}');
720
+ lines.push('');
721
+ return lines.join('\n');
722
+ }
723
+ /**
724
+ * Generate tsconfig.json
725
+ */
726
+ /**
727
+ * Generate TypeScript configuration
728
+ * Uses base class implementation
729
+ */
730
+ generateTsConfig() {
731
+ return super.generateTsConfig();
732
+ }
733
+ /**
734
+ * Generate GitLab CI configuration
735
+ */
736
+ generateGitLabCI(manifest) {
737
+ const agentName = this.getAgentName(manifest);
738
+ const lines = [];
739
+ lines.push('# GitLab CI/CD Configuration');
740
+ lines.push(`# Agent: ${manifest.metadata?.name || 'Agent'}`);
741
+ lines.push('');
742
+ lines.push('stages:');
743
+ lines.push(' - build');
744
+ lines.push(' - test');
745
+ lines.push(' - deploy');
746
+ lines.push('');
747
+ lines.push('build:');
748
+ lines.push(' stage: build');
749
+ lines.push(' image: node:22-slim');
750
+ lines.push(' script:');
751
+ lines.push(' - npm ci');
752
+ lines.push(' - npm run build');
753
+ lines.push(' artifacts:');
754
+ lines.push(' paths:');
755
+ lines.push(' - dist/');
756
+ lines.push('');
757
+ lines.push('test:');
758
+ lines.push(' stage: test');
759
+ lines.push(' image: node:22-slim');
760
+ lines.push(' script:');
761
+ lines.push(' - npm ci');
762
+ lines.push(' - npm test');
763
+ lines.push('');
764
+ lines.push('deploy:');
765
+ lines.push(' stage: deploy');
766
+ lines.push(' image: node:22-slim');
767
+ lines.push(' script:');
768
+ lines.push(' - npm ci');
769
+ lines.push(' - npm run build');
770
+ lines.push(` - glab duo flow deploy ${agentName}`);
771
+ lines.push(' only:');
772
+ lines.push(' - main');
773
+ lines.push('');
774
+ return lines.join('\n');
775
+ }
776
+ /**
777
+ * Generate .gitignore
778
+ * Uses base class implementation
779
+ */
780
+ generateGitignore() {
781
+ return super.generateGitignore();
782
+ }
783
+ /**
784
+ * Generate MCP Configuration
785
+ */
786
+ generateMCPConfig(manifest) {
787
+ const spec = manifest.spec;
788
+ const tools = spec.tools || [];
789
+ const mcpServers = {};
790
+ // Map OSSA tools to MCP servers
791
+ for (const tool of tools) {
792
+ const toolName = tool.name || tool.type || 'unknown';
793
+ if (toolName.includes('gitlab')) {
794
+ mcpServers['gitlab'] = {
795
+ command: 'npx',
796
+ args: ['-y', '@modelcontextprotocol/server-gitlab'],
797
+ env: {
798
+ GITLAB_TOKEN: '${GITLAB_TOKEN}',
799
+ GITLAB_URL: 'https://gitlab.com',
800
+ },
801
+ };
802
+ }
803
+ else if (toolName.includes('file') ||
804
+ toolName.includes('read') ||
805
+ toolName.includes('write')) {
806
+ mcpServers['filesystem'] = {
807
+ command: 'npx',
808
+ args: ['-y', '@modelcontextprotocol/server-filesystem', '/workspace'],
809
+ };
810
+ }
811
+ else if (toolName.includes('search')) {
812
+ mcpServers['ripgrep'] = {
813
+ command: 'npx',
814
+ args: ['-y', '@modelcontextprotocol/server-ripgrep', '/workspace'],
815
+ };
816
+ }
817
+ }
818
+ // Always include memory server
819
+ mcpServers['memory'] = {
820
+ command: 'npx',
821
+ args: ['-y', '@modelcontextprotocol/server-memory'],
822
+ };
823
+ const config = {
824
+ mcpServers,
825
+ version: '1.0.0',
826
+ description: `MCP configuration for ${manifest.metadata?.name || 'agent'}`,
827
+ };
828
+ return JSON.stringify(config, null, 2);
829
+ }
830
+ /**
831
+ * Generate MCP Configuration as YAML.
832
+ * Provides a structured, human-readable MCP server configuration
833
+ * with detailed comments for each server and its purpose.
834
+ */
835
+ generateMCPConfigYAML(manifest) {
836
+ const spec = manifest.spec;
837
+ const tools = spec.tools || [];
838
+ const agentName = manifest.metadata?.name || 'agent';
839
+ const mcpServers = {};
840
+ // Map OSSA tools to MCP servers
841
+ for (const tool of tools) {
842
+ const toolName = tool.name || tool.type || 'unknown';
843
+ if (toolName.includes('gitlab')) {
844
+ mcpServers['gitlab'] = {
845
+ description: 'GitLab API operations (issues, MRs, comments, repository files)',
846
+ command: 'npx',
847
+ args: ['-y', '@modelcontextprotocol/server-gitlab'],
848
+ env: {
849
+ GITLAB_TOKEN: '${GITLAB_TOKEN}',
850
+ GITLAB_URL: '${GITLAB_URL:-https://gitlab.com}',
851
+ },
852
+ capabilities: [
853
+ 'issues',
854
+ 'merge_requests',
855
+ 'comments',
856
+ 'repository_files',
857
+ 'pipelines',
858
+ ],
859
+ };
860
+ }
861
+ else if (toolName.includes('file') ||
862
+ toolName.includes('read') ||
863
+ toolName.includes('write')) {
864
+ mcpServers['filesystem'] = {
865
+ description: 'File system operations (read, write, list, search)',
866
+ command: 'npx',
867
+ args: ['-y', '@modelcontextprotocol/server-filesystem', '/workspace'],
868
+ capabilities: [
869
+ 'read_file',
870
+ 'create_file_with_contents',
871
+ 'update_file',
872
+ 'list_dir',
873
+ ],
874
+ };
875
+ }
876
+ else if (toolName.includes('search')) {
877
+ mcpServers['ripgrep'] = {
878
+ description: 'Code search using ripgrep for fast file content searching',
879
+ command: 'npx',
880
+ args: ['-y', '@modelcontextprotocol/server-ripgrep', '/workspace'],
881
+ capabilities: ['search_files', 'regex_search'],
882
+ };
883
+ }
884
+ }
885
+ // Always include memory server
886
+ mcpServers['memory'] = {
887
+ description: 'Persistent memory across agent sessions for context retention',
888
+ command: 'npx',
889
+ args: ['-y', '@modelcontextprotocol/server-memory'],
890
+ capabilities: ['store', 'retrieve', 'delete', 'list_memories'],
891
+ };
892
+ // Always include fetch server for external data
893
+ mcpServers['fetch'] = {
894
+ description: 'HTTP fetch for retrieving external documentation and API data',
895
+ command: 'npx',
896
+ args: ['-y', '@modelcontextprotocol/server-fetch'],
897
+ capabilities: ['fetch_url', 'parse_html', 'extract_text'],
898
+ };
899
+ const config = {
900
+ version: 'v1',
901
+ agent_name: agentName,
902
+ description: `MCP server configuration for ${agentName}. Defines the external tool servers that the agent can use during execution.`,
903
+ servers: mcpServers,
904
+ settings: {
905
+ startup_timeout_seconds: 30,
906
+ request_timeout_seconds: 60,
907
+ max_concurrent_servers: 5,
908
+ restart_on_failure: true,
909
+ log_level: 'info',
910
+ },
911
+ security: {
912
+ allowed_hosts: ['gitlab.com', '*.gitlab.com', 'ai-gateway.gitlab.com'],
913
+ deny_shell_execution: true,
914
+ max_file_size_bytes: 10_485_760,
915
+ workspace_root: '/workspace',
916
+ },
917
+ };
918
+ return YAML.stringify(config, { indent: 2, lineWidth: 0 });
919
+ }
920
+ /**
921
+ * Generate Custom Tools Definition
922
+ */
923
+ generateCustomTools(manifest) {
924
+ const spec = manifest.spec;
925
+ const tools = spec.tools || [];
926
+ const customTools = tools.map((tool) => ({
927
+ name: tool.name || 'custom_tool',
928
+ description: tool.description || 'Custom tool implementation',
929
+ input_schema: {
930
+ type: 'object',
931
+ properties: tool.parameters || {},
932
+ required: Object.keys(tool.parameters || {}),
933
+ },
934
+ }));
935
+ const config = {
936
+ tools: customTools,
937
+ version: '1.0.0',
938
+ };
939
+ return JSON.stringify(config, null, 2);
940
+ }
941
+ /**
942
+ * Generate SECURITY.md
943
+ */
944
+ generateSecurityGuide(manifest) {
945
+ const agentName = manifest.metadata?.name || 'Agent';
946
+ const lines = [];
947
+ lines.push(`# Security Guide: ${agentName}`);
948
+ lines.push('');
949
+ lines.push('## Overview');
950
+ lines.push('');
951
+ lines.push('This document outlines security considerations, best practices, and procedures for deploying and operating this GitLab Duo agent.');
952
+ lines.push('');
953
+ lines.push('## Authentication & Authorization');
954
+ lines.push('');
955
+ lines.push('### GitLab Token Management');
956
+ lines.push('');
957
+ lines.push('**Required Scopes:**');
958
+ lines.push('- `api` - Full API access');
959
+ lines.push('- `read_repository` - Read repository data');
960
+ lines.push('- `write_repository` - Write repository data (if agent modifies files)');
961
+ lines.push('');
962
+ lines.push('**Token Storage:**');
963
+ lines.push('- Store tokens as GitLab CI/CD variables (masked)');
964
+ lines.push('- Use environment-specific tokens (dev/staging/prod)');
965
+ lines.push('- Rotate tokens every 90 days');
966
+ lines.push('');
967
+ lines.push('```bash');
968
+ lines.push('# Set token as masked variable');
969
+ lines.push('glab variable set GITLAB_TOKEN <token> --masked');
970
+ lines.push('```');
971
+ lines.push('');
972
+ lines.push('### AI Gateway Token');
973
+ lines.push('');
974
+ lines.push('- Never commit AI Gateway tokens to repository');
975
+ lines.push('- Use GitLab CI/CD variables with `protected` flag');
976
+ lines.push('- Limit token scope to specific agent');
977
+ lines.push('');
978
+ lines.push('## Access Controls');
979
+ lines.push('');
980
+ lines.push('### Trigger Permissions');
981
+ lines.push('');
982
+ lines.push('Ensure triggers have appropriate permissions:');
983
+ lines.push('');
984
+ lines.push('- **@mentions**: Minimum `Reporter` role');
985
+ lines.push('- **Assignments**: Minimum `Developer` role');
986
+ lines.push('- **Webhooks**: Token-based authentication required');
987
+ lines.push('- **Scheduled**: Runs as project bot account');
988
+ lines.push('');
989
+ lines.push('### Tool Access');
990
+ lines.push('');
991
+ lines.push('Restrict tool capabilities based on environment:');
992
+ lines.push('');
993
+ lines.push('- **Read-only tools**: `read_file`, `list_dir`, `search_files`');
994
+ lines.push('- **Write tools**: `create_file`, `update_file` (production only)');
995
+ lines.push('- **Shell execution**: Disabled by default, enable with caution');
996
+ lines.push('');
997
+ lines.push('## Data Protection');
998
+ lines.push('');
999
+ lines.push('### Sensitive Data Handling');
1000
+ lines.push('');
1001
+ lines.push('- Never log sensitive data (tokens, passwords, API keys)');
1002
+ lines.push('- Redact sensitive patterns in output');
1003
+ lines.push("- Use GitLab's built-in secret detection");
1004
+ lines.push('');
1005
+ lines.push('### Data Retention');
1006
+ lines.push('');
1007
+ lines.push('- Agent logs retained for 30 days');
1008
+ lines.push('- Conversation history cleared after session');
1009
+ lines.push('- PII redacted before storage');
1010
+ lines.push('');
1011
+ lines.push('## Network Security');
1012
+ lines.push('');
1013
+ lines.push('### Outbound Connections');
1014
+ lines.push('');
1015
+ lines.push('Agent makes connections to:');
1016
+ lines.push('');
1017
+ lines.push('- `gitlab.com` (API)');
1018
+ lines.push('- `ai-gateway.gitlab.com` (AI Gateway)');
1019
+ lines.push('- MCP servers (as configured)');
1020
+ lines.push('');
1021
+ lines.push('### Inbound Webhooks');
1022
+ lines.push('');
1023
+ lines.push('If webhook triggers enabled:');
1024
+ lines.push('');
1025
+ lines.push('- Validate webhook signatures');
1026
+ lines.push('- Rate limit webhook endpoints');
1027
+ lines.push('- Use HTTPS only');
1028
+ lines.push('');
1029
+ lines.push('## Vulnerability Management');
1030
+ lines.push('');
1031
+ lines.push('### Dependency Scanning');
1032
+ lines.push('');
1033
+ lines.push('```bash');
1034
+ lines.push('# Run dependency audit');
1035
+ lines.push('npm audit');
1036
+ lines.push('');
1037
+ lines.push('# Fix vulnerabilities');
1038
+ lines.push('npm audit fix');
1039
+ lines.push('```');
1040
+ lines.push('');
1041
+ lines.push('### Container Security');
1042
+ lines.push('');
1043
+ lines.push('- Use minimal base images (node:22-slim)');
1044
+ lines.push('- Scan container images for vulnerabilities');
1045
+ lines.push('- Update base images monthly');
1046
+ lines.push('');
1047
+ lines.push('## Incident Response');
1048
+ lines.push('');
1049
+ lines.push('### Security Incident');
1050
+ lines.push('');
1051
+ lines.push('1. **Disable agent** - Stop all triggers');
1052
+ lines.push('2. **Rotate tokens** - Invalidate compromised credentials');
1053
+ lines.push('3. **Review logs** - Check for unauthorized access');
1054
+ lines.push('4. **Notify stakeholders** - Report incident per policy');
1055
+ lines.push('');
1056
+ lines.push('### Token Compromise');
1057
+ lines.push('');
1058
+ lines.push('```bash');
1059
+ lines.push('# Revoke token immediately');
1060
+ lines.push('glab token revoke <token-id>');
1061
+ lines.push('');
1062
+ lines.push('# Generate new token');
1063
+ lines.push('glab token create --scopes api,read_repository');
1064
+ lines.push('');
1065
+ lines.push('# Update CI/CD variable');
1066
+ lines.push('glab variable update GITLAB_TOKEN <new-token> --masked');
1067
+ lines.push('```');
1068
+ lines.push('');
1069
+ lines.push('## Compliance');
1070
+ lines.push('');
1071
+ lines.push('### Audit Logging');
1072
+ lines.push('');
1073
+ lines.push('All agent actions are logged:');
1074
+ lines.push('');
1075
+ lines.push('- Trigger events');
1076
+ lines.push('- Tool executions');
1077
+ lines.push('- API calls');
1078
+ lines.push('- Errors and exceptions');
1079
+ lines.push('');
1080
+ lines.push('### Data Privacy (GDPR/CCPA)');
1081
+ lines.push('');
1082
+ lines.push('- PII detection and redaction enabled');
1083
+ lines.push('- Data retention policy: 30 days');
1084
+ lines.push('- Right to deletion supported');
1085
+ lines.push('');
1086
+ lines.push('## Security Checklist');
1087
+ lines.push('');
1088
+ lines.push('- [ ] GitLab tokens stored as masked CI/CD variables');
1089
+ lines.push('- [ ] AI Gateway token protected and scoped');
1090
+ lines.push('- [ ] Trigger permissions configured correctly');
1091
+ lines.push('- [ ] Tool access restricted to minimum required');
1092
+ lines.push('- [ ] Sensitive data logging disabled');
1093
+ lines.push('- [ ] Dependency scanning enabled in CI/CD');
1094
+ lines.push('- [ ] Container image scanning configured');
1095
+ lines.push('- [ ] Webhook authentication configured');
1096
+ lines.push('- [ ] Incident response plan documented');
1097
+ lines.push('- [ ] Token rotation schedule established');
1098
+ lines.push('');
1099
+ lines.push('## References');
1100
+ lines.push('');
1101
+ lines.push('- [GitLab Security Best Practices](https://docs.gitlab.com/ee/security/)');
1102
+ lines.push('- [GitLab Duo Security](https://docs.gitlab.com/ee/user/gitlab_duo/security.html)');
1103
+ lines.push('- [AI Gateway Security](https://docs.gitlab.com/ee/architecture/blueprints/ai_gateway/security.html)');
1104
+ lines.push('');
1105
+ return lines.join('\n');
1106
+ }
1107
+ /**
1108
+ * Generate MONITORING.md
1109
+ */
1110
+ generateMonitoringGuide(manifest) {
1111
+ const agentName = this.getAgentName(manifest);
1112
+ const lines = [];
1113
+ lines.push(`# Monitoring Guide: ${manifest.metadata?.name || 'Agent'}`);
1114
+ lines.push('');
1115
+ lines.push('## Overview');
1116
+ lines.push('');
1117
+ lines.push('This guide covers monitoring, observability, and performance tracking for this GitLab Duo agent.');
1118
+ lines.push('');
1119
+ lines.push('## Metrics');
1120
+ lines.push('');
1121
+ lines.push('### Key Performance Indicators (KPIs)');
1122
+ lines.push('');
1123
+ lines.push('| Metric | Description | Target |');
1124
+ lines.push('|--------|-------------|--------|');
1125
+ lines.push('| Response Time | Time from trigger to first response | < 5s |');
1126
+ lines.push('| Success Rate | Percentage of successful executions | > 95% |');
1127
+ lines.push('| Error Rate | Percentage of failed executions | < 5% |');
1128
+ lines.push('| Token Usage | Average tokens per execution | Monitor |');
1129
+ lines.push('| Tool Calls | Number of tool executions | Monitor |');
1130
+ lines.push('');
1131
+ lines.push('### View Metrics');
1132
+ lines.push('');
1133
+ lines.push('```bash');
1134
+ lines.push(`# View agent metrics`);
1135
+ lines.push(`glab duo agent metrics ${agentName}`);
1136
+ lines.push('');
1137
+ lines.push('# View specific metric');
1138
+ lines.push(`glab duo agent metrics ${agentName} --metric response_time`);
1139
+ lines.push('');
1140
+ lines.push('# Export metrics to JSON');
1141
+ lines.push(`glab duo agent metrics ${agentName} --format json > metrics.json`);
1142
+ lines.push('```');
1143
+ lines.push('');
1144
+ lines.push('## Logging');
1145
+ lines.push('');
1146
+ lines.push('### Log Levels');
1147
+ lines.push('');
1148
+ lines.push('- `ERROR` - Failures and exceptions');
1149
+ lines.push('- `WARN` - Recoverable issues');
1150
+ lines.push('- `INFO` - Normal operations');
1151
+ lines.push('- `DEBUG` - Detailed execution info');
1152
+ lines.push('');
1153
+ lines.push('### View Logs');
1154
+ lines.push('');
1155
+ lines.push('```bash');
1156
+ lines.push(`# View recent logs`);
1157
+ lines.push(`glab duo agent logs ${agentName}`);
1158
+ lines.push('');
1159
+ lines.push('# Follow logs in real-time');
1160
+ lines.push(`glab duo agent logs ${agentName} --follow`);
1161
+ lines.push('');
1162
+ lines.push('# Filter by level');
1163
+ lines.push(`glab duo agent logs ${agentName} --level ERROR`);
1164
+ lines.push('');
1165
+ lines.push('# View logs for specific execution');
1166
+ lines.push(`glab duo agent logs ${agentName} --execution-id <id>`);
1167
+ lines.push('```');
1168
+ lines.push('');
1169
+ lines.push('## Tracing');
1170
+ lines.push('');
1171
+ lines.push('### Execution Traces');
1172
+ lines.push('');
1173
+ lines.push('View complete execution traces:');
1174
+ lines.push('');
1175
+ lines.push('```bash');
1176
+ lines.push(`# List recent executions`);
1177
+ lines.push(`glab duo agent executions ${agentName}`);
1178
+ lines.push('');
1179
+ lines.push('# View execution trace');
1180
+ lines.push(`glab duo agent trace <execution-id>`);
1181
+ lines.push('');
1182
+ lines.push('# Export trace');
1183
+ lines.push(`glab duo agent trace <execution-id> --format json > trace.json`);
1184
+ lines.push('```');
1185
+ lines.push('');
1186
+ lines.push('### Trace Components');
1187
+ lines.push('');
1188
+ lines.push('Each trace includes:');
1189
+ lines.push('');
1190
+ lines.push('- Trigger event details');
1191
+ lines.push('- Component execution timeline');
1192
+ lines.push('- Tool call sequences');
1193
+ lines.push('- LLM requests and responses');
1194
+ lines.push('- Router decisions');
1195
+ lines.push('- Error details (if any)');
1196
+ lines.push('');
1197
+ lines.push('## Alerting');
1198
+ lines.push('');
1199
+ lines.push('### Alert Rules');
1200
+ lines.push('');
1201
+ lines.push('Configure alerts for critical conditions:');
1202
+ lines.push('');
1203
+ lines.push('```bash');
1204
+ lines.push(`# Create alert rule`);
1205
+ lines.push(`glab duo agent alert create ${agentName} \\`);
1206
+ lines.push(' --metric error_rate \\');
1207
+ lines.push(' --threshold 10 \\');
1208
+ lines.push(' --period 5m \\');
1209
+ lines.push(' --notify-slack webhook-url');
1210
+ lines.push('```');
1211
+ lines.push('');
1212
+ lines.push('### Recommended Alerts');
1213
+ lines.push('');
1214
+ lines.push('1. **High Error Rate** - > 10% errors in 5 minutes');
1215
+ lines.push('2. **Slow Response** - Average response time > 30s');
1216
+ lines.push('3. **Agent Down** - No executions in 1 hour (for scheduled agents)');
1217
+ lines.push('4. **Token Limit** - Token usage > 90% of limit');
1218
+ lines.push('');
1219
+ lines.push('## Dashboards');
1220
+ lines.push('');
1221
+ lines.push('### GitLab Duo Dashboard');
1222
+ lines.push('');
1223
+ lines.push('Access built-in dashboard:');
1224
+ lines.push('');
1225
+ lines.push('1. Navigate to project');
1226
+ lines.push('2. Go to **GitLab Duo** > **Agents**');
1227
+ lines.push(`3. Select **${manifest.metadata?.name || 'agent'}**`);
1228
+ lines.push('4. View **Metrics** tab');
1229
+ lines.push('');
1230
+ lines.push('### Custom Grafana Dashboard');
1231
+ lines.push('');
1232
+ lines.push('For advanced monitoring, export metrics to Grafana:');
1233
+ lines.push('');
1234
+ lines.push('```bash');
1235
+ lines.push('# Export metrics endpoint');
1236
+ lines.push(`glab duo agent metrics-endpoint ${agentName}`);
1237
+ lines.push('');
1238
+ lines.push('# Configure Prometheus scraper');
1239
+ lines.push('# Add endpoint to prometheus.yml');
1240
+ lines.push('```');
1241
+ lines.push('');
1242
+ lines.push('## Performance Optimization');
1243
+ lines.push('');
1244
+ lines.push('### Response Time');
1245
+ lines.push('');
1246
+ lines.push('If response time is high:');
1247
+ lines.push('');
1248
+ lines.push('1. **Reduce prompt size** - Shorter system prompts');
1249
+ lines.push('2. **Optimize tool calls** - Batch operations');
1250
+ lines.push('3. **Use smaller model** - Switch to faster model');
1251
+ lines.push('4. **Enable caching** - Cache frequently used data');
1252
+ lines.push('');
1253
+ lines.push('### Token Usage');
1254
+ lines.push('');
1255
+ lines.push('If token usage is high:');
1256
+ lines.push('');
1257
+ lines.push('1. **Shorten prompts** - Remove unnecessary context');
1258
+ lines.push('2. **Limit history** - Reduce conversation history depth');
1259
+ lines.push('3. **Compress tool outputs** - Summarize large responses');
1260
+ lines.push('4. **Switch model** - Use more efficient model');
1261
+ lines.push('');
1262
+ lines.push('## Health Checks');
1263
+ lines.push('');
1264
+ lines.push('### Agent Health');
1265
+ lines.push('');
1266
+ lines.push('```bash');
1267
+ lines.push(`# Check agent health`);
1268
+ lines.push(`glab duo agent health ${agentName}`);
1269
+ lines.push('');
1270
+ lines.push('# Output:');
1271
+ lines.push('# Status: healthy');
1272
+ lines.push('# Last execution: 2 minutes ago');
1273
+ lines.push('# Success rate (24h): 98.5%');
1274
+ lines.push('# Avg response time: 3.2s');
1275
+ lines.push('```');
1276
+ lines.push('');
1277
+ lines.push('### Dependency Health');
1278
+ lines.push('');
1279
+ lines.push('Monitor dependencies:');
1280
+ lines.push('');
1281
+ lines.push('- AI Gateway connectivity');
1282
+ lines.push('- GitLab API availability');
1283
+ lines.push('- MCP server status');
1284
+ lines.push('- External service connections');
1285
+ lines.push('');
1286
+ lines.push('## Incident Investigation');
1287
+ lines.push('');
1288
+ lines.push('### Debug Failed Execution');
1289
+ lines.push('');
1290
+ lines.push('```bash');
1291
+ lines.push('# 1. Get execution ID from logs');
1292
+ lines.push(`glab duo agent logs ${agentName} --level ERROR`);
1293
+ lines.push('');
1294
+ lines.push('# 2. View full trace');
1295
+ lines.push('glab duo agent trace <execution-id>');
1296
+ lines.push('');
1297
+ lines.push('# 3. Check tool call failures');
1298
+ lines.push('glab duo agent trace <execution-id> --filter tool_calls');
1299
+ lines.push('');
1300
+ lines.push('# 4. Review LLM responses');
1301
+ lines.push('glab duo agent trace <execution-id> --filter llm_responses');
1302
+ lines.push('```');
1303
+ lines.push('');
1304
+ lines.push('## References');
1305
+ lines.push('');
1306
+ lines.push('- [GitLab Duo Monitoring](https://docs.gitlab.com/ee/user/gitlab_duo/monitoring.html)');
1307
+ lines.push('- [AI Gateway Metrics](https://docs.gitlab.com/ee/architecture/blueprints/ai_gateway/metrics.html)');
1308
+ lines.push('- [Performance Best Practices](https://docs.gitlab.com/ee/user/gitlab_duo/performance.html)');
1309
+ lines.push('');
1310
+ return lines.join('\n');
1311
+ }
1312
+ /**
1313
+ * Generate TROUBLESHOOTING.md
1314
+ */
1315
+ generateTroubleshootingGuide(manifest) {
1316
+ const agentName = this.getAgentName(manifest);
1317
+ const lines = [];
1318
+ lines.push(`# Troubleshooting Guide: ${manifest.metadata?.name || 'Agent'}`);
1319
+ lines.push('');
1320
+ lines.push('## Common Issues');
1321
+ lines.push('');
1322
+ lines.push('### Agent Not Responding');
1323
+ lines.push('');
1324
+ lines.push('**Symptoms:**');
1325
+ lines.push('- No response to @mention');
1326
+ lines.push('- Triggers not firing');
1327
+ lines.push('- Silent failures');
1328
+ lines.push('');
1329
+ lines.push('**Solutions:**');
1330
+ lines.push('');
1331
+ lines.push('1. **Check agent status**');
1332
+ lines.push(' ```bash');
1333
+ lines.push(` glab duo agent status ${agentName}`);
1334
+ lines.push(' ```');
1335
+ lines.push('');
1336
+ lines.push('2. **Verify triggers are active**');
1337
+ lines.push(' ```bash');
1338
+ lines.push(` glab duo agent triggers ${agentName}`);
1339
+ lines.push(' ```');
1340
+ lines.push('');
1341
+ lines.push('3. **Check recent errors**');
1342
+ lines.push(' ```bash');
1343
+ lines.push(` glab duo agent logs ${agentName} --level ERROR --tail 50`);
1344
+ lines.push(' ```');
1345
+ lines.push('');
1346
+ lines.push('4. **Restart agent**');
1347
+ lines.push(' ```bash');
1348
+ lines.push(` glab duo agent restart ${agentName}`);
1349
+ lines.push(' ```');
1350
+ lines.push('');
1351
+ lines.push('### Authentication Errors');
1352
+ lines.push('');
1353
+ lines.push('**Error:** `401 Unauthorized` or `403 Forbidden`');
1354
+ lines.push('');
1355
+ lines.push('**Solutions:**');
1356
+ lines.push('');
1357
+ lines.push('1. **Verify GITLAB_TOKEN**');
1358
+ lines.push(' ```bash');
1359
+ lines.push(' glab variable get GITLAB_TOKEN');
1360
+ lines.push(' ```');
1361
+ lines.push('');
1362
+ lines.push('2. **Check token scopes**');
1363
+ lines.push(' - Required: `api`, `read_repository`');
1364
+ lines.push(' - Optional: `write_repository` (if agent modifies files)');
1365
+ lines.push('');
1366
+ lines.push('3. **Verify token not expired**');
1367
+ lines.push(' ```bash');
1368
+ lines.push(' glab auth status');
1369
+ lines.push(' ```');
1370
+ lines.push('');
1371
+ lines.push('4. **Regenerate token**');
1372
+ lines.push(' ```bash');
1373
+ lines.push(' glab auth login --stdin');
1374
+ lines.push(' ```');
1375
+ lines.push('');
1376
+ lines.push('### Tool Execution Failures');
1377
+ lines.push('');
1378
+ lines.push('**Error:** `Tool execution failed: <tool-name>`');
1379
+ lines.push('');
1380
+ lines.push('**Solutions:**');
1381
+ lines.push('');
1382
+ lines.push('1. **Check tool availability**');
1383
+ lines.push(' ```bash');
1384
+ lines.push(` glab duo agent tools ${agentName}`);
1385
+ lines.push(' ```');
1386
+ lines.push('');
1387
+ lines.push('2. **Verify MCP server status**');
1388
+ lines.push(' ```bash');
1389
+ lines.push(` glab duo agent mcp-status ${agentName}`);
1390
+ lines.push(' ```');
1391
+ lines.push('');
1392
+ lines.push('3. **Check tool permissions**');
1393
+ lines.push(' - File operations require repository access');
1394
+ lines.push(' - GitLab operations require API access');
1395
+ lines.push('');
1396
+ lines.push('4. **Review tool execution logs**');
1397
+ lines.push(' ```bash');
1398
+ lines.push(` glab duo agent logs ${agentName} --filter tool_execution`);
1399
+ lines.push(' ```');
1400
+ lines.push('');
1401
+ lines.push('### High Response Time');
1402
+ lines.push('');
1403
+ lines.push('**Symptom:** Agent takes > 30s to respond');
1404
+ lines.push('');
1405
+ lines.push('**Solutions:**');
1406
+ lines.push('');
1407
+ lines.push('1. **Check AI Gateway latency**');
1408
+ lines.push(' ```bash');
1409
+ lines.push(` glab duo agent metrics ${agentName} --metric gateway_latency`);
1410
+ lines.push(' ```');
1411
+ lines.push('');
1412
+ lines.push('2. **Review token usage**');
1413
+ lines.push(' - High token usage = slow responses');
1414
+ lines.push(' - Optimize prompts to reduce tokens');
1415
+ lines.push('');
1416
+ lines.push('3. **Check tool execution time**');
1417
+ lines.push(' ```bash');
1418
+ lines.push(` glab duo agent trace <execution-id> --filter tool_duration`);
1419
+ lines.push(' ```');
1420
+ lines.push('');
1421
+ lines.push('4. **Consider faster model**');
1422
+ lines.push(' - Switch to `claude-haiku` or `gpt-4o-mini`');
1423
+ lines.push('');
1424
+ lines.push('### Token Limit Exceeded');
1425
+ lines.push('');
1426
+ lines.push('**Error:** `Token limit exceeded for model`');
1427
+ lines.push('');
1428
+ lines.push('**Solutions:**');
1429
+ lines.push('');
1430
+ lines.push('1. **Reduce prompt size**');
1431
+ lines.push(' - Shorten system prompt');
1432
+ lines.push(' - Remove unnecessary context');
1433
+ lines.push('');
1434
+ lines.push('2. **Limit conversation history**');
1435
+ lines.push(' - Reduce `max_history` parameter');
1436
+ lines.push(' - Summarize previous turns');
1437
+ lines.push('');
1438
+ lines.push('3. **Compress tool outputs**');
1439
+ lines.push(' - Summarize large file contents');
1440
+ lines.push(' - Return only relevant data');
1441
+ lines.push('');
1442
+ lines.push('4. **Switch to larger model**');
1443
+ lines.push(' - Use model with higher token limit');
1444
+ lines.push('');
1445
+ lines.push('### MCP Server Connection Failed');
1446
+ lines.push('');
1447
+ lines.push('**Error:** `Failed to connect to MCP server: <server-name>`');
1448
+ lines.push('');
1449
+ lines.push('**Solutions:**');
1450
+ lines.push('');
1451
+ lines.push('1. **Check MCP configuration**');
1452
+ lines.push(' ```bash');
1453
+ lines.push(' cat .gitlab/duo/mcp-config.json');
1454
+ lines.push(' ```');
1455
+ lines.push('');
1456
+ lines.push('2. **Verify server is installed**');
1457
+ lines.push(' ```bash');
1458
+ lines.push(' npm list @modelcontextprotocol/server-*');
1459
+ lines.push(' ```');
1460
+ lines.push('');
1461
+ lines.push('3. **Test server connection manually**');
1462
+ lines.push(' ```bash');
1463
+ lines.push(' npx @modelcontextprotocol/server-gitlab --test');
1464
+ lines.push(' ```');
1465
+ lines.push('');
1466
+ lines.push('4. **Check environment variables**');
1467
+ lines.push(' - Ensure required env vars are set');
1468
+ lines.push(' - Example: `GITLAB_TOKEN` for gitlab server');
1469
+ lines.push('');
1470
+ lines.push('### Webhook Trigger Not Firing');
1471
+ lines.push('');
1472
+ lines.push('**Symptom:** Webhook events not triggering agent');
1473
+ lines.push('');
1474
+ lines.push('**Solutions:**');
1475
+ lines.push('');
1476
+ lines.push('1. **Verify webhook configuration**');
1477
+ lines.push(' ```bash');
1478
+ lines.push(` cat .gitlab/duo/triggers/webhook.yaml`);
1479
+ lines.push(' ```');
1480
+ lines.push('');
1481
+ lines.push('2. **Check webhook URL**');
1482
+ lines.push(' - Ensure URL is accessible');
1483
+ lines.push(' - Test with curl');
1484
+ lines.push('');
1485
+ lines.push('3. **Verify authentication**');
1486
+ lines.push(' - Check WEBHOOK_TOKEN is set');
1487
+ lines.push(' - Verify token matches webhook config');
1488
+ lines.push('');
1489
+ lines.push('4. **Review webhook logs**');
1490
+ lines.push(' ```bash');
1491
+ lines.push(` glab duo agent logs ${agentName} --filter webhook`);
1492
+ lines.push(' ```');
1493
+ lines.push('');
1494
+ lines.push('## Diagnostic Commands');
1495
+ lines.push('');
1496
+ lines.push('```bash');
1497
+ lines.push('# Complete diagnostic report');
1498
+ lines.push(`glab duo agent diagnose ${agentName}`);
1499
+ lines.push('');
1500
+ lines.push('# Check agent configuration');
1501
+ lines.push(`glab duo agent config ${agentName}`);
1502
+ lines.push('');
1503
+ lines.push('# Validate flow definition');
1504
+ lines.push(`glab duo flow validate .gitlab/duo/flows/${agentName}.yaml`);
1505
+ lines.push('');
1506
+ lines.push('# Test agent locally');
1507
+ lines.push(`glab duo agent test ${agentName} --input "test message"`);
1508
+ lines.push('');
1509
+ lines.push('# Export debug bundle');
1510
+ lines.push(`glab duo agent debug-export ${agentName} > debug-bundle.tar.gz`);
1511
+ lines.push('```');
1512
+ lines.push('');
1513
+ lines.push('## Getting Help');
1514
+ lines.push('');
1515
+ lines.push('If issues persist:');
1516
+ lines.push('');
1517
+ lines.push('1. **Check GitLab Status** - https://status.gitlab.com');
1518
+ lines.push('2. **Review Documentation** - https://docs.gitlab.com/ee/user/gitlab_duo/');
1519
+ lines.push('3. **Open Support Ticket** - https://support.gitlab.com');
1520
+ lines.push('4. **Community Forum** - https://forum.gitlab.com');
1521
+ lines.push('');
1522
+ lines.push('## Debug Checklist');
1523
+ lines.push('');
1524
+ lines.push('Before opening a support ticket:');
1525
+ lines.push('');
1526
+ lines.push('- [ ] Agent status checked');
1527
+ lines.push('- [ ] Error logs reviewed');
1528
+ lines.push('- [ ] Authentication verified');
1529
+ lines.push('- [ ] Triggers validated');
1530
+ lines.push('- [ ] MCP servers tested');
1531
+ lines.push('- [ ] Network connectivity confirmed');
1532
+ lines.push('- [ ] Recent changes identified');
1533
+ lines.push('- [ ] Diagnostic report generated');
1534
+ lines.push('');
1535
+ return lines.join('\n');
1536
+ }
1537
+ /**
1538
+ * Generate FAQ.md
1539
+ */
1540
+ generateFAQ(manifest) {
1541
+ const agentName = this.getAgentName(manifest);
1542
+ const lines = [];
1543
+ lines.push(`# FAQ: ${manifest.metadata?.name || 'Agent'}`);
1544
+ lines.push('');
1545
+ lines.push('## General');
1546
+ lines.push('');
1547
+ lines.push('### What is this agent?');
1548
+ lines.push('');
1549
+ lines.push(manifest.metadata?.description ||
1550
+ 'A GitLab Duo agent for automating tasks.');
1551
+ lines.push('');
1552
+ lines.push('### How do I trigger this agent?');
1553
+ lines.push('');
1554
+ lines.push('Multiple ways:');
1555
+ lines.push('');
1556
+ lines.push(`- **Mention**: \`@${agentName}\` in issue/MR comments`);
1557
+ lines.push('- **Assignment**: Assign issue/MR to agent');
1558
+ lines.push('- **Schedule**: Runs automatically based on schedule');
1559
+ lines.push('- **Webhook**: Trigger via HTTP webhook');
1560
+ lines.push('');
1561
+ lines.push('### What permissions does the agent need?');
1562
+ lines.push('');
1563
+ lines.push('Required GitLab token scopes:');
1564
+ lines.push('');
1565
+ lines.push('- `api` - Full API access');
1566
+ lines.push('- `read_repository` - Read repository data');
1567
+ lines.push('- `write_repository` - Modify files (if applicable)');
1568
+ lines.push('');
1569
+ lines.push('## Deployment');
1570
+ lines.push('');
1571
+ lines.push('### How do I deploy this agent?');
1572
+ lines.push('');
1573
+ lines.push('Two deployment options:');
1574
+ lines.push('');
1575
+ lines.push('1. **Flow Agent** (Recommended) - Runs in GitLab Duo infrastructure');
1576
+ lines.push('2. **External Agent** - Runs in your CI/CD pipeline');
1577
+ lines.push('');
1578
+ lines.push('See [DEPLOYMENT.md](./DEPLOYMENT.md) for detailed instructions.');
1579
+ lines.push('');
1580
+ lines.push('### Can I test locally before deploying?');
1581
+ lines.push('');
1582
+ lines.push('Yes:');
1583
+ lines.push('');
1584
+ lines.push('```bash');
1585
+ lines.push('npm install');
1586
+ lines.push('npm run build');
1587
+ lines.push(`glab duo agent test ${agentName} --input "test message"`);
1588
+ lines.push('```');
1589
+ lines.push('');
1590
+ lines.push('### How do I update the agent?');
1591
+ lines.push('');
1592
+ lines.push('```bash');
1593
+ lines.push('# 1. Make changes locally');
1594
+ lines.push('# 2. Build');
1595
+ lines.push('npm run build');
1596
+ lines.push('');
1597
+ lines.push('# 3. Redeploy flow');
1598
+ lines.push(`glab duo flow deploy ${agentName} --update`);
1599
+ lines.push('```');
1600
+ lines.push('');
1601
+ lines.push('## Usage');
1602
+ lines.push('');
1603
+ lines.push('### How do I see agent execution history?');
1604
+ lines.push('');
1605
+ lines.push('```bash');
1606
+ lines.push(`glab duo agent executions ${agentName}`);
1607
+ lines.push('```');
1608
+ lines.push('');
1609
+ lines.push('### How do I view agent logs?');
1610
+ lines.push('');
1611
+ lines.push('```bash');
1612
+ lines.push(`# Recent logs`);
1613
+ lines.push(`glab duo agent logs ${agentName}`);
1614
+ lines.push('');
1615
+ lines.push('# Follow in real-time');
1616
+ lines.push(`glab duo agent logs ${agentName} --follow`);
1617
+ lines.push('```');
1618
+ lines.push('');
1619
+ lines.push('### Can the agent access private repositories?');
1620
+ lines.push('');
1621
+ lines.push('Yes, if the GitLab token has appropriate permissions. The agent can access any repository the token owner can access.');
1622
+ lines.push('');
1623
+ lines.push('### What tools does the agent have access to?');
1624
+ lines.push('');
1625
+ lines.push('See `.gitlab/duo/custom-tools.json` for complete list. Common tools:');
1626
+ lines.push('');
1627
+ lines.push('- File operations (read, write, search)');
1628
+ lines.push('- GitLab operations (issues, MRs, comments)');
1629
+ lines.push('- Shell commands (if enabled)');
1630
+ lines.push('');
1631
+ lines.push('## Customization');
1632
+ lines.push('');
1633
+ lines.push('### How do I modify the agent behavior?');
1634
+ lines.push('');
1635
+ lines.push('Edit the system prompt in `.gitlab/duo/flows/${agentName}.yaml`:');
1636
+ lines.push('');
1637
+ lines.push('```yaml');
1638
+ lines.push('prompts:');
1639
+ lines.push(` - prompt_id: ${agentName}_prompt`);
1640
+ lines.push(' prompt_template:');
1641
+ lines.push(' system: "Your custom instructions here"');
1642
+ lines.push('```');
1643
+ lines.push('');
1644
+ lines.push('### Can I add more triggers?');
1645
+ lines.push('');
1646
+ lines.push('Yes, create new trigger files in `.gitlab/duo/triggers/`:');
1647
+ lines.push('');
1648
+ lines.push('```yaml');
1649
+ lines.push('version: v1');
1650
+ lines.push(`agent_name: ${agentName}`);
1651
+ lines.push('trigger:');
1652
+ lines.push(' type: schedule');
1653
+ lines.push(' cron: "0 * * * *" # Hourly');
1654
+ lines.push('```');
1655
+ lines.push('');
1656
+ lines.push('### Can I use a different LLM model?');
1657
+ lines.push('');
1658
+ lines.push('Yes, edit the model configuration in flow YAML:');
1659
+ lines.push('');
1660
+ lines.push('```yaml');
1661
+ lines.push('prompts:');
1662
+ lines.push(' - model:');
1663
+ lines.push(' params:');
1664
+ lines.push(' model_class_provider: anthropic');
1665
+ lines.push(' model: claude-opus-4 # Change here');
1666
+ lines.push('```');
1667
+ lines.push('');
1668
+ lines.push('### How do I add custom tools?');
1669
+ lines.push('');
1670
+ lines.push('1. Define tool in `.gitlab/duo/custom-tools.json`');
1671
+ lines.push('2. Implement tool in `src/tools/`');
1672
+ lines.push('3. Register in MCP config');
1673
+ lines.push('4. Rebuild and redeploy');
1674
+ lines.push('');
1675
+ lines.push('## Troubleshooting');
1676
+ lines.push('');
1677
+ lines.push('### Agent not responding?');
1678
+ lines.push('');
1679
+ lines.push('See [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for detailed debugging steps.');
1680
+ lines.push('');
1681
+ lines.push('### High response time?');
1682
+ lines.push('');
1683
+ lines.push('Common causes:');
1684
+ lines.push('');
1685
+ lines.push('- Large prompt size → Reduce context');
1686
+ lines.push('- Many tool calls → Optimize workflow');
1687
+ lines.push('- Slow model → Use faster model (haiku, gpt-4o-mini)');
1688
+ lines.push('');
1689
+ lines.push('### Authentication errors?');
1690
+ lines.push('');
1691
+ lines.push('Check:');
1692
+ lines.push('');
1693
+ lines.push('1. GitLab token is valid: `glab auth status`');
1694
+ lines.push('2. Token has correct scopes');
1695
+ lines.push('3. Token not expired');
1696
+ lines.push('');
1697
+ lines.push('## Performance');
1698
+ lines.push('');
1699
+ lines.push('### How many executions can the agent handle?');
1700
+ lines.push('');
1701
+ lines.push('Depends on deployment mode:');
1702
+ lines.push('');
1703
+ lines.push('- **Flow Agent**: Scales automatically (GitLab handles infrastructure)');
1704
+ lines.push('- **External Agent**: Limited by CI/CD runners');
1705
+ lines.push('');
1706
+ lines.push('### What are the token limits?');
1707
+ lines.push('');
1708
+ lines.push('Varies by model:');
1709
+ lines.push('');
1710
+ lines.push('- Claude Sonnet 4: 200K tokens');
1711
+ lines.push('- GPT-4o: 128K tokens');
1712
+ lines.push('- Gemini 1.5 Pro: 2M tokens');
1713
+ lines.push('');
1714
+ lines.push('### How much does it cost to run?');
1715
+ lines.push('');
1716
+ lines.push('Costs depend on:');
1717
+ lines.push('');
1718
+ lines.push('- Model used (Claude, GPT, Gemini)');
1719
+ lines.push('- Token usage per execution');
1720
+ lines.push('- Number of executions');
1721
+ lines.push('');
1722
+ lines.push('Monitor costs: `glab duo agent metrics ${agentName} --metric token_usage`');
1723
+ lines.push('');
1724
+ lines.push('## Security');
1725
+ lines.push('');
1726
+ lines.push('### Is my data secure?');
1727
+ lines.push('');
1728
+ lines.push('Yes:');
1729
+ lines.push('');
1730
+ lines.push('- All data encrypted in transit (TLS)');
1731
+ lines.push('- Tokens stored as masked CI/CD variables');
1732
+ lines.push('- Conversation history not persisted');
1733
+ lines.push('- PII redaction enabled');
1734
+ lines.push('');
1735
+ lines.push('See [SECURITY.md](./SECURITY.md) for details.');
1736
+ lines.push('');
1737
+ lines.push('### Can I restrict agent permissions?');
1738
+ lines.push('');
1739
+ lines.push('Yes:');
1740
+ lines.push('');
1741
+ lines.push('- Limit GitLab token scopes');
1742
+ lines.push('- Restrict trigger permissions');
1743
+ lines.push('- Disable dangerous tools (shell execution)');
1744
+ lines.push('- Use read-only mode');
1745
+ lines.push('');
1746
+ lines.push('## Support');
1747
+ lines.push('');
1748
+ lines.push('### Where do I get help?');
1749
+ lines.push('');
1750
+ lines.push('1. Check [TROUBLESHOOTING.md](./TROUBLESHOOTING.md)');
1751
+ lines.push('2. Review [GitLab Duo Documentation](https://docs.gitlab.com/ee/user/gitlab_duo/)');
1752
+ lines.push('3. Open support ticket: https://support.gitlab.com');
1753
+ lines.push('4. Community forum: https://forum.gitlab.com');
1754
+ lines.push('');
1755
+ lines.push('### How do I report a bug?');
1756
+ lines.push('');
1757
+ lines.push('1. Generate diagnostic report: `glab duo agent diagnose ${agentName}`');
1758
+ lines.push('2. Open issue in GitLab project');
1759
+ lines.push('3. Include diagnostic report and error logs');
1760
+ lines.push('');
1761
+ lines.push('### Can I contribute improvements?');
1762
+ lines.push('');
1763
+ lines.push('Yes! Submit merge requests with:');
1764
+ lines.push('');
1765
+ lines.push('- Bug fixes');
1766
+ lines.push('- New features');
1767
+ lines.push('- Documentation improvements');
1768
+ lines.push('- Performance optimizations');
1769
+ lines.push('');
1770
+ return lines.join('\n');
1771
+ }
1772
+ /**
1773
+ * Generate ARCHITECTURE.md
1774
+ */
1775
+ generateArchitecture(manifest) {
1776
+ const agentName = this.getAgentName(manifest);
1777
+ const lines = [];
1778
+ lines.push(`# Architecture: ${manifest.metadata?.name || 'Agent'}`);
1779
+ lines.push('');
1780
+ lines.push('## Overview');
1781
+ lines.push('');
1782
+ lines.push('This document describes the architecture of this GitLab Duo agent, including its components, data flow, and integration points.');
1783
+ lines.push('');
1784
+ lines.push('## High-Level Architecture');
1785
+ lines.push('');
1786
+ lines.push('```');
1787
+ lines.push('┌─────────────────────────────────────────────────────────┐');
1788
+ lines.push('│ GitLab Platform │');
1789
+ lines.push('│ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │');
1790
+ lines.push('│ │ Issues │ │ MRs │ │ CI/CD Pipelines │ │');
1791
+ lines.push('│ └────┬─────┘ └────┬─────┘ └──────────┬───────────┘ │');
1792
+ lines.push('└───────┼─────────────┼──────────────────┼──────────────┘');
1793
+ lines.push(' │ │ │');
1794
+ lines.push(' └─────────────┼──────────────────┘');
1795
+ lines.push(' │ Triggers');
1796
+ lines.push(' ▼');
1797
+ lines.push(' ┌─────────────────────────────┐');
1798
+ lines.push(' │ GitLab Duo Flow Engine │');
1799
+ lines.push(' │ ┌────────────────────────┐ │');
1800
+ lines.push(' │ │ Trigger Handler │ │');
1801
+ lines.push(' │ └──────────┬─────────────┘ │');
1802
+ lines.push(' │ │ │');
1803
+ lines.push(' │ ┌──────────▼─────────────┐ │');
1804
+ lines.push(` │ │ ${agentName} Agent │ │`);
1805
+ lines.push(' │ │ - System Prompt │ │');
1806
+ lines.push(' │ │ - Router Logic │ │');
1807
+ lines.push(' │ │ - Component Exec │ │');
1808
+ lines.push(' │ └──────────┬─────────────┘ │');
1809
+ lines.push(' └─────────────┼───────────────┘');
1810
+ lines.push(' │');
1811
+ lines.push(' ▼');
1812
+ lines.push(' ┌─────────────────────────────┐');
1813
+ lines.push(' │ AI Gateway │');
1814
+ lines.push(' │ ┌────────────────────────┐ │');
1815
+ lines.push(' │ │ Model Router │ │');
1816
+ lines.push(' │ └──────────┬─────────────┘ │');
1817
+ lines.push(' │ │ │');
1818
+ lines.push(' │ ┌──────────▼─────────────┐ │');
1819
+ lines.push(' │ │ LLM Provider │ │');
1820
+ lines.push(' │ │ (Anthropic/OpenAI) │ │');
1821
+ lines.push(' │ └────────────────────────┘ │');
1822
+ lines.push(' └─────────────────────────────┘');
1823
+ lines.push(' │');
1824
+ lines.push(' ▼');
1825
+ lines.push(' ┌─────────────────────────────┐');
1826
+ lines.push(' │ MCP Servers │');
1827
+ lines.push(' │ ┌────────┐ ┌────────────┐ │');
1828
+ lines.push(' │ │ GitLab │ │ Filesystem │ │');
1829
+ lines.push(' │ └────────┘ └────────────┘ │');
1830
+ lines.push(' │ ┌────────┐ ┌────────────┐ │');
1831
+ lines.push(' │ │ Memory │ │ Custom │ │');
1832
+ lines.push(' │ └────────┘ └────────────┘ │');
1833
+ lines.push(' └─────────────────────────────┘');
1834
+ lines.push('```');
1835
+ lines.push('');
1836
+ lines.push('## Components');
1837
+ lines.push('');
1838
+ lines.push('### 1. Trigger System');
1839
+ lines.push('');
1840
+ lines.push('Manages agent activation based on events:');
1841
+ lines.push('');
1842
+ lines.push('- **Mention Trigger**: @agent mentions in issues/MRs');
1843
+ lines.push('- **Assignment Trigger**: Issue/MR assignments');
1844
+ lines.push('- **Schedule Trigger**: Cron-based execution');
1845
+ lines.push('- **Webhook Trigger**: External HTTP events');
1846
+ lines.push('- **Pipeline Trigger**: CI/CD pipeline events');
1847
+ lines.push('- **File Pattern Trigger**: File change detection');
1848
+ lines.push('');
1849
+ lines.push('**Location**: `.gitlab/duo/triggers/*.yaml`');
1850
+ lines.push('');
1851
+ lines.push('### 2. Flow Engine');
1852
+ lines.push('');
1853
+ lines.push('Orchestrates agent execution:');
1854
+ lines.push('');
1855
+ lines.push('- **Entry Point**: Receives trigger events');
1856
+ lines.push('- **Context Building**: Gathers relevant data');
1857
+ lines.push('- **Component Execution**: Runs agent components');
1858
+ lines.push('- **Router Logic**: Routes between components');
1859
+ lines.push('- **Output Handling**: Formats and delivers responses');
1860
+ lines.push('');
1861
+ lines.push('**Location**: `.gitlab/duo/flows/${agentName}.yaml`');
1862
+ lines.push('');
1863
+ lines.push('### 3. Agent Component');
1864
+ lines.push('');
1865
+ lines.push('Core agent logic:');
1866
+ lines.push('');
1867
+ lines.push('```typescript');
1868
+ lines.push('interface AgentComponent {');
1869
+ lines.push(' name: string;');
1870
+ lines.push(' type: "AgentComponent";');
1871
+ lines.push(' prompt_id: string;');
1872
+ lines.push(' toolset: string[];');
1873
+ lines.push(' inputs: FlowInput[];');
1874
+ lines.push('}');
1875
+ lines.push('```');
1876
+ lines.push('');
1877
+ lines.push('**Responsibilities:**');
1878
+ lines.push('- Receive task from trigger');
1879
+ lines.push('- Execute LLM inference');
1880
+ lines.push('- Call tools as needed');
1881
+ lines.push('- Return structured response');
1882
+ lines.push('');
1883
+ lines.push('### 4. Prompt System');
1884
+ lines.push('');
1885
+ lines.push('Manages LLM prompts:');
1886
+ lines.push('');
1887
+ lines.push('```yaml');
1888
+ lines.push('prompts:');
1889
+ lines.push(` - prompt_id: ${agentName}_prompt`);
1890
+ lines.push(' prompt_template:');
1891
+ lines.push(' system: "System instructions"');
1892
+ lines.push(' user: "{{task}}"');
1893
+ lines.push(' placeholder: history');
1894
+ lines.push(' model:');
1895
+ lines.push(' params:');
1896
+ lines.push(' model_class_provider: anthropic');
1897
+ lines.push(' model: claude-sonnet-4');
1898
+ lines.push('```');
1899
+ lines.push('');
1900
+ lines.push('### 5. Tool System (MCP)');
1901
+ lines.push('');
1902
+ lines.push('Provides tools via Model Context Protocol:');
1903
+ lines.push('');
1904
+ lines.push('**MCP Servers:**');
1905
+ lines.push('- `gitlab`: GitLab API operations');
1906
+ lines.push('- `filesystem`: File operations');
1907
+ lines.push('- `memory`: Persistent memory');
1908
+ lines.push('- `custom`: Custom tool implementations');
1909
+ lines.push('');
1910
+ lines.push('**Configuration**: `.gitlab/duo/mcp-config.json`');
1911
+ lines.push('');
1912
+ lines.push('### 6. Router System');
1913
+ lines.push('');
1914
+ lines.push('Controls execution flow:');
1915
+ lines.push('');
1916
+ lines.push('```yaml');
1917
+ lines.push('routers:');
1918
+ lines.push(' # Simple routing');
1919
+ lines.push(` - from: ${agentName}`);
1920
+ lines.push(' to: end');
1921
+ lines.push('');
1922
+ lines.push(' # Conditional routing');
1923
+ lines.push(` - from: ${agentName}`);
1924
+ lines.push(' condition:');
1925
+ lines.push(' input: decision');
1926
+ lines.push(' routes:');
1927
+ lines.push(' approve: next_step');
1928
+ lines.push(' reject: error_handler');
1929
+ lines.push('```');
1930
+ lines.push('');
1931
+ lines.push('## Data Flow');
1932
+ lines.push('');
1933
+ lines.push('### Execution Flow');
1934
+ lines.push('');
1935
+ lines.push('1. **Trigger Event**');
1936
+ lines.push(' - User mentions @agent in issue');
1937
+ lines.push(' - Trigger handler receives event');
1938
+ lines.push(' - Event validated and queued');
1939
+ lines.push('');
1940
+ lines.push('2. **Context Building**');
1941
+ lines.push(' - Fetch issue content');
1942
+ lines.push(' - Load conversation history');
1943
+ lines.push(' - Gather relevant context');
1944
+ lines.push('');
1945
+ lines.push('3. **Agent Execution**');
1946
+ lines.push(' - Load system prompt');
1947
+ lines.push(' - Build user message with context');
1948
+ lines.push(' - Send to AI Gateway');
1949
+ lines.push('');
1950
+ lines.push('4. **LLM Inference**');
1951
+ lines.push(' - AI Gateway routes to model provider');
1952
+ lines.push(' - LLM processes prompt');
1953
+ lines.push(' - Returns response with tool calls');
1954
+ lines.push('');
1955
+ lines.push('5. **Tool Execution**');
1956
+ lines.push(' - Parse tool calls');
1957
+ lines.push(' - Execute via MCP servers');
1958
+ lines.push(' - Return tool outputs');
1959
+ lines.push('');
1960
+ lines.push('6. **Response Generation**');
1961
+ lines.push(' - LLM processes tool outputs');
1962
+ lines.push(' - Generates final response');
1963
+ lines.push(' - Format for delivery');
1964
+ lines.push('');
1965
+ lines.push('7. **Response Delivery**');
1966
+ lines.push(' - Post comment to issue');
1967
+ lines.push(' - Update issue status (if applicable)');
1968
+ lines.push(' - Log execution metrics');
1969
+ lines.push('');
1970
+ lines.push('## Integration Points');
1971
+ lines.push('');
1972
+ lines.push('### GitLab API');
1973
+ lines.push('');
1974
+ lines.push('- **Authentication**: Personal access token');
1975
+ lines.push('- **Endpoints Used**:');
1976
+ lines.push(' - `/api/v4/projects/:id/issues`');
1977
+ lines.push(' - `/api/v4/projects/:id/merge_requests`');
1978
+ lines.push(' - `/api/v4/projects/:id/repository/files`');
1979
+ lines.push('- **Rate Limits**: 600 requests/minute');
1980
+ lines.push('');
1981
+ lines.push('### AI Gateway');
1982
+ lines.push('');
1983
+ lines.push('- **Protocol**: HTTP/2');
1984
+ lines.push('- **Authentication**: JWT token');
1985
+ lines.push('- **Endpoints**:');
1986
+ lines.push(' - `/v1/chat/completions` - LLM inference');
1987
+ lines.push(' - `/v1/embeddings` - Vector embeddings');
1988
+ lines.push('');
1989
+ lines.push('### MCP Servers');
1990
+ lines.push('');
1991
+ lines.push('- **Protocol**: JSON-RPC 2.0 over stdio');
1992
+ lines.push('- **Lifecycle**: Started on-demand, kept warm');
1993
+ lines.push('- **Communication**: Process IPC');
1994
+ lines.push('');
1995
+ lines.push('## Security Architecture');
1996
+ lines.push('');
1997
+ lines.push('### Authentication Chain');
1998
+ lines.push('');
1999
+ lines.push('```');
2000
+ lines.push('User → GitLab (OAuth) → Flow Engine (JWT) → AI Gateway (Token) → LLM Provider');
2001
+ lines.push('```');
2002
+ lines.push('');
2003
+ lines.push('### Data Security');
2004
+ lines.push('');
2005
+ lines.push('- **In Transit**: TLS 1.3 encryption');
2006
+ lines.push('- **At Rest**: No persistent storage (ephemeral)');
2007
+ lines.push('- **Token Storage**: GitLab CI/CD variables (masked)');
2008
+ lines.push('- **PII Handling**: Redacted before logging');
2009
+ lines.push('');
2010
+ lines.push('## Scalability');
2011
+ lines.push('');
2012
+ lines.push('### Flow Agent (Managed)');
2013
+ lines.push('');
2014
+ lines.push('- Horizontal scaling (GitLab manages)');
2015
+ lines.push('- Auto-scales based on load');
2016
+ lines.push('- No infrastructure management');
2017
+ lines.push('');
2018
+ lines.push('### External Agent (Self-Hosted)');
2019
+ lines.push('');
2020
+ lines.push('- Scales with CI/CD runner capacity');
2021
+ lines.push('- Concurrent execution limited by runners');
2022
+ lines.push('- Manual scaling required');
2023
+ lines.push('');
2024
+ lines.push('## Monitoring & Observability');
2025
+ lines.push('');
2026
+ lines.push('### Metrics Collected');
2027
+ lines.push('');
2028
+ lines.push('- Execution count');
2029
+ lines.push('- Response time (p50, p95, p99)');
2030
+ lines.push('- Error rate');
2031
+ lines.push('- Token usage');
2032
+ lines.push('- Tool call count');
2033
+ lines.push('');
2034
+ lines.push('### Logging');
2035
+ lines.push('');
2036
+ lines.push('- **Levels**: ERROR, WARN, INFO, DEBUG');
2037
+ lines.push('- **Retention**: 30 days');
2038
+ lines.push('- **Format**: Structured JSON');
2039
+ lines.push('');
2040
+ lines.push('### Tracing');
2041
+ lines.push('');
2042
+ lines.push('- Distributed tracing via OpenTelemetry');
2043
+ lines.push('- Trace ID propagation through components');
2044
+ lines.push('- Full execution path visualization');
2045
+ lines.push('');
2046
+ lines.push('## Deployment Models');
2047
+ lines.push('');
2048
+ lines.push('### Flow Agent (Recommended)');
2049
+ lines.push('');
2050
+ lines.push('**Pros:**');
2051
+ lines.push('- Zero infrastructure management');
2052
+ lines.push('- Auto-scaling');
2053
+ lines.push('- Built-in monitoring');
2054
+ lines.push('- Faster cold starts');
2055
+ lines.push('');
2056
+ lines.push('**Cons:**');
2057
+ lines.push('- Less control over execution environment');
2058
+ lines.push('- Potential vendor lock-in');
2059
+ lines.push('');
2060
+ lines.push('### External Agent');
2061
+ lines.push('');
2062
+ lines.push('**Pros:**');
2063
+ lines.push('- Full control over environment');
2064
+ lines.push('- Can use private runners');
2065
+ lines.push('- Custom dependencies');
2066
+ lines.push('');
2067
+ lines.push('**Cons:**');
2068
+ lines.push('- Manual scaling required');
2069
+ lines.push('- Infrastructure management overhead');
2070
+ lines.push('- Slower cold starts');
2071
+ lines.push('');
2072
+ lines.push('## Future Enhancements');
2073
+ lines.push('');
2074
+ lines.push('Planned improvements:');
2075
+ lines.push('');
2076
+ lines.push('- [ ] Multi-agent orchestration');
2077
+ lines.push('- [ ] Persistent memory across sessions');
2078
+ lines.push('- [ ] Advanced router patterns (parallel, conditional)');
2079
+ lines.push('- [ ] Custom model fine-tuning');
2080
+ lines.push('- [ ] Enhanced error recovery');
2081
+ lines.push('- [ ] Real-time streaming responses');
2082
+ lines.push('');
2083
+ return lines.join('\n');
2084
+ }
2085
+ /**
2086
+ * Generate API.md
2087
+ */
2088
+ generateAPIDocumentation(manifest) {
2089
+ const agentName = this.getAgentName(manifest);
2090
+ const lines = [];
2091
+ lines.push(`# API Documentation: ${manifest.metadata?.name || 'Agent'}`);
2092
+ lines.push('');
2093
+ lines.push('## Overview');
2094
+ lines.push('');
2095
+ lines.push('This document describes the APIs for interacting with this GitLab Duo agent programmatically.');
2096
+ lines.push('');
2097
+ lines.push('## GitLab API Integration');
2098
+ lines.push('');
2099
+ lines.push('### Trigger Agent via API');
2100
+ lines.push('');
2101
+ lines.push('**Endpoint:** `POST /api/v4/projects/:id/duo/agents/:agent_id/trigger`');
2102
+ lines.push('');
2103
+ lines.push('**Authentication:** GitLab personal access token with `api` scope');
2104
+ lines.push('');
2105
+ lines.push('**Request:**');
2106
+ lines.push('```bash');
2107
+ lines.push('curl -X POST \\');
2108
+ lines.push(' "https://gitlab.com/api/v4/projects/PROJECT_ID/duo/agents/${agentName}/trigger" \\');
2109
+ lines.push(' -H "PRIVATE-TOKEN: YOUR_TOKEN" \\');
2110
+ lines.push(' -H "Content-Type: application/json" \\');
2111
+ lines.push(" -d '{");
2112
+ lines.push(' "input": "Your task description",');
2113
+ lines.push(' "context": {');
2114
+ lines.push(' "issue_iid": 123,');
2115
+ lines.push(' "merge_request_iid": 456');
2116
+ lines.push(' }');
2117
+ lines.push(" }'");
2118
+ lines.push('```');
2119
+ lines.push('');
2120
+ lines.push('**Response:**');
2121
+ lines.push('```json');
2122
+ lines.push('{');
2123
+ lines.push(' "execution_id": "exec-abc123",');
2124
+ lines.push(' "status": "running",');
2125
+ lines.push(' "created_at": "2026-02-07T00:00:00Z"');
2126
+ lines.push('}');
2127
+ lines.push('```');
2128
+ lines.push('');
2129
+ lines.push('### Check Execution Status');
2130
+ lines.push('');
2131
+ lines.push('**Endpoint:** `GET /api/v4/projects/:id/duo/agents/:agent_id/executions/:execution_id`');
2132
+ lines.push('');
2133
+ lines.push('**Request:**');
2134
+ lines.push('```bash');
2135
+ lines.push('curl "https://gitlab.com/api/v4/projects/PROJECT_ID/duo/agents/${agentName}/executions/exec-abc123" \\');
2136
+ lines.push(' -H "PRIVATE-TOKEN: YOUR_TOKEN"');
2137
+ lines.push('```');
2138
+ lines.push('');
2139
+ lines.push('**Response:**');
2140
+ lines.push('```json');
2141
+ lines.push('{');
2142
+ lines.push(' "execution_id": "exec-abc123",');
2143
+ lines.push(' "status": "completed",');
2144
+ lines.push(' "result": {');
2145
+ lines.push(' "output": "Task completed successfully",');
2146
+ lines.push(' "tool_calls": 3,');
2147
+ lines.push(' "tokens_used": 1245');
2148
+ lines.push(' },');
2149
+ lines.push(' "created_at": "2026-02-07T00:00:00Z",');
2150
+ lines.push(' "completed_at": "2026-02-07T00:00:15Z"');
2151
+ lines.push('}');
2152
+ lines.push('```');
2153
+ lines.push('');
2154
+ lines.push('### List Agent Executions');
2155
+ lines.push('');
2156
+ lines.push('**Endpoint:** `GET /api/v4/projects/:id/duo/agents/:agent_id/executions`');
2157
+ lines.push('');
2158
+ lines.push('**Query Parameters:**');
2159
+ lines.push('- `page` - Page number (default: 1)');
2160
+ lines.push('- `per_page` - Items per page (default: 20, max: 100)');
2161
+ lines.push('- `status` - Filter by status (`running`, `completed`, `failed`)');
2162
+ lines.push('- `since` - Filter executions after date (ISO 8601)');
2163
+ lines.push('');
2164
+ lines.push('**Request:**');
2165
+ lines.push('```bash');
2166
+ lines.push('curl "https://gitlab.com/api/v4/projects/PROJECT_ID/duo/agents/${agentName}/executions?status=completed&per_page=10" \\');
2167
+ lines.push(' -H "PRIVATE-TOKEN: YOUR_TOKEN"');
2168
+ lines.push('```');
2169
+ lines.push('');
2170
+ lines.push('### Get Agent Logs');
2171
+ lines.push('');
2172
+ lines.push('**Endpoint:** `GET /api/v4/projects/:id/duo/agents/:agent_id/logs`');
2173
+ lines.push('');
2174
+ lines.push('**Query Parameters:**');
2175
+ lines.push('- `execution_id` - Filter by execution');
2176
+ lines.push('- `level` - Filter by log level (`ERROR`, `WARN`, `INFO`, `DEBUG`)');
2177
+ lines.push('- `since` - Filter logs after timestamp');
2178
+ lines.push('- `limit` - Max number of log entries (default: 100, max: 1000)');
2179
+ lines.push('');
2180
+ lines.push('**Request:**');
2181
+ lines.push('```bash');
2182
+ lines.push('curl "https://gitlab.com/api/v4/projects/PROJECT_ID/duo/agents/${agentName}/logs?level=ERROR&limit=50" \\');
2183
+ lines.push(' -H "PRIVATE-TOKEN: YOUR_TOKEN"');
2184
+ lines.push('```');
2185
+ lines.push('');
2186
+ lines.push('### Get Agent Metrics');
2187
+ lines.push('');
2188
+ lines.push('**Endpoint:** `GET /api/v4/projects/:id/duo/agents/:agent_id/metrics`');
2189
+ lines.push('');
2190
+ lines.push('**Query Parameters:**');
2191
+ lines.push('- `metric` - Specific metric name (optional)');
2192
+ lines.push('- `period` - Time period (`1h`, `24h`, `7d`, `30d`)');
2193
+ lines.push('- `format` - Output format (`json`, `prometheus`)');
2194
+ lines.push('');
2195
+ lines.push('**Request:**');
2196
+ lines.push('```bash');
2197
+ lines.push('curl "https://gitlab.com/api/v4/projects/PROJECT_ID/duo/agents/${agentName}/metrics?period=24h" \\');
2198
+ lines.push(' -H "PRIVATE-TOKEN: YOUR_TOKEN"');
2199
+ lines.push('```');
2200
+ lines.push('');
2201
+ lines.push('**Response:**');
2202
+ lines.push('```json');
2203
+ lines.push('{');
2204
+ lines.push(' "period": "24h",');
2205
+ lines.push(' "metrics": {');
2206
+ lines.push(' "execution_count": 142,');
2207
+ lines.push(' "success_rate": 0.985,');
2208
+ lines.push(' "avg_response_time_ms": 3245,');
2209
+ lines.push(' "p95_response_time_ms": 8932,');
2210
+ lines.push(' "total_tokens_used": 125430,');
2211
+ lines.push(' "error_count": 2');
2212
+ lines.push(' }');
2213
+ lines.push('}');
2214
+ lines.push('```');
2215
+ lines.push('');
2216
+ lines.push('## Webhook API');
2217
+ lines.push('');
2218
+ lines.push('### Trigger via Webhook');
2219
+ lines.push('');
2220
+ lines.push('If webhook trigger is configured (`.gitlab/duo/triggers/webhook.yaml`):');
2221
+ lines.push('');
2222
+ lines.push('**Endpoint:** Your configured webhook URL');
2223
+ lines.push('');
2224
+ lines.push('**Authentication:** Bearer token (set in `WEBHOOK_TOKEN`)');
2225
+ lines.push('');
2226
+ lines.push('**Request:**');
2227
+ lines.push('```bash');
2228
+ lines.push('curl -X POST \\');
2229
+ lines.push(' "https://your-instance.com/webhooks/${agentName}" \\');
2230
+ lines.push(' -H "Authorization: Bearer YOUR_WEBHOOK_TOKEN" \\');
2231
+ lines.push(' -H "Content-Type: application/json" \\');
2232
+ lines.push(" -d '{");
2233
+ lines.push(' "event": "custom_event",');
2234
+ lines.push(' "data": {');
2235
+ lines.push(' "key": "value"');
2236
+ lines.push(' }');
2237
+ lines.push(" }'");
2238
+ lines.push('```');
2239
+ lines.push('');
2240
+ lines.push('## glab CLI');
2241
+ lines.push('');
2242
+ lines.push('### Command Reference');
2243
+ lines.push('');
2244
+ lines.push('```bash');
2245
+ lines.push('# Trigger agent');
2246
+ lines.push(`glab duo agent trigger ${agentName} --input "task description"`);
2247
+ lines.push('');
2248
+ lines.push('# List executions');
2249
+ lines.push(`glab duo agent executions ${agentName}`);
2250
+ lines.push('');
2251
+ lines.push('# View logs');
2252
+ lines.push(`glab duo agent logs ${agentName} --follow`);
2253
+ lines.push('');
2254
+ lines.push('# Get metrics');
2255
+ lines.push(`glab duo agent metrics ${agentName} --period 24h`);
2256
+ lines.push('');
2257
+ lines.push('# Check status');
2258
+ lines.push(`glab duo agent status ${agentName}`);
2259
+ lines.push('');
2260
+ lines.push('# Test agent');
2261
+ lines.push(`glab duo agent test ${agentName} --input "test input"`);
2262
+ lines.push('```');
2263
+ lines.push('');
2264
+ lines.push('## SDK Examples');
2265
+ lines.push('');
2266
+ lines.push('### TypeScript/Node.js');
2267
+ lines.push('');
2268
+ lines.push('```typescript');
2269
+ lines.push('import { Gitlab } from "@gitbeaker/rest";');
2270
+ lines.push('');
2271
+ lines.push('const api = new Gitlab({');
2272
+ lines.push(' token: process.env.GITLAB_TOKEN,');
2273
+ lines.push(' host: "https://gitlab.com",');
2274
+ lines.push('});');
2275
+ lines.push('');
2276
+ lines.push('// Trigger agent');
2277
+ lines.push('const execution = await api.DuoAgents.trigger(');
2278
+ lines.push(' "project-id",');
2279
+ lines.push(` "${agentName}",`);
2280
+ lines.push(' {');
2281
+ lines.push(' input: "Your task",');
2282
+ lines.push(' context: { issue_iid: 123 },');
2283
+ lines.push(' }');
2284
+ lines.push(');');
2285
+ lines.push('');
2286
+ lines.push('// Wait for completion');
2287
+ lines.push('let status = "running";');
2288
+ lines.push('while (status === "running") {');
2289
+ lines.push(' await new Promise(resolve => setTimeout(resolve, 1000));');
2290
+ lines.push(' const result = await api.DuoAgents.getExecution(');
2291
+ lines.push(' "project-id",');
2292
+ lines.push(` "${agentName}",`);
2293
+ lines.push(' execution.execution_id');
2294
+ lines.push(' );');
2295
+ lines.push(' status = result.status;');
2296
+ lines.push('}');
2297
+ lines.push('```');
2298
+ lines.push('');
2299
+ lines.push('### Python');
2300
+ lines.push('');
2301
+ lines.push('```python');
2302
+ lines.push('import gitlab');
2303
+ lines.push('import time');
2304
+ lines.push('');
2305
+ lines.push('gl = gitlab.Gitlab("https://gitlab.com", private_token="YOUR_TOKEN")');
2306
+ lines.push('project = gl.projects.get("project-id")');
2307
+ lines.push('');
2308
+ lines.push('# Trigger agent');
2309
+ lines.push(`execution = project.duo_agents.get("${agentName}").trigger(`);
2310
+ lines.push(' input="Your task",');
2311
+ lines.push(' context={"issue_iid": 123}');
2312
+ lines.push(')');
2313
+ lines.push('');
2314
+ lines.push('# Wait for completion');
2315
+ lines.push('while execution.status == "running":');
2316
+ lines.push(' time.sleep(1)');
2317
+ lines.push(' execution.refresh()');
2318
+ lines.push('');
2319
+ lines.push('print(f"Result: {execution.result}")');
2320
+ lines.push('```');
2321
+ lines.push('');
2322
+ lines.push('## Rate Limits');
2323
+ lines.push('');
2324
+ lines.push('| Operation | Limit | Period |');
2325
+ lines.push('|-----------|-------|--------|');
2326
+ lines.push('| Agent Triggers | 100 | per hour |');
2327
+ lines.push('| API Requests | 600 | per minute |');
2328
+ lines.push('| Webhook Calls | 1000 | per hour |');
2329
+ lines.push('');
2330
+ lines.push('**Rate Limit Headers:**');
2331
+ lines.push('```');
2332
+ lines.push('RateLimit-Limit: 600');
2333
+ lines.push('RateLimit-Remaining: 599');
2334
+ lines.push('RateLimit-Reset: 1612137600');
2335
+ lines.push('```');
2336
+ lines.push('');
2337
+ lines.push('## Error Responses');
2338
+ lines.push('');
2339
+ lines.push('### 400 Bad Request');
2340
+ lines.push('```json');
2341
+ lines.push('{');
2342
+ lines.push(' "error": "Invalid input",');
2343
+ lines.push(' "message": "Input field is required"');
2344
+ lines.push('}');
2345
+ lines.push('```');
2346
+ lines.push('');
2347
+ lines.push('### 401 Unauthorized');
2348
+ lines.push('```json');
2349
+ lines.push('{');
2350
+ lines.push(' "error": "Unauthorized",');
2351
+ lines.push(' "message": "Invalid or expired token"');
2352
+ lines.push('}');
2353
+ lines.push('```');
2354
+ lines.push('');
2355
+ lines.push('### 404 Not Found');
2356
+ lines.push('```json');
2357
+ lines.push('{');
2358
+ lines.push(' "error": "Not found",');
2359
+ lines.push(' "message": "Agent not found"');
2360
+ lines.push('}');
2361
+ lines.push('```');
2362
+ lines.push('');
2363
+ lines.push('### 429 Too Many Requests');
2364
+ lines.push('```json');
2365
+ lines.push('{');
2366
+ lines.push(' "error": "Rate limit exceeded",');
2367
+ lines.push(' "message": "Too many requests, retry after 60 seconds",');
2368
+ lines.push(' "retry_after": 60');
2369
+ lines.push('}');
2370
+ lines.push('```');
2371
+ lines.push('');
2372
+ lines.push('### 500 Internal Server Error');
2373
+ lines.push('```json');
2374
+ lines.push('{');
2375
+ lines.push(' "error": "Internal error",');
2376
+ lines.push(' "message": "Agent execution failed",');
2377
+ lines.push(' "trace_id": "abc123"');
2378
+ lines.push('}');
2379
+ lines.push('```');
2380
+ lines.push('');
2381
+ lines.push('## Best Practices');
2382
+ lines.push('');
2383
+ lines.push("1. **Use polling with backoff** - Don't spam status checks");
2384
+ lines.push('2. **Handle rate limits** - Respect RateLimit headers');
2385
+ lines.push('3. **Include context** - Provide issue/MR context when available');
2386
+ lines.push('4. **Validate inputs** - Check input format before triggering');
2387
+ lines.push('5. **Log trace IDs** - Include trace_id in error reports');
2388
+ lines.push('');
2389
+ lines.push('## OpenAPI Specification');
2390
+ lines.push('');
2391
+ lines.push('Full OpenAPI spec available at:');
2392
+ lines.push('');
2393
+ lines.push('```bash');
2394
+ lines.push('# Download OpenAPI spec');
2395
+ lines.push('curl "https://gitlab.com/api/v4/duo/openapi.yaml" > openapi.yaml');
2396
+ lines.push('```');
2397
+ lines.push('');
2398
+ return lines.join('\n');
2399
+ }
2400
+ }
2401
+ //# sourceMappingURL=package-generator.js.map