@contractspec/example.agent-console 1.57.0 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/.turbo/turbo-build.log +210 -278
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +16 -0
  4. package/dist/agent/agent.entity.d.ts +35 -40
  5. package/dist/agent/agent.entity.d.ts.map +1 -1
  6. package/dist/agent/agent.entity.js +124 -132
  7. package/dist/agent/agent.enum.d.ts +3 -8
  8. package/dist/agent/agent.enum.d.ts.map +1 -1
  9. package/dist/agent/agent.enum.js +22 -30
  10. package/dist/agent/agent.event.d.ts +105 -111
  11. package/dist/agent/agent.event.d.ts.map +1 -1
  12. package/dist/agent/agent.event.js +107 -200
  13. package/dist/agent/agent.handler.d.ts +74 -77
  14. package/dist/agent/agent.handler.d.ts.map +1 -1
  15. package/dist/agent/agent.handler.js +293 -75
  16. package/dist/agent/agent.operation.d.ts +424 -430
  17. package/dist/agent/agent.operation.d.ts.map +1 -1
  18. package/dist/agent/agent.operation.js +728 -478
  19. package/dist/agent/agent.presentation.d.ts +3 -8
  20. package/dist/agent/agent.presentation.d.ts.map +1 -1
  21. package/dist/agent/agent.presentation.js +275 -84
  22. package/dist/agent/agent.schema.d.ts +371 -376
  23. package/dist/agent/agent.schema.d.ts.map +1 -1
  24. package/dist/agent/agent.schema.js +209 -399
  25. package/dist/agent/agent.test-spec.d.ts +2 -7
  26. package/dist/agent/agent.test-spec.d.ts.map +1 -1
  27. package/dist/agent/agent.test-spec.js +56 -62
  28. package/dist/agent/index.d.ts +11 -8
  29. package/dist/agent/index.d.ts.map +1 -0
  30. package/dist/agent/index.js +1245 -9
  31. package/dist/agent.capability.d.ts +1 -6
  32. package/dist/agent.capability.d.ts.map +1 -1
  33. package/dist/agent.capability.js +17 -20
  34. package/dist/agent.feature.d.ts +7 -6
  35. package/dist/agent.feature.d.ts.map +1 -1
  36. package/dist/agent.feature.js +117 -303
  37. package/dist/browser/agent/agent.entity.js +127 -0
  38. package/dist/browser/agent/agent.enum.js +25 -0
  39. package/dist/browser/agent/agent.event.js +116 -0
  40. package/dist/browser/agent/agent.handler.js +301 -0
  41. package/dist/browser/agent/agent.operation.js +735 -0
  42. package/dist/browser/agent/agent.presentation.js +279 -0
  43. package/dist/browser/agent/agent.schema.js +215 -0
  44. package/dist/browser/agent/agent.test-spec.js +58 -0
  45. package/dist/browser/agent/index.js +1244 -0
  46. package/dist/browser/agent.capability.js +16 -0
  47. package/dist/browser/agent.feature.js +118 -0
  48. package/dist/browser/docs/agent-console.docblock.js +93 -0
  49. package/dist/browser/docs/index.js +93 -0
  50. package/dist/browser/example.js +42 -0
  51. package/dist/browser/handlers/agent.handlers.js +252 -0
  52. package/dist/browser/handlers/index.js +799 -0
  53. package/dist/browser/index.js +5895 -0
  54. package/dist/browser/presentations/index.js +684 -0
  55. package/dist/browser/run/index.js +1350 -0
  56. package/dist/browser/run/run.entity.js +160 -0
  57. package/dist/browser/run/run.enum.js +34 -0
  58. package/dist/browser/run/run.event.js +213 -0
  59. package/dist/browser/run/run.handler.js +254 -0
  60. package/dist/browser/run/run.operation.js +667 -0
  61. package/dist/browser/run/run.presentation.js +220 -0
  62. package/dist/browser/run/run.schema.js +179 -0
  63. package/dist/browser/run/run.test-spec.js +58 -0
  64. package/dist/browser/seeders/index.js +21 -0
  65. package/dist/browser/shared/index.js +334 -0
  66. package/dist/browser/shared/mock-agents.js +82 -0
  67. package/dist/browser/shared/mock-runs.js +108 -0
  68. package/dist/browser/shared/mock-tools.js +146 -0
  69. package/dist/browser/shared/overlay-types.js +0 -0
  70. package/dist/browser/tool/index.js +946 -0
  71. package/dist/browser/tool/tool.entity.js +90 -0
  72. package/dist/browser/tool/tool.enum.js +26 -0
  73. package/dist/browser/tool/tool.event.js +99 -0
  74. package/dist/browser/tool/tool.handler.js +223 -0
  75. package/dist/browser/tool/tool.operation.js +482 -0
  76. package/dist/browser/tool/tool.presentation.js +185 -0
  77. package/dist/browser/tool/tool.schema.js +141 -0
  78. package/dist/browser/tool/tool.test-spec.js +58 -0
  79. package/dist/browser/ui/AgentDashboard.js +1607 -0
  80. package/dist/browser/ui/AgentRunList.js +250 -0
  81. package/dist/browser/ui/AgentToolRegistry.js +212 -0
  82. package/dist/browser/ui/hooks/index.js +271 -0
  83. package/dist/browser/ui/hooks/useAgentList.js +55 -0
  84. package/dist/browser/ui/hooks/useAgentMutations.js +76 -0
  85. package/dist/browser/ui/hooks/useRunList.js +55 -0
  86. package/dist/browser/ui/hooks/useToolList.js +85 -0
  87. package/dist/browser/ui/index.js +2080 -0
  88. package/dist/browser/ui/modals/AgentActionsModal.js +304 -0
  89. package/dist/browser/ui/modals/CreateAgentModal.js +229 -0
  90. package/dist/browser/ui/modals/index.js +532 -0
  91. package/dist/browser/ui/overlays/demo-overlays.js +64 -0
  92. package/dist/browser/ui/overlays/index.js +64 -0
  93. package/dist/browser/ui/renderers/agent-list.markdown.js +55 -0
  94. package/dist/browser/ui/renderers/agent-list.renderer.js +180 -0
  95. package/dist/browser/ui/renderers/dashboard.markdown.js +117 -0
  96. package/dist/browser/ui/renderers/index.js +446 -0
  97. package/dist/browser/ui/renderers/run-list.markdown.js +45 -0
  98. package/dist/browser/ui/renderers/tool-registry.markdown.js +53 -0
  99. package/dist/browser/ui/views/AgentListView.js +165 -0
  100. package/dist/browser/ui/views/RunListView.js +247 -0
  101. package/dist/browser/ui/views/ToolRegistryView.js +209 -0
  102. package/dist/browser/ui/views/index.js +619 -0
  103. package/dist/docs/agent-console.docblock.d.ts +2 -1
  104. package/dist/docs/agent-console.docblock.d.ts.map +1 -0
  105. package/dist/docs/agent-console.docblock.js +45 -64
  106. package/dist/docs/index.d.ts +2 -1
  107. package/dist/docs/index.d.ts.map +1 -0
  108. package/dist/docs/index.js +94 -1
  109. package/dist/example.d.ts +2 -6
  110. package/dist/example.d.ts.map +1 -1
  111. package/dist/example.js +41 -55
  112. package/dist/handlers/agent.handlers.d.ts +121 -120
  113. package/dist/handlers/agent.handlers.d.ts.map +1 -1
  114. package/dist/handlers/agent.handlers.js +235 -245
  115. package/dist/handlers/index.d.ts +8 -5
  116. package/dist/handlers/index.d.ts.map +1 -0
  117. package/dist/handlers/index.js +799 -5
  118. package/dist/index.d.ts +26 -48
  119. package/dist/index.d.ts.map +1 -0
  120. package/dist/index.js +5896 -50
  121. package/dist/node/agent/agent.entity.js +127 -0
  122. package/dist/node/agent/agent.enum.js +25 -0
  123. package/dist/node/agent/agent.event.js +116 -0
  124. package/dist/node/agent/agent.handler.js +301 -0
  125. package/dist/node/agent/agent.operation.js +735 -0
  126. package/dist/node/agent/agent.presentation.js +279 -0
  127. package/dist/node/agent/agent.schema.js +215 -0
  128. package/dist/node/agent/agent.test-spec.js +58 -0
  129. package/dist/node/agent/index.js +1244 -0
  130. package/dist/node/agent.capability.js +16 -0
  131. package/dist/node/agent.feature.js +118 -0
  132. package/dist/node/docs/agent-console.docblock.js +93 -0
  133. package/dist/node/docs/index.js +93 -0
  134. package/dist/node/example.js +42 -0
  135. package/dist/node/handlers/agent.handlers.js +252 -0
  136. package/dist/node/handlers/index.js +799 -0
  137. package/dist/node/index.js +5895 -0
  138. package/dist/node/presentations/index.js +684 -0
  139. package/dist/node/run/index.js +1350 -0
  140. package/dist/node/run/run.entity.js +160 -0
  141. package/dist/node/run/run.enum.js +34 -0
  142. package/dist/node/run/run.event.js +213 -0
  143. package/dist/node/run/run.handler.js +254 -0
  144. package/dist/node/run/run.operation.js +667 -0
  145. package/dist/node/run/run.presentation.js +220 -0
  146. package/dist/node/run/run.schema.js +179 -0
  147. package/dist/node/run/run.test-spec.js +58 -0
  148. package/dist/node/seeders/index.js +21 -0
  149. package/dist/node/shared/index.js +334 -0
  150. package/dist/node/shared/mock-agents.js +82 -0
  151. package/dist/node/shared/mock-runs.js +108 -0
  152. package/dist/node/shared/mock-tools.js +146 -0
  153. package/dist/node/shared/overlay-types.js +0 -0
  154. package/dist/node/tool/index.js +946 -0
  155. package/dist/node/tool/tool.entity.js +90 -0
  156. package/dist/node/tool/tool.enum.js +26 -0
  157. package/dist/node/tool/tool.event.js +99 -0
  158. package/dist/node/tool/tool.handler.js +223 -0
  159. package/dist/node/tool/tool.operation.js +482 -0
  160. package/dist/node/tool/tool.presentation.js +185 -0
  161. package/dist/node/tool/tool.schema.js +141 -0
  162. package/dist/node/tool/tool.test-spec.js +58 -0
  163. package/dist/node/ui/AgentDashboard.js +1607 -0
  164. package/dist/node/ui/AgentRunList.js +250 -0
  165. package/dist/node/ui/AgentToolRegistry.js +212 -0
  166. package/dist/node/ui/hooks/index.js +271 -0
  167. package/dist/node/ui/hooks/useAgentList.js +55 -0
  168. package/dist/node/ui/hooks/useAgentMutations.js +76 -0
  169. package/dist/node/ui/hooks/useRunList.js +55 -0
  170. package/dist/node/ui/hooks/useToolList.js +85 -0
  171. package/dist/node/ui/index.js +2080 -0
  172. package/dist/node/ui/modals/AgentActionsModal.js +304 -0
  173. package/dist/node/ui/modals/CreateAgentModal.js +229 -0
  174. package/dist/node/ui/modals/index.js +532 -0
  175. package/dist/node/ui/overlays/demo-overlays.js +64 -0
  176. package/dist/node/ui/overlays/index.js +64 -0
  177. package/dist/node/ui/renderers/agent-list.markdown.js +55 -0
  178. package/dist/node/ui/renderers/agent-list.renderer.js +180 -0
  179. package/dist/node/ui/renderers/dashboard.markdown.js +117 -0
  180. package/dist/node/ui/renderers/index.js +446 -0
  181. package/dist/node/ui/renderers/run-list.markdown.js +45 -0
  182. package/dist/node/ui/renderers/tool-registry.markdown.js +53 -0
  183. package/dist/node/ui/views/AgentListView.js +165 -0
  184. package/dist/node/ui/views/RunListView.js +247 -0
  185. package/dist/node/ui/views/ToolRegistryView.js +209 -0
  186. package/dist/node/ui/views/index.js +619 -0
  187. package/dist/presentations/index.d.ts +9 -4
  188. package/dist/presentations/index.d.ts.map +1 -0
  189. package/dist/presentations/index.js +684 -4
  190. package/dist/run/index.d.ts +11 -8
  191. package/dist/run/index.d.ts.map +1 -0
  192. package/dist/run/index.js +1351 -9
  193. package/dist/run/run.entity.d.ts +55 -60
  194. package/dist/run/run.entity.d.ts.map +1 -1
  195. package/dist/run/run.entity.js +155 -199
  196. package/dist/run/run.enum.d.ts +4 -9
  197. package/dist/run/run.enum.d.ts.map +1 -1
  198. package/dist/run/run.enum.js +30 -40
  199. package/dist/run/run.event.d.ts +255 -261
  200. package/dist/run/run.event.d.ts.map +1 -1
  201. package/dist/run/run.event.js +198 -418
  202. package/dist/run/run.handler.d.ts +169 -172
  203. package/dist/run/run.handler.d.ts.map +1 -1
  204. package/dist/run/run.handler.js +246 -74
  205. package/dist/run/run.operation.d.ts +658 -664
  206. package/dist/run/run.operation.d.ts.map +1 -1
  207. package/dist/run/run.operation.js +659 -617
  208. package/dist/run/run.presentation.d.ts +2 -7
  209. package/dist/run/run.presentation.d.ts.map +1 -1
  210. package/dist/run/run.presentation.js +217 -61
  211. package/dist/run/run.schema.d.ts +367 -372
  212. package/dist/run/run.schema.d.ts.map +1 -1
  213. package/dist/run/run.schema.js +172 -330
  214. package/dist/run/run.test-spec.d.ts +2 -7
  215. package/dist/run/run.test-spec.d.ts.map +1 -1
  216. package/dist/run/run.test-spec.js +56 -62
  217. package/dist/seeders/index.d.ts +4 -8
  218. package/dist/seeders/index.d.ts.map +1 -1
  219. package/dist/seeders/index.js +19 -17
  220. package/dist/shared/index.d.ts +7 -4
  221. package/dist/shared/index.d.ts.map +1 -0
  222. package/dist/shared/index.js +334 -4
  223. package/dist/shared/mock-agents.d.ts +77 -80
  224. package/dist/shared/mock-agents.d.ts.map +1 -1
  225. package/dist/shared/mock-agents.js +82 -93
  226. package/dist/shared/mock-runs.d.ts +107 -110
  227. package/dist/shared/mock-runs.d.ts.map +1 -1
  228. package/dist/shared/mock-runs.js +108 -117
  229. package/dist/shared/mock-tools.d.ts +217 -220
  230. package/dist/shared/mock-tools.d.ts.map +1 -1
  231. package/dist/shared/mock-tools.js +146 -180
  232. package/dist/shared/overlay-types.d.ts +25 -28
  233. package/dist/shared/overlay-types.d.ts.map +1 -1
  234. package/dist/shared/overlay-types.js +1 -0
  235. package/dist/tool/index.d.ts +11 -8
  236. package/dist/tool/index.d.ts.map +1 -0
  237. package/dist/tool/index.js +947 -9
  238. package/dist/tool/tool.entity.d.ts +23 -28
  239. package/dist/tool/tool.entity.d.ts.map +1 -1
  240. package/dist/tool/tool.entity.js +87 -101
  241. package/dist/tool/tool.enum.d.ts +3 -8
  242. package/dist/tool/tool.enum.d.ts.map +1 -1
  243. package/dist/tool/tool.enum.js +23 -31
  244. package/dist/tool/tool.event.d.ts +84 -90
  245. package/dist/tool/tool.event.d.ts.map +1 -1
  246. package/dist/tool/tool.event.js +92 -151
  247. package/dist/tool/tool.handler.d.ts +266 -269
  248. package/dist/tool/tool.handler.d.ts.map +1 -1
  249. package/dist/tool/tool.handler.js +213 -76
  250. package/dist/tool/tool.operation.d.ts +359 -365
  251. package/dist/tool/tool.operation.d.ts.map +1 -1
  252. package/dist/tool/tool.operation.js +477 -400
  253. package/dist/tool/tool.presentation.d.ts +2 -7
  254. package/dist/tool/tool.presentation.d.ts.map +1 -1
  255. package/dist/tool/tool.presentation.js +182 -61
  256. package/dist/tool/tool.schema.d.ts +196 -201
  257. package/dist/tool/tool.schema.d.ts.map +1 -1
  258. package/dist/tool/tool.schema.js +137 -231
  259. package/dist/tool/tool.test-spec.d.ts +2 -7
  260. package/dist/tool/tool.test-spec.d.ts.map +1 -1
  261. package/dist/tool/tool.test-spec.js +56 -62
  262. package/dist/ui/AgentDashboard.d.ts +1 -6
  263. package/dist/ui/AgentDashboard.d.ts.map +1 -1
  264. package/dist/ui/AgentDashboard.js +1598 -410
  265. package/dist/ui/AgentRunList.d.ts +7 -2
  266. package/dist/ui/AgentRunList.d.ts.map +1 -0
  267. package/dist/ui/AgentRunList.js +249 -3
  268. package/dist/ui/AgentToolRegistry.d.ts +7 -2
  269. package/dist/ui/AgentToolRegistry.d.ts.map +1 -0
  270. package/dist/ui/AgentToolRegistry.js +211 -3
  271. package/dist/ui/hooks/index.d.ts +8 -6
  272. package/dist/ui/hooks/index.d.ts.map +1 -0
  273. package/dist/ui/hooks/index.js +270 -6
  274. package/dist/ui/hooks/useAgentList.d.ts +21 -25
  275. package/dist/ui/hooks/useAgentList.d.ts.map +1 -1
  276. package/dist/ui/hooks/useAgentList.js +52 -62
  277. package/dist/ui/hooks/useAgentMutations.d.ts +22 -25
  278. package/dist/ui/hooks/useAgentMutations.d.ts.map +1 -1
  279. package/dist/ui/hooks/useAgentMutations.js +73 -120
  280. package/dist/ui/hooks/useRunList.d.ts +17 -21
  281. package/dist/ui/hooks/useRunList.d.ts.map +1 -1
  282. package/dist/ui/hooks/useRunList.js +52 -62
  283. package/dist/ui/hooks/useToolList.d.ts +32 -36
  284. package/dist/ui/hooks/useToolList.d.ts.map +1 -1
  285. package/dist/ui/hooks/useToolList.js +82 -92
  286. package/dist/ui/index.d.ts +9 -24
  287. package/dist/ui/index.d.ts.map +1 -0
  288. package/dist/ui/index.js +2081 -24
  289. package/dist/ui/modals/AgentActionsModal.d.ts +11 -24
  290. package/dist/ui/modals/AgentActionsModal.d.ts.map +1 -1
  291. package/dist/ui/modals/AgentActionsModal.js +300 -257
  292. package/dist/ui/modals/CreateAgentModal.d.ts +12 -21
  293. package/dist/ui/modals/CreateAgentModal.d.ts.map +1 -1
  294. package/dist/ui/modals/CreateAgentModal.js +226 -210
  295. package/dist/ui/modals/index.d.ts +3 -3
  296. package/dist/ui/modals/index.d.ts.map +1 -0
  297. package/dist/ui/modals/index.js +532 -3
  298. package/dist/ui/overlays/demo-overlays.d.ts +10 -8
  299. package/dist/ui/overlays/demo-overlays.d.ts.map +1 -1
  300. package/dist/ui/overlays/demo-overlays.js +63 -71
  301. package/dist/ui/overlays/index.d.ts +2 -2
  302. package/dist/ui/overlays/index.d.ts.map +1 -0
  303. package/dist/ui/overlays/index.js +65 -3
  304. package/dist/ui/renderers/agent-list.markdown.d.ts +9 -8
  305. package/dist/ui/renderers/agent-list.markdown.d.ts.map +1 -1
  306. package/dist/ui/renderers/agent-list.markdown.js +55 -50
  307. package/dist/ui/renderers/agent-list.renderer.d.ts +5 -6
  308. package/dist/ui/renderers/agent-list.renderer.d.ts.map +1 -1
  309. package/dist/ui/renderers/agent-list.renderer.js +179 -17
  310. package/dist/ui/renderers/dashboard.markdown.d.ts +9 -8
  311. package/dist/ui/renderers/dashboard.markdown.d.ts.map +1 -1
  312. package/dist/ui/renderers/dashboard.markdown.js +115 -97
  313. package/dist/ui/renderers/index.d.ts +9 -6
  314. package/dist/ui/renderers/index.d.ts.map +1 -0
  315. package/dist/ui/renderers/index.js +446 -6
  316. package/dist/ui/renderers/run-list.markdown.d.ts +9 -8
  317. package/dist/ui/renderers/run-list.markdown.d.ts.map +1 -1
  318. package/dist/ui/renderers/run-list.markdown.js +42 -40
  319. package/dist/ui/renderers/tool-registry.markdown.d.ts +9 -8
  320. package/dist/ui/renderers/tool-registry.markdown.d.ts.map +1 -1
  321. package/dist/ui/renderers/tool-registry.markdown.js +52 -53
  322. package/dist/ui/views/AgentListView.d.ts +1 -6
  323. package/dist/ui/views/AgentListView.d.ts.map +1 -1
  324. package/dist/ui/views/AgentListView.js +161 -88
  325. package/dist/ui/views/RunListView.d.ts +4 -11
  326. package/dist/ui/views/RunListView.d.ts.map +1 -1
  327. package/dist/ui/views/RunListView.js +237 -154
  328. package/dist/ui/views/ToolRegistryView.d.ts +4 -11
  329. package/dist/ui/views/ToolRegistryView.d.ts.map +1 -1
  330. package/dist/ui/views/ToolRegistryView.js +205 -92
  331. package/dist/ui/views/index.d.ts +7 -4
  332. package/dist/ui/views/index.d.ts.map +1 -0
  333. package/dist/ui/views/index.js +619 -4
  334. package/package.json +656 -118
  335. package/tsdown.config.js +1 -2
  336. package/.turbo/turbo-build$colon$bundle.log +0 -285
  337. package/dist/agent/agent.entity.js.map +0 -1
  338. package/dist/agent/agent.enum.js.map +0 -1
  339. package/dist/agent/agent.event.js.map +0 -1
  340. package/dist/agent/agent.handler.js.map +0 -1
  341. package/dist/agent/agent.operation.js.map +0 -1
  342. package/dist/agent/agent.presentation.js.map +0 -1
  343. package/dist/agent/agent.schema.js.map +0 -1
  344. package/dist/agent/agent.test-spec.js.map +0 -1
  345. package/dist/agent.capability.js.map +0 -1
  346. package/dist/agent.feature.js.map +0 -1
  347. package/dist/docs/agent-console.docblock.js.map +0 -1
  348. package/dist/example.js.map +0 -1
  349. package/dist/handlers/agent.handlers.js.map +0 -1
  350. package/dist/run/run.entity.js.map +0 -1
  351. package/dist/run/run.enum.js.map +0 -1
  352. package/dist/run/run.event.js.map +0 -1
  353. package/dist/run/run.handler.js.map +0 -1
  354. package/dist/run/run.operation.js.map +0 -1
  355. package/dist/run/run.presentation.js.map +0 -1
  356. package/dist/run/run.schema.js.map +0 -1
  357. package/dist/run/run.test-spec.js.map +0 -1
  358. package/dist/seeders/index.js.map +0 -1
  359. package/dist/shared/mock-agents.js.map +0 -1
  360. package/dist/shared/mock-runs.js.map +0 -1
  361. package/dist/shared/mock-tools.js.map +0 -1
  362. package/dist/tool/tool.entity.js.map +0 -1
  363. package/dist/tool/tool.enum.js.map +0 -1
  364. package/dist/tool/tool.event.js.map +0 -1
  365. package/dist/tool/tool.handler.js.map +0 -1
  366. package/dist/tool/tool.operation.js.map +0 -1
  367. package/dist/tool/tool.presentation.js.map +0 -1
  368. package/dist/tool/tool.schema.js.map +0 -1
  369. package/dist/tool/tool.test-spec.js.map +0 -1
  370. package/dist/ui/AgentDashboard.js.map +0 -1
  371. package/dist/ui/hooks/useAgentList.js.map +0 -1
  372. package/dist/ui/hooks/useAgentMutations.js.map +0 -1
  373. package/dist/ui/hooks/useRunList.js.map +0 -1
  374. package/dist/ui/hooks/useToolList.js.map +0 -1
  375. package/dist/ui/modals/AgentActionsModal.js.map +0 -1
  376. package/dist/ui/modals/CreateAgentModal.js.map +0 -1
  377. package/dist/ui/overlays/demo-overlays.js.map +0 -1
  378. package/dist/ui/renderers/agent-list.markdown.js.map +0 -1
  379. package/dist/ui/renderers/agent-list.renderer.js.map +0 -1
  380. package/dist/ui/renderers/dashboard.markdown.js.map +0 -1
  381. package/dist/ui/renderers/run-list.markdown.js.map +0 -1
  382. package/dist/ui/renderers/tool-registry.markdown.js.map +0 -1
  383. package/dist/ui/views/AgentListView.js.map +0 -1
  384. package/dist/ui/views/RunListView.js.map +0 -1
  385. package/dist/ui/views/ToolRegistryView.js.map +0 -1
  386. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,735 @@
1
+ // src/agent/agent.enum.ts
2
+ import { defineEnum } from "@contractspec/lib.schema";
3
+ var AgentStatusEnum = defineEnum("AgentStatus", [
4
+ "DRAFT",
5
+ "ACTIVE",
6
+ "PAUSED",
7
+ "ARCHIVED"
8
+ ]);
9
+ var ModelProviderEnum = defineEnum("ModelProvider", [
10
+ "OPENAI",
11
+ "ANTHROPIC",
12
+ "GOOGLE",
13
+ "MISTRAL",
14
+ "CUSTOM"
15
+ ]);
16
+ var ToolChoiceEnum = defineEnum("ToolChoice", [
17
+ "auto",
18
+ "required",
19
+ "none"
20
+ ]);
21
+
22
+ // src/agent/agent.event.ts
23
+ import { defineEvent, defineSchemaModel } from "@contractspec/lib.contracts";
24
+ import { ScalarTypeEnum } from "@contractspec/lib.schema";
25
+ var OWNERS = ["@agent-console-team"];
26
+ var AgentCreatedPayload = defineSchemaModel({
27
+ name: "AgentCreatedPayload",
28
+ description: "Payload for agent created event",
29
+ fields: {
30
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
31
+ organizationId: {
32
+ type: ScalarTypeEnum.String_unsecure(),
33
+ isOptional: false
34
+ },
35
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
36
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
+ modelProvider: {
38
+ type: ScalarTypeEnum.String_unsecure(),
39
+ isOptional: false
40
+ },
41
+ modelName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
42
+ toolCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
43
+ createdById: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
44
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
45
+ }
46
+ });
47
+ var AgentCreatedEvent = defineEvent({
48
+ meta: {
49
+ key: "agent-console.agent.created",
50
+ version: "1.0.0",
51
+ description: "A new AI agent was configured.",
52
+ stability: "stable",
53
+ owners: [...OWNERS],
54
+ tags: ["agent", "created"]
55
+ },
56
+ payload: AgentCreatedPayload
57
+ });
58
+ var AgentUpdatedPayload = defineSchemaModel({
59
+ name: "AgentUpdatedPayload",
60
+ description: "Payload for agent updated event",
61
+ fields: {
62
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
63
+ organizationId: {
64
+ type: ScalarTypeEnum.String_unsecure(),
65
+ isOptional: false
66
+ },
67
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
68
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
69
+ updatedFields: {
70
+ type: ScalarTypeEnum.String_unsecure(),
71
+ isArray: true,
72
+ isOptional: false
73
+ },
74
+ updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
75
+ }
76
+ });
77
+ var AgentUpdatedEvent = defineEvent({
78
+ meta: {
79
+ key: "agent-console.agent.updated",
80
+ version: "1.0.0",
81
+ description: "An AI agent configuration was updated.",
82
+ stability: "stable",
83
+ owners: [...OWNERS],
84
+ tags: ["agent", "updated"]
85
+ },
86
+ payload: AgentUpdatedPayload
87
+ });
88
+ var AgentToolAssignedPayload = defineSchemaModel({
89
+ name: "AgentToolAssignedPayload",
90
+ description: "Payload for agent tool assigned event",
91
+ fields: {
92
+ agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
93
+ toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
94
+ agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
95
+ toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
96
+ assignedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
97
+ }
98
+ });
99
+ var AgentToolAssignedEvent = defineEvent({
100
+ meta: {
101
+ key: "agent-console.agent.toolAssigned",
102
+ version: "1.0.0",
103
+ description: "A tool was assigned to an agent.",
104
+ stability: "stable",
105
+ owners: [...OWNERS],
106
+ tags: ["agent", "tool", "assigned"]
107
+ },
108
+ payload: AgentToolAssignedPayload
109
+ });
110
+ var AgentToolRemovedPayload = defineSchemaModel({
111
+ name: "AgentToolRemovedPayload",
112
+ description: "Payload for agent tool removed event",
113
+ fields: {
114
+ agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
115
+ toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
116
+ agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
117
+ toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
118
+ removedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
119
+ }
120
+ });
121
+ var AgentToolRemovedEvent = defineEvent({
122
+ meta: {
123
+ key: "agent-console.agent.toolRemoved",
124
+ version: "1.0.0",
125
+ description: "A tool was removed from an agent.",
126
+ stability: "stable",
127
+ owners: [...OWNERS],
128
+ tags: ["agent", "tool", "removed"]
129
+ },
130
+ payload: AgentToolRemovedPayload
131
+ });
132
+
133
+ // src/agent/agent.schema.ts
134
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
135
+ var AgentModel = defineSchemaModel2({
136
+ name: "Agent",
137
+ description: "AI agent configuration",
138
+ fields: {
139
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
140
+ organizationId: {
141
+ type: ScalarTypeEnum2.String_unsecure(),
142
+ isOptional: false
143
+ },
144
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
145
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
146
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
147
+ status: { type: AgentStatusEnum, isOptional: false },
148
+ modelProvider: { type: ModelProviderEnum, isOptional: false },
149
+ modelName: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
150
+ modelConfig: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
151
+ systemPrompt: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
152
+ userPromptTemplate: {
153
+ type: ScalarTypeEnum2.String_unsecure(),
154
+ isOptional: true
155
+ },
156
+ toolIds: {
157
+ type: ScalarTypeEnum2.String_unsecure(),
158
+ isArray: true,
159
+ isOptional: true
160
+ },
161
+ toolChoice: {
162
+ type: ToolChoiceEnum,
163
+ isOptional: false,
164
+ defaultValue: "auto"
165
+ },
166
+ maxIterations: {
167
+ type: ScalarTypeEnum2.Int_unsecure(),
168
+ isOptional: false,
169
+ defaultValue: 10
170
+ },
171
+ maxTokensPerRun: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
172
+ timeoutMs: {
173
+ type: ScalarTypeEnum2.Int_unsecure(),
174
+ isOptional: false,
175
+ defaultValue: 120000
176
+ },
177
+ version: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
178
+ tags: {
179
+ type: ScalarTypeEnum2.String_unsecure(),
180
+ isArray: true,
181
+ isOptional: true
182
+ },
183
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
184
+ updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
185
+ }
186
+ });
187
+ var AgentSummaryModel = defineSchemaModel2({
188
+ name: "AgentSummary",
189
+ description: "Summary of an agent for list views",
190
+ fields: {
191
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
192
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
193
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
194
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
195
+ status: { type: AgentStatusEnum, isOptional: false },
196
+ modelProvider: { type: ModelProviderEnum, isOptional: false },
197
+ modelName: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
198
+ version: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
199
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
200
+ }
201
+ });
202
+ var AgentToolRefModel = defineSchemaModel2({
203
+ name: "AgentToolRef",
204
+ description: "Tool reference in agent context",
205
+ fields: {
206
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
207
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
208
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
209
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
210
+ category: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
211
+ }
212
+ });
213
+ var AgentWithToolsModel = defineSchemaModel2({
214
+ name: "AgentWithTools",
215
+ description: "Agent with associated tools",
216
+ fields: {
217
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
218
+ organizationId: {
219
+ type: ScalarTypeEnum2.String_unsecure(),
220
+ isOptional: false
221
+ },
222
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
223
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
224
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
225
+ status: { type: AgentStatusEnum, isOptional: false },
226
+ modelProvider: { type: ModelProviderEnum, isOptional: false },
227
+ modelName: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
228
+ modelConfig: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
229
+ systemPrompt: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
230
+ userPromptTemplate: {
231
+ type: ScalarTypeEnum2.String_unsecure(),
232
+ isOptional: true
233
+ },
234
+ toolIds: {
235
+ type: ScalarTypeEnum2.String_unsecure(),
236
+ isArray: true,
237
+ isOptional: true
238
+ },
239
+ toolChoice: { type: ToolChoiceEnum, isOptional: false },
240
+ maxIterations: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
241
+ maxTokensPerRun: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
242
+ timeoutMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
243
+ version: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
244
+ tags: {
245
+ type: ScalarTypeEnum2.String_unsecure(),
246
+ isArray: true,
247
+ isOptional: true
248
+ },
249
+ createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
250
+ updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
251
+ tools: { type: AgentToolRefModel, isArray: true, isOptional: true }
252
+ }
253
+ });
254
+ var CreateAgentInputModel = defineSchemaModel2({
255
+ name: "CreateAgentInput",
256
+ description: "Input for creating an agent",
257
+ fields: {
258
+ organizationId: {
259
+ type: ScalarTypeEnum2.String_unsecure(),
260
+ isOptional: false
261
+ },
262
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
263
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
264
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
265
+ modelProvider: { type: ModelProviderEnum, isOptional: false },
266
+ modelName: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
267
+ modelConfig: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
268
+ systemPrompt: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
269
+ userPromptTemplate: {
270
+ type: ScalarTypeEnum2.String_unsecure(),
271
+ isOptional: true
272
+ },
273
+ toolIds: {
274
+ type: ScalarTypeEnum2.String_unsecure(),
275
+ isArray: true,
276
+ isOptional: true
277
+ },
278
+ toolChoice: { type: ToolChoiceEnum, isOptional: true },
279
+ maxIterations: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
280
+ maxTokensPerRun: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
281
+ timeoutMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
282
+ tags: {
283
+ type: ScalarTypeEnum2.String_unsecure(),
284
+ isArray: true,
285
+ isOptional: true
286
+ }
287
+ }
288
+ });
289
+ var UpdateAgentInputModel = defineSchemaModel2({
290
+ name: "UpdateAgentInput",
291
+ description: "Input for updating an agent",
292
+ fields: {
293
+ agentId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
294
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: true },
295
+ description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
296
+ status: { type: AgentStatusEnum, isOptional: true },
297
+ modelConfig: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
298
+ systemPrompt: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
299
+ userPromptTemplate: {
300
+ type: ScalarTypeEnum2.String_unsecure(),
301
+ isOptional: true
302
+ },
303
+ toolIds: {
304
+ type: ScalarTypeEnum2.String_unsecure(),
305
+ isArray: true,
306
+ isOptional: true
307
+ },
308
+ toolChoice: { type: ToolChoiceEnum, isOptional: true },
309
+ maxIterations: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
310
+ maxTokensPerRun: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
311
+ timeoutMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
312
+ tags: {
313
+ type: ScalarTypeEnum2.String_unsecure(),
314
+ isArray: true,
315
+ isOptional: true
316
+ }
317
+ }
318
+ });
319
+
320
+ // src/agent/agent.operation.ts
321
+ import {
322
+ defineCommand,
323
+ defineQuery
324
+ } from "@contractspec/lib.contracts/operations";
325
+ import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
326
+ var OWNERS2 = ["@agent-console-team"];
327
+ var CreateAgentCommand = defineCommand({
328
+ meta: {
329
+ key: "agent-console.agent.create",
330
+ version: "1.0.0",
331
+ stability: "stable",
332
+ owners: [...OWNERS2],
333
+ tags: ["agent", "create"],
334
+ description: "Creates a new AI agent configuration.",
335
+ goal: "Allow users to define new AI agents with specific models and tools.",
336
+ context: "Called from the agent builder UI when creating a new agent."
337
+ },
338
+ io: {
339
+ input: CreateAgentInputModel,
340
+ output: defineSchemaModel3({
341
+ name: "CreateAgentOutput",
342
+ fields: {
343
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
344
+ name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
345
+ slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
346
+ status: { type: AgentStatusEnum, isOptional: false }
347
+ }
348
+ }),
349
+ errors: {
350
+ SLUG_EXISTS: {
351
+ description: "An agent with this slug already exists in the organization",
352
+ http: 409,
353
+ gqlCode: "SLUG_EXISTS",
354
+ when: "Slug is already taken"
355
+ }
356
+ }
357
+ },
358
+ policy: { auth: "user" },
359
+ sideEffects: {
360
+ emits: [
361
+ {
362
+ ref: AgentCreatedEvent.meta,
363
+ when: "Agent is successfully created"
364
+ }
365
+ ],
366
+ audit: ["agent-console.agent.created"]
367
+ },
368
+ acceptance: {
369
+ scenarios: [
370
+ {
371
+ key: "create-agent-happy-path",
372
+ given: ["User is authenticated", "Organization exists"],
373
+ when: ["User submits valid agent configuration"],
374
+ then: [
375
+ "New agent is created with DRAFT status",
376
+ "AgentCreated event is emitted"
377
+ ]
378
+ },
379
+ {
380
+ key: "create-agent-slug-conflict",
381
+ given: ["User is authenticated", "Agent with same slug exists"],
382
+ when: ["User submits agent with duplicate slug"],
383
+ then: ["SLUG_EXISTS error is returned with 409 status"]
384
+ }
385
+ ],
386
+ examples: [
387
+ {
388
+ key: "basic-create",
389
+ input: {
390
+ name: "Support Assistant",
391
+ slug: "support-assistant",
392
+ modelProvider: "openai",
393
+ modelId: "gpt-4"
394
+ },
395
+ output: {
396
+ id: "agent-123",
397
+ name: "Support Assistant",
398
+ slug: "support-assistant",
399
+ status: "draft"
400
+ }
401
+ }
402
+ ]
403
+ }
404
+ });
405
+ var UpdateAgentCommand = defineCommand({
406
+ meta: {
407
+ key: "agent-console.agent.update",
408
+ version: "1.0.0",
409
+ stability: "stable",
410
+ owners: [...OWNERS2],
411
+ tags: ["agent", "update"],
412
+ description: "Updates an existing AI agent configuration.",
413
+ goal: "Allow users to modify agent settings and configuration.",
414
+ context: "Called from the agent settings UI."
415
+ },
416
+ io: {
417
+ input: UpdateAgentInputModel,
418
+ output: defineSchemaModel3({
419
+ name: "UpdateAgentOutput",
420
+ fields: {
421
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
422
+ name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
423
+ status: { type: AgentStatusEnum, isOptional: false },
424
+ updatedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
425
+ }
426
+ }),
427
+ errors: {
428
+ AGENT_NOT_FOUND: {
429
+ description: "The specified agent does not exist",
430
+ http: 404,
431
+ gqlCode: "AGENT_NOT_FOUND",
432
+ when: "Agent ID is invalid"
433
+ }
434
+ }
435
+ },
436
+ policy: { auth: "user" },
437
+ sideEffects: {
438
+ emits: [
439
+ {
440
+ key: "agent.updated",
441
+ version: "1.0.0",
442
+ stability: "stable",
443
+ owners: [...OWNERS2],
444
+ tags: ["agent", "updated"],
445
+ when: "Agent is updated",
446
+ payload: AgentSummaryModel
447
+ }
448
+ ],
449
+ audit: ["agent.updated"]
450
+ },
451
+ acceptance: {
452
+ scenarios: [
453
+ {
454
+ key: "update-agent-happy-path",
455
+ given: ["Agent exists", "User owns the agent"],
456
+ when: ["User submits updated configuration"],
457
+ then: ["Agent is updated", "AgentUpdated event is emitted"]
458
+ },
459
+ {
460
+ key: "update-agent-not-found",
461
+ given: ["Agent does not exist"],
462
+ when: ["User attempts to update"],
463
+ then: ["AGENT_NOT_FOUND error is returned"]
464
+ }
465
+ ],
466
+ examples: [
467
+ {
468
+ key: "update-name",
469
+ input: {
470
+ agentId: "agent-123",
471
+ name: "Updated Assistant",
472
+ systemPrompt: "You are a helpful assistant."
473
+ },
474
+ output: {
475
+ id: "agent-123",
476
+ name: "Updated Assistant",
477
+ status: "draft",
478
+ updatedAt: "2025-01-01T00:00:00Z"
479
+ }
480
+ }
481
+ ]
482
+ }
483
+ });
484
+ var GetAgentQuery = defineQuery({
485
+ meta: {
486
+ key: "agent-console.agent.get",
487
+ version: "1.0.0",
488
+ stability: "stable",
489
+ owners: [...OWNERS2],
490
+ tags: ["agent", "get"],
491
+ description: "Retrieves an agent by its ID.",
492
+ goal: "View detailed agent configuration.",
493
+ context: "Called when viewing agent details or editing."
494
+ },
495
+ io: {
496
+ input: defineSchemaModel3({
497
+ name: "GetAgentInput",
498
+ fields: {
499
+ agentId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
500
+ includeTools: { type: ScalarTypeEnum3.Boolean(), isOptional: true }
501
+ }
502
+ }),
503
+ output: AgentWithToolsModel,
504
+ errors: {
505
+ AGENT_NOT_FOUND: {
506
+ description: "The specified agent does not exist",
507
+ http: 404,
508
+ gqlCode: "AGENT_NOT_FOUND",
509
+ when: "Agent ID is invalid"
510
+ }
511
+ }
512
+ },
513
+ policy: { auth: "user" },
514
+ acceptance: {
515
+ scenarios: [
516
+ {
517
+ key: "get-agent-happy-path",
518
+ given: ["Agent exists"],
519
+ when: ["User requests agent by ID"],
520
+ then: ["Agent details are returned"]
521
+ },
522
+ {
523
+ key: "get-agent-with-tools",
524
+ given: ["Agent exists with assigned tools"],
525
+ when: ["User requests agent with includeTools=true"],
526
+ then: ["Agent details with tools list are returned"]
527
+ }
528
+ ],
529
+ examples: [
530
+ {
531
+ key: "get-basic",
532
+ input: { agentId: "agent-123", includeTools: false },
533
+ output: {
534
+ id: "agent-123",
535
+ name: "Support Assistant",
536
+ status: "active",
537
+ tools: []
538
+ }
539
+ }
540
+ ]
541
+ }
542
+ });
543
+ var ListAgentsQuery = defineQuery({
544
+ meta: {
545
+ key: "agent-console.agent.list",
546
+ version: "1.0.0",
547
+ stability: "stable",
548
+ owners: [...OWNERS2],
549
+ tags: ["agent", "list"],
550
+ description: "Lists agents for an organization with optional filtering.",
551
+ goal: "Browse and search available agents.",
552
+ context: "Agent list/dashboard view."
553
+ },
554
+ io: {
555
+ input: defineSchemaModel3({
556
+ name: "ListAgentsInput",
557
+ fields: {
558
+ organizationId: {
559
+ type: ScalarTypeEnum3.String_unsecure(),
560
+ isOptional: false
561
+ },
562
+ status: { type: AgentStatusEnum, isOptional: true },
563
+ modelProvider: { type: ModelProviderEnum, isOptional: true },
564
+ search: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
565
+ limit: {
566
+ type: ScalarTypeEnum3.Int_unsecure(),
567
+ isOptional: true,
568
+ defaultValue: 20
569
+ },
570
+ offset: {
571
+ type: ScalarTypeEnum3.Int_unsecure(),
572
+ isOptional: true,
573
+ defaultValue: 0
574
+ }
575
+ }
576
+ }),
577
+ output: defineSchemaModel3({
578
+ name: "ListAgentsOutput",
579
+ fields: {
580
+ items: { type: AgentSummaryModel, isArray: true, isOptional: false },
581
+ total: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: false },
582
+ hasMore: { type: ScalarTypeEnum3.Boolean(), isOptional: false }
583
+ }
584
+ })
585
+ },
586
+ policy: { auth: "user" },
587
+ acceptance: {
588
+ scenarios: [
589
+ {
590
+ key: "list-agents-happy-path",
591
+ given: ["Organization has agents"],
592
+ when: ["User lists agents"],
593
+ then: ["Paginated list of agents is returned"]
594
+ },
595
+ {
596
+ key: "list-agents-filter-by-status",
597
+ given: ["Organization has agents with mixed statuses"],
598
+ when: ["User filters by status=active"],
599
+ then: ["Only active agents are returned"]
600
+ }
601
+ ],
602
+ examples: [
603
+ {
604
+ key: "list-basic",
605
+ input: { organizationId: "org-123", limit: 10, offset: 0 },
606
+ output: { items: [], total: 0, hasMore: false }
607
+ }
608
+ ]
609
+ }
610
+ });
611
+ var AssignToolToAgentCommand = defineCommand({
612
+ meta: {
613
+ key: "agent-console.agent.assignTool",
614
+ version: "1.0.0",
615
+ stability: "stable",
616
+ owners: [...OWNERS2],
617
+ tags: ["agent", "tool", "assign"],
618
+ description: "Assigns a tool to an agent with optional configuration.",
619
+ goal: "Enable agents to use specific tools.",
620
+ context: "Agent configuration UI - tool selection."
621
+ },
622
+ io: {
623
+ input: defineSchemaModel3({
624
+ name: "AssignToolToAgentInput",
625
+ fields: {
626
+ agentId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
627
+ toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
628
+ config: { type: ScalarTypeEnum3.JSONObject(), isOptional: true },
629
+ order: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: true }
630
+ }
631
+ }),
632
+ output: defineSchemaModel3({
633
+ name: "AssignToolToAgentOutput",
634
+ fields: {
635
+ agentToolId: {
636
+ type: ScalarTypeEnum3.String_unsecure(),
637
+ isOptional: false
638
+ },
639
+ agentId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
640
+ toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
641
+ }
642
+ }),
643
+ errors: {
644
+ TOOL_ALREADY_ASSIGNED: {
645
+ description: "This tool is already assigned to the agent",
646
+ http: 409,
647
+ gqlCode: "TOOL_ALREADY_ASSIGNED",
648
+ when: "Tool assignment already exists"
649
+ }
650
+ }
651
+ },
652
+ policy: { auth: "user" },
653
+ sideEffects: { audit: ["agent.tool.assigned"] },
654
+ acceptance: {
655
+ scenarios: [
656
+ {
657
+ key: "assign-tool-happy-path",
658
+ given: ["Agent exists", "Tool exists and is not assigned"],
659
+ when: ["User assigns tool to agent"],
660
+ then: ["Tool is assigned", "Assignment ID is returned"]
661
+ },
662
+ {
663
+ key: "assign-tool-already-assigned",
664
+ given: ["Tool is already assigned to agent"],
665
+ when: ["User attempts to assign again"],
666
+ then: ["TOOL_ALREADY_ASSIGNED error is returned"]
667
+ }
668
+ ],
669
+ examples: [
670
+ {
671
+ key: "assign-basic",
672
+ input: { agentId: "agent-123", toolId: "tool-456" },
673
+ output: {
674
+ agentToolId: "at-789",
675
+ agentId: "agent-123",
676
+ toolId: "tool-456"
677
+ }
678
+ }
679
+ ]
680
+ }
681
+ });
682
+ var RemoveToolFromAgentCommand = defineCommand({
683
+ meta: {
684
+ key: "agent-console.agent.removeTool",
685
+ version: "1.0.0",
686
+ stability: "stable",
687
+ owners: [...OWNERS2],
688
+ tags: ["agent", "tool", "remove"],
689
+ description: "Removes a tool assignment from an agent.",
690
+ goal: "Disable specific tools for an agent.",
691
+ context: "Agent configuration UI - tool management."
692
+ },
693
+ io: {
694
+ input: defineSchemaModel3({
695
+ name: "RemoveToolFromAgentInput",
696
+ fields: {
697
+ agentId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
698
+ toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
699
+ }
700
+ }),
701
+ output: defineSchemaModel3({
702
+ name: "RemoveToolFromAgentOutput",
703
+ fields: {
704
+ success: { type: ScalarTypeEnum3.Boolean(), isOptional: false }
705
+ }
706
+ })
707
+ },
708
+ policy: { auth: "user" },
709
+ sideEffects: { audit: ["agent.tool.removed"] },
710
+ acceptance: {
711
+ scenarios: [
712
+ {
713
+ key: "remove-tool-happy-path",
714
+ given: ["Agent exists", "Tool is assigned to agent"],
715
+ when: ["User removes tool from agent"],
716
+ then: ["Tool is unassigned", "Success is returned"]
717
+ }
718
+ ],
719
+ examples: [
720
+ {
721
+ key: "remove-basic",
722
+ input: { agentId: "agent-123", toolId: "tool-456" },
723
+ output: { success: true }
724
+ }
725
+ ]
726
+ }
727
+ });
728
+ export {
729
+ UpdateAgentCommand,
730
+ RemoveToolFromAgentCommand,
731
+ ListAgentsQuery,
732
+ GetAgentQuery,
733
+ CreateAgentCommand,
734
+ AssignToolToAgentCommand
735
+ };