@contractspec/example.agent-console 1.56.1 → 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 +211 -277
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +36 -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 -7
  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 +40 -55
  112. package/dist/handlers/agent.handlers.d.ts +121 -121
  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 -9
  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 -9
  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 -7
  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 -9
  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 -9
  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 -9
  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 +657 -119
  335. package/tsdown.config.js +1 -2
  336. package/.turbo/turbo-build$colon$bundle.log +0 -280
  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,946 @@
1
+ // src/shared/mock-tools.ts
2
+ var MOCK_TOOLS = [
3
+ {
4
+ id: "tool-1",
5
+ organizationId: "demo-org",
6
+ name: "Web Search",
7
+ slug: "web-search",
8
+ description: "Search the web for real-time information using Brave API.",
9
+ category: "RETRIEVAL",
10
+ status: "ACTIVE",
11
+ parametersSchema: {
12
+ type: "object",
13
+ properties: {
14
+ query: { type: "string", description: "Search query" },
15
+ numResults: { type: "number", default: 10 }
16
+ },
17
+ required: ["query"]
18
+ },
19
+ outputSchema: { type: "array", items: { type: "object" } },
20
+ implementationType: "http",
21
+ implementationConfig: {
22
+ url: "https://api.brave.com/search",
23
+ method: "GET"
24
+ },
25
+ maxInvocationsPerMinute: 60,
26
+ timeoutMs: 30000,
27
+ version: "1.0.0",
28
+ tags: ["search", "web"],
29
+ createdAt: new Date("2024-01-01T00:00:00Z"),
30
+ updatedAt: new Date("2024-02-15T10:00:00Z")
31
+ },
32
+ {
33
+ id: "tool-2",
34
+ organizationId: "demo-org",
35
+ name: "SQL Query",
36
+ slug: "sql-query",
37
+ description: "Execute read-only SQL queries against the data warehouse.",
38
+ category: "RETRIEVAL",
39
+ status: "ACTIVE",
40
+ parametersSchema: {
41
+ type: "object",
42
+ properties: {
43
+ query: { type: "string", description: "SQL query" },
44
+ maxRows: { type: "number", default: 100 }
45
+ },
46
+ required: ["query"]
47
+ },
48
+ outputSchema: { type: "object" },
49
+ implementationType: "function",
50
+ implementationConfig: { handler: "executeSqlQuery" },
51
+ maxInvocationsPerMinute: 30,
52
+ timeoutMs: 60000,
53
+ version: "1.1.0",
54
+ tags: ["sql", "database"],
55
+ createdAt: new Date("2024-01-05T00:00:00Z"),
56
+ updatedAt: new Date("2024-03-10T14:00:00Z")
57
+ },
58
+ {
59
+ id: "tool-3",
60
+ organizationId: "demo-org",
61
+ name: "Email Sender",
62
+ slug: "email-sender",
63
+ description: "Send emails via SMTP or API.",
64
+ category: "COMMUNICATION",
65
+ status: "ACTIVE",
66
+ parametersSchema: {
67
+ type: "object",
68
+ properties: {
69
+ to: { type: "string" },
70
+ subject: { type: "string" },
71
+ body: { type: "string" }
72
+ },
73
+ required: ["to", "subject", "body"]
74
+ },
75
+ implementationType: "http",
76
+ implementationConfig: { url: "/api/send-email", method: "POST" },
77
+ maxInvocationsPerMinute: 10,
78
+ timeoutMs: 30000,
79
+ version: "1.0.0",
80
+ tags: ["email", "communication"],
81
+ createdAt: new Date("2024-02-01T00:00:00Z"),
82
+ updatedAt: new Date("2024-02-01T00:00:00Z")
83
+ },
84
+ {
85
+ id: "tool-4",
86
+ organizationId: "demo-org",
87
+ name: "GitHub Integration",
88
+ slug: "github-integration",
89
+ description: "Interact with GitHub repositories, PRs, and issues.",
90
+ category: "INTEGRATION",
91
+ status: "ACTIVE",
92
+ parametersSchema: {
93
+ type: "object",
94
+ properties: {
95
+ action: {
96
+ type: "string",
97
+ enum: ["list_prs", "get_pr", "create_comment"]
98
+ },
99
+ repo: { type: "string" },
100
+ params: { type: "object" }
101
+ },
102
+ required: ["action", "repo"]
103
+ },
104
+ implementationType: "http",
105
+ implementationConfig: { url: "https://api.github.com", auth: "token" },
106
+ maxInvocationsPerMinute: 100,
107
+ timeoutMs: 15000,
108
+ version: "2.0.0",
109
+ tags: ["github", "integration", "code"],
110
+ createdAt: new Date("2024-02-20T00:00:00Z"),
111
+ updatedAt: new Date("2024-04-01T09:00:00Z")
112
+ },
113
+ {
114
+ id: "tool-5",
115
+ organizationId: "demo-org",
116
+ name: "Calculator",
117
+ slug: "calculator",
118
+ description: "Perform mathematical calculations.",
119
+ category: "COMPUTATION",
120
+ status: "ACTIVE",
121
+ parametersSchema: {
122
+ type: "object",
123
+ properties: {
124
+ expression: {
125
+ type: "string",
126
+ description: "Math expression to evaluate"
127
+ }
128
+ },
129
+ required: ["expression"]
130
+ },
131
+ outputSchema: {
132
+ type: "object",
133
+ properties: { result: { type: "number" } }
134
+ },
135
+ implementationType: "function",
136
+ implementationConfig: { handler: "evaluateMath" },
137
+ timeoutMs: 5000,
138
+ version: "1.0.0",
139
+ tags: ["math", "utility"],
140
+ createdAt: new Date("2024-01-10T00:00:00Z"),
141
+ updatedAt: new Date("2024-01-10T00:00:00Z")
142
+ }
143
+ ];
144
+
145
+ // src/tool/tool.handler.ts
146
+ async function mockListToolsHandler(input) {
147
+ const {
148
+ organizationId,
149
+ category,
150
+ status,
151
+ search,
152
+ limit = 20,
153
+ offset = 0
154
+ } = input;
155
+ let filtered = MOCK_TOOLS.filter((t) => t.organizationId === organizationId);
156
+ if (category)
157
+ filtered = filtered.filter((t) => t.category === category);
158
+ if (status)
159
+ filtered = filtered.filter((t) => t.status === status);
160
+ if (search) {
161
+ const q = search.toLowerCase();
162
+ filtered = filtered.filter((t) => t.name.toLowerCase().includes(q) || t.description.toLowerCase().includes(q));
163
+ }
164
+ const total = filtered.length;
165
+ const items = filtered.slice(offset, offset + limit).map((t) => ({
166
+ id: t.id,
167
+ name: t.name,
168
+ slug: t.slug,
169
+ description: t.description,
170
+ category: t.category,
171
+ status: t.status,
172
+ version: t.version,
173
+ createdAt: t.createdAt
174
+ }));
175
+ return { items, total, hasMore: offset + limit < total };
176
+ }
177
+ async function mockGetToolHandler(input) {
178
+ const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
179
+ if (!tool)
180
+ throw new Error("TOOL_NOT_FOUND");
181
+ return tool;
182
+ }
183
+ async function mockCreateToolHandler(input) {
184
+ const exists = MOCK_TOOLS.some((t) => t.organizationId === input.organizationId && t.slug === input.slug);
185
+ if (exists)
186
+ throw new Error("SLUG_EXISTS");
187
+ return {
188
+ id: `tool-${Date.now()}`,
189
+ name: input.name,
190
+ slug: input.slug,
191
+ status: "DRAFT"
192
+ };
193
+ }
194
+ async function mockUpdateToolHandler(input) {
195
+ const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
196
+ if (!tool)
197
+ throw new Error("TOOL_NOT_FOUND");
198
+ return {
199
+ id: tool.id,
200
+ name: input.name ?? tool.name,
201
+ status: input.status ?? tool.status,
202
+ updatedAt: new Date
203
+ };
204
+ }
205
+ async function mockTestToolHandler(input) {
206
+ const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
207
+ if (!tool)
208
+ throw new Error("TOOL_NOT_FOUND");
209
+ const startTime = Date.now();
210
+ await new Promise((resolve) => setTimeout(resolve, 100));
211
+ return {
212
+ success: true,
213
+ output: { result: "Test successful", input: input.testInput },
214
+ durationMs: Date.now() - startTime
215
+ };
216
+ }
217
+
218
+ // src/tool/tool.enum.ts
219
+ import { defineEnum } from "@contractspec/lib.schema";
220
+ var ToolCategoryEnum = defineEnum("ToolCategory", [
221
+ "RETRIEVAL",
222
+ "COMPUTATION",
223
+ "COMMUNICATION",
224
+ "INTEGRATION",
225
+ "UTILITY",
226
+ "CUSTOM"
227
+ ]);
228
+ var ToolStatusEnum = defineEnum("ToolStatus", [
229
+ "DRAFT",
230
+ "ACTIVE",
231
+ "DEPRECATED",
232
+ "DISABLED"
233
+ ]);
234
+ var ImplementationTypeEnum = defineEnum("ImplementationType", [
235
+ "http",
236
+ "function",
237
+ "workflow"
238
+ ]);
239
+
240
+ // src/tool/tool.schema.ts
241
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
242
+ var ToolModel = defineSchemaModel({
243
+ name: "Tool",
244
+ description: "AI tool definition",
245
+ fields: {
246
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
247
+ organizationId: {
248
+ type: ScalarTypeEnum.String_unsecure(),
249
+ isOptional: false
250
+ },
251
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
252
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
253
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
254
+ category: { type: ToolCategoryEnum, isOptional: false },
255
+ status: { type: ToolStatusEnum, isOptional: false },
256
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
257
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
258
+ implementationType: { type: ImplementationTypeEnum, isOptional: false },
259
+ implementationConfig: {
260
+ type: ScalarTypeEnum.JSONObject(),
261
+ isOptional: false
262
+ },
263
+ maxInvocationsPerMinute: {
264
+ type: ScalarTypeEnum.Int_unsecure(),
265
+ isOptional: true
266
+ },
267
+ timeoutMs: {
268
+ type: ScalarTypeEnum.Int_unsecure(),
269
+ isOptional: false,
270
+ defaultValue: 30000
271
+ },
272
+ version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
273
+ tags: {
274
+ type: ScalarTypeEnum.String_unsecure(),
275
+ isArray: true,
276
+ isOptional: true
277
+ },
278
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
279
+ updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
280
+ }
281
+ });
282
+ var ToolSummaryModel = defineSchemaModel({
283
+ name: "ToolSummary",
284
+ description: "Summary of a tool for list views",
285
+ fields: {
286
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
287
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
288
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
289
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
290
+ category: { type: ToolCategoryEnum, isOptional: false },
291
+ status: { type: ToolStatusEnum, isOptional: false },
292
+ version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
293
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
294
+ }
295
+ });
296
+ var CreateToolInputModel = defineSchemaModel({
297
+ name: "CreateToolInput",
298
+ description: "Input for creating a tool",
299
+ fields: {
300
+ organizationId: {
301
+ type: ScalarTypeEnum.String_unsecure(),
302
+ isOptional: false
303
+ },
304
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
305
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
306
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
307
+ category: { type: ToolCategoryEnum, isOptional: true },
308
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
309
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
310
+ implementationType: { type: ImplementationTypeEnum, isOptional: false },
311
+ implementationConfig: {
312
+ type: ScalarTypeEnum.JSONObject(),
313
+ isOptional: false
314
+ },
315
+ maxInvocationsPerMinute: {
316
+ type: ScalarTypeEnum.Int_unsecure(),
317
+ isOptional: true
318
+ },
319
+ timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
320
+ tags: {
321
+ type: ScalarTypeEnum.String_unsecure(),
322
+ isArray: true,
323
+ isOptional: true
324
+ }
325
+ }
326
+ });
327
+ var UpdateToolInputModel = defineSchemaModel({
328
+ name: "UpdateToolInput",
329
+ description: "Input for updating a tool",
330
+ fields: {
331
+ toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
332
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: true },
333
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
334
+ status: { type: ToolStatusEnum, isOptional: true },
335
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
336
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
337
+ implementationConfig: {
338
+ type: ScalarTypeEnum.JSONObject(),
339
+ isOptional: true
340
+ },
341
+ maxInvocationsPerMinute: {
342
+ type: ScalarTypeEnum.Int_unsecure(),
343
+ isOptional: true
344
+ },
345
+ timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
346
+ tags: {
347
+ type: ScalarTypeEnum.String_unsecure(),
348
+ isArray: true,
349
+ isOptional: true
350
+ }
351
+ }
352
+ });
353
+
354
+ // src/tool/tool.operation.ts
355
+ import {
356
+ defineCommand,
357
+ defineQuery
358
+ } from "@contractspec/lib.contracts/operations";
359
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
360
+ var OWNERS = ["@agent-console-team"];
361
+ var CreateToolCommand = defineCommand({
362
+ meta: {
363
+ key: "agent.tool.create",
364
+ version: "1.0.0",
365
+ stability: "stable",
366
+ owners: [...OWNERS],
367
+ tags: ["tool", "create"],
368
+ description: "Creates a new AI tool definition.",
369
+ goal: "Allow users to define new tools that agents can use.",
370
+ context: "Called from the tool builder UI when creating a new tool."
371
+ },
372
+ io: {
373
+ input: CreateToolInputModel,
374
+ output: defineSchemaModel2({
375
+ name: "CreateToolOutput",
376
+ fields: {
377
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
378
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
379
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
380
+ status: { type: ToolStatusEnum, isOptional: false }
381
+ }
382
+ }),
383
+ errors: {
384
+ SLUG_EXISTS: {
385
+ description: "A tool with this slug already exists in the organization",
386
+ http: 409,
387
+ gqlCode: "SLUG_EXISTS",
388
+ when: "Slug is already taken"
389
+ }
390
+ }
391
+ },
392
+ policy: { auth: "user" },
393
+ sideEffects: {
394
+ emits: [
395
+ {
396
+ key: "tool.created",
397
+ version: "1.0.0",
398
+ stability: "stable",
399
+ owners: [...OWNERS],
400
+ tags: ["tool", "created"],
401
+ when: "Tool is successfully created",
402
+ payload: ToolSummaryModel
403
+ }
404
+ ],
405
+ audit: ["tool.created"]
406
+ },
407
+ acceptance: {
408
+ scenarios: [
409
+ {
410
+ key: "create-tool-happy-path",
411
+ given: ["User is authenticated", "Organization exists"],
412
+ when: ["User submits valid tool configuration"],
413
+ then: ["New tool is created", "ToolCreated event is emitted"]
414
+ },
415
+ {
416
+ key: "create-tool-slug-conflict",
417
+ given: ["Tool with same slug exists"],
418
+ when: ["User submits tool with duplicate slug"],
419
+ then: ["SLUG_EXISTS error is returned"]
420
+ }
421
+ ],
422
+ examples: [
423
+ {
424
+ key: "create-api-tool",
425
+ input: {
426
+ name: "Weather API",
427
+ slug: "weather-api",
428
+ category: "api",
429
+ description: "Fetches weather data"
430
+ },
431
+ output: {
432
+ id: "tool-123",
433
+ name: "Weather API",
434
+ slug: "weather-api",
435
+ status: "draft"
436
+ }
437
+ }
438
+ ]
439
+ }
440
+ });
441
+ var UpdateToolCommand = defineCommand({
442
+ meta: {
443
+ key: "agent.tool.update",
444
+ version: "1.0.0",
445
+ stability: "stable",
446
+ owners: [...OWNERS],
447
+ tags: ["tool", "update"],
448
+ description: "Updates an existing AI tool definition.",
449
+ goal: "Allow users to modify tool settings and configuration.",
450
+ context: "Called from the tool settings UI."
451
+ },
452
+ io: {
453
+ input: UpdateToolInputModel,
454
+ output: defineSchemaModel2({
455
+ name: "UpdateToolOutput",
456
+ fields: {
457
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
458
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
459
+ status: { type: ToolStatusEnum, isOptional: false },
460
+ updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
461
+ }
462
+ }),
463
+ errors: {
464
+ TOOL_NOT_FOUND: {
465
+ description: "The specified tool does not exist",
466
+ http: 404,
467
+ gqlCode: "TOOL_NOT_FOUND",
468
+ when: "Tool ID is invalid"
469
+ }
470
+ }
471
+ },
472
+ policy: { auth: "user" },
473
+ sideEffects: {
474
+ emits: [
475
+ {
476
+ key: "tool.updated",
477
+ version: "1.0.0",
478
+ stability: "stable",
479
+ owners: [...OWNERS],
480
+ tags: ["tool", "updated"],
481
+ when: "Tool is updated",
482
+ payload: ToolSummaryModel
483
+ }
484
+ ],
485
+ audit: ["tool.updated"]
486
+ },
487
+ acceptance: {
488
+ scenarios: [
489
+ {
490
+ key: "update-tool-happy-path",
491
+ given: ["Tool exists", "User owns the tool"],
492
+ when: ["User submits updated configuration"],
493
+ then: ["Tool is updated", "ToolUpdated event is emitted"]
494
+ }
495
+ ],
496
+ examples: [
497
+ {
498
+ key: "update-description",
499
+ input: { toolId: "tool-123", description: "Updated weather API tool" },
500
+ output: {
501
+ id: "tool-123",
502
+ name: "Weather API",
503
+ status: "draft",
504
+ updatedAt: "2025-01-01T00:00:00Z"
505
+ }
506
+ }
507
+ ]
508
+ }
509
+ });
510
+ var GetToolQuery = defineQuery({
511
+ meta: {
512
+ key: "agent.tool.get",
513
+ version: "1.0.0",
514
+ stability: "stable",
515
+ owners: [...OWNERS],
516
+ tags: ["tool", "get"],
517
+ description: "Retrieves a tool by its ID.",
518
+ goal: "View detailed tool configuration.",
519
+ context: "Called when viewing tool details or editing."
520
+ },
521
+ io: {
522
+ input: defineSchemaModel2({
523
+ name: "GetToolInput",
524
+ fields: {
525
+ toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
526
+ }
527
+ }),
528
+ output: ToolModel,
529
+ errors: {
530
+ TOOL_NOT_FOUND: {
531
+ description: "The specified tool does not exist",
532
+ http: 404,
533
+ gqlCode: "TOOL_NOT_FOUND",
534
+ when: "Tool ID is invalid"
535
+ }
536
+ }
537
+ },
538
+ policy: { auth: "user" },
539
+ acceptance: {
540
+ scenarios: [
541
+ {
542
+ key: "get-tool-happy-path",
543
+ given: ["Tool exists"],
544
+ when: ["User requests tool by ID"],
545
+ then: ["Tool details are returned"]
546
+ }
547
+ ],
548
+ examples: [
549
+ {
550
+ key: "get-basic",
551
+ input: { toolId: "tool-123" },
552
+ output: {
553
+ id: "tool-123",
554
+ name: "Weather API",
555
+ status: "active",
556
+ category: "api"
557
+ }
558
+ }
559
+ ]
560
+ }
561
+ });
562
+ var ListToolsQuery = defineQuery({
563
+ meta: {
564
+ key: "agent.tool.list",
565
+ version: "1.0.0",
566
+ stability: "stable",
567
+ owners: [...OWNERS],
568
+ tags: ["tool", "list"],
569
+ description: "Lists tools for an organization with optional filtering.",
570
+ goal: "Browse and search available tools.",
571
+ context: "Tool list/dashboard view."
572
+ },
573
+ io: {
574
+ input: defineSchemaModel2({
575
+ name: "ListToolsInput",
576
+ fields: {
577
+ organizationId: {
578
+ type: ScalarTypeEnum2.String_unsecure(),
579
+ isOptional: false
580
+ },
581
+ category: { type: ToolCategoryEnum, isOptional: true },
582
+ status: { type: ToolStatusEnum, isOptional: true },
583
+ search: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
584
+ limit: {
585
+ type: ScalarTypeEnum2.Int_unsecure(),
586
+ isOptional: true,
587
+ defaultValue: 20
588
+ },
589
+ offset: {
590
+ type: ScalarTypeEnum2.Int_unsecure(),
591
+ isOptional: true,
592
+ defaultValue: 0
593
+ }
594
+ }
595
+ }),
596
+ output: defineSchemaModel2({
597
+ name: "ListToolsOutput",
598
+ fields: {
599
+ items: { type: ToolSummaryModel, isArray: true, isOptional: false },
600
+ total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
601
+ hasMore: { type: ScalarTypeEnum2.Boolean(), isOptional: false }
602
+ }
603
+ })
604
+ },
605
+ policy: { auth: "user" },
606
+ acceptance: {
607
+ scenarios: [
608
+ {
609
+ key: "list-tools-happy-path",
610
+ given: ["Organization has tools"],
611
+ when: ["User lists tools"],
612
+ then: ["Paginated list of tools is returned"]
613
+ }
614
+ ],
615
+ examples: [
616
+ {
617
+ key: "list-by-category",
618
+ input: { organizationId: "org-123", category: "api", limit: 10 },
619
+ output: { items: [], total: 0, hasMore: false }
620
+ }
621
+ ]
622
+ }
623
+ });
624
+ var TestToolCommand = defineCommand({
625
+ meta: {
626
+ key: "agent.tool.test",
627
+ version: "1.0.0",
628
+ stability: "stable",
629
+ owners: [...OWNERS],
630
+ tags: ["tool", "test"],
631
+ description: "Tests a tool with sample input to verify it works correctly.",
632
+ goal: "Validate tool configuration before deployment.",
633
+ context: "Tool builder UI - test panel."
634
+ },
635
+ io: {
636
+ input: defineSchemaModel2({
637
+ name: "TestToolInput",
638
+ fields: {
639
+ toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
640
+ testInput: { type: ScalarTypeEnum2.JSONObject(), isOptional: false }
641
+ }
642
+ }),
643
+ output: defineSchemaModel2({
644
+ name: "TestToolOutput",
645
+ fields: {
646
+ success: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
647
+ output: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
648
+ error: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
649
+ durationMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
650
+ }
651
+ }),
652
+ errors: {
653
+ TOOL_NOT_FOUND: {
654
+ description: "The specified tool does not exist",
655
+ http: 404,
656
+ gqlCode: "TOOL_NOT_FOUND",
657
+ when: "Tool ID is invalid"
658
+ },
659
+ TOOL_EXECUTION_ERROR: {
660
+ description: "Tool execution failed",
661
+ http: 500,
662
+ gqlCode: "TOOL_EXECUTION_ERROR",
663
+ when: "Tool returns an error"
664
+ }
665
+ }
666
+ },
667
+ policy: { auth: "user" },
668
+ sideEffects: { audit: ["tool.tested"] },
669
+ acceptance: {
670
+ scenarios: [
671
+ {
672
+ key: "test-tool-success",
673
+ given: ["Tool exists", "Tool is configured correctly"],
674
+ when: ["User runs test with valid input"],
675
+ then: ["Tool executes successfully", "Output is returned"]
676
+ },
677
+ {
678
+ key: "test-tool-failure",
679
+ given: ["Tool exists", "Tool has configuration error"],
680
+ when: ["User runs test"],
681
+ then: ["TOOL_EXECUTION_ERROR is returned"]
682
+ }
683
+ ],
684
+ examples: [
685
+ {
686
+ key: "test-weather-api",
687
+ input: { toolId: "tool-123", testInput: { city: "Paris" } },
688
+ output: { success: true, output: { temperature: 22 }, durationMs: 150 }
689
+ }
690
+ ]
691
+ }
692
+ });
693
+
694
+ // src/tool/tool.event.ts
695
+ import { defineEvent, defineSchemaModel as defineSchemaModel3 } from "@contractspec/lib.contracts";
696
+ import { ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
697
+ var OWNERS2 = ["@agent-console-team"];
698
+ var ToolCreatedPayload = defineSchemaModel3({
699
+ name: "ToolCreatedPayload",
700
+ description: "Payload for tool created event",
701
+ fields: {
702
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
703
+ organizationId: {
704
+ type: ScalarTypeEnum3.String_unsecure(),
705
+ isOptional: false
706
+ },
707
+ name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
708
+ slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
709
+ category: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
710
+ implementationType: {
711
+ type: ScalarTypeEnum3.String_unsecure(),
712
+ isOptional: false
713
+ },
714
+ createdById: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
715
+ createdAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
716
+ }
717
+ });
718
+ var ToolCreatedEvent = defineEvent({
719
+ meta: {
720
+ key: "agent.tool.created",
721
+ version: "1.0.0",
722
+ description: "A new AI tool was created.",
723
+ stability: "stable",
724
+ owners: [...OWNERS2],
725
+ tags: ["tool", "created"]
726
+ },
727
+ payload: ToolCreatedPayload
728
+ });
729
+ var ToolUpdatedPayload = defineSchemaModel3({
730
+ name: "ToolUpdatedPayload",
731
+ description: "Payload for tool updated event",
732
+ fields: {
733
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
734
+ organizationId: {
735
+ type: ScalarTypeEnum3.String_unsecure(),
736
+ isOptional: false
737
+ },
738
+ name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
739
+ status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
740
+ updatedFields: {
741
+ type: ScalarTypeEnum3.String_unsecure(),
742
+ isArray: true,
743
+ isOptional: false
744
+ },
745
+ updatedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
746
+ }
747
+ });
748
+ var ToolUpdatedEvent = defineEvent({
749
+ meta: {
750
+ key: "agent.tool.updated",
751
+ version: "1.0.0",
752
+ description: "An AI tool configuration was updated.",
753
+ stability: "stable",
754
+ owners: [...OWNERS2],
755
+ tags: ["tool", "updated"]
756
+ },
757
+ payload: ToolUpdatedPayload
758
+ });
759
+ var ToolStatusChangedPayload = defineSchemaModel3({
760
+ name: "ToolStatusChangedPayload",
761
+ description: "Payload for tool status changed event",
762
+ fields: {
763
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
764
+ organizationId: {
765
+ type: ScalarTypeEnum3.String_unsecure(),
766
+ isOptional: false
767
+ },
768
+ name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
769
+ previousStatus: {
770
+ type: ScalarTypeEnum3.String_unsecure(),
771
+ isOptional: false
772
+ },
773
+ newStatus: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
774
+ changedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
775
+ }
776
+ });
777
+ var ToolStatusChangedEvent = defineEvent({
778
+ meta: {
779
+ key: "agent.tool.statusChanged",
780
+ version: "1.0.0",
781
+ description: "An AI tool status was changed (activated, deprecated, disabled).",
782
+ stability: "stable",
783
+ owners: [...OWNERS2],
784
+ tags: ["tool", "status"]
785
+ },
786
+ payload: ToolStatusChangedPayload
787
+ });
788
+
789
+ // src/tool/tool.entity.ts
790
+ import {
791
+ defineEntity,
792
+ defineEntityEnum,
793
+ field,
794
+ index
795
+ } from "@contractspec/lib.schema";
796
+ var ToolCategoryEntityEnum = defineEntityEnum({
797
+ name: "ToolCategory",
798
+ values: [
799
+ "RETRIEVAL",
800
+ "COMPUTATION",
801
+ "COMMUNICATION",
802
+ "INTEGRATION",
803
+ "UTILITY",
804
+ "CUSTOM"
805
+ ],
806
+ description: "Category of tool"
807
+ });
808
+ var ToolStatusEntityEnum = defineEntityEnum({
809
+ name: "ToolStatus",
810
+ values: ["DRAFT", "ACTIVE", "DEPRECATED", "DISABLED"],
811
+ description: "Status of tool"
812
+ });
813
+ var ImplementationTypeEntityEnum = defineEntityEnum({
814
+ name: "ImplementationType",
815
+ values: ["http", "function", "workflow"],
816
+ description: "How the tool is implemented"
817
+ });
818
+ var ToolEntity = defineEntity({
819
+ name: "Tool",
820
+ schema: "agent_console",
821
+ description: "An AI tool that can be used by agents.",
822
+ fields: {
823
+ id: field.id(),
824
+ organizationId: field.string({
825
+ description: "Organization that owns this tool"
826
+ }),
827
+ name: field.string({ description: "Tool name" }),
828
+ slug: field.string({ description: "URL-safe identifier" }),
829
+ description: field.string({ description: "Tool description" }),
830
+ category: field.enum("ToolCategory", { default: "CUSTOM" }),
831
+ status: field.enum("ToolStatus", { default: "DRAFT" }),
832
+ parametersSchema: field.json({
833
+ description: "JSON Schema for tool parameters"
834
+ }),
835
+ outputSchema: field.json({
836
+ isOptional: true,
837
+ description: "JSON Schema for tool output"
838
+ }),
839
+ implementationType: field.enum("ImplementationType"),
840
+ implementationConfig: field.json({
841
+ description: "Implementation configuration"
842
+ }),
843
+ maxInvocationsPerMinute: field.int({
844
+ isOptional: true,
845
+ description: "Rate limit"
846
+ }),
847
+ timeoutMs: field.int({ default: 30000, description: "Execution timeout" }),
848
+ version: field.string({ default: "1.0.0", description: "Tool version" }),
849
+ tags: field.string({
850
+ isArray: true,
851
+ isOptional: true,
852
+ description: "Tags for categorization"
853
+ }),
854
+ createdAt: field.createdAt(),
855
+ updatedAt: field.updatedAt(),
856
+ createdById: field.string({
857
+ isOptional: true,
858
+ description: "User who created this tool"
859
+ }),
860
+ agents: field.hasMany("Agent", { description: "Agents using this tool" })
861
+ },
862
+ indexes: [
863
+ index.unique(["organizationId", "slug"]),
864
+ index.on(["organizationId", "category"]),
865
+ index.on(["organizationId", "status"])
866
+ ],
867
+ enums: [
868
+ ToolCategoryEntityEnum,
869
+ ToolStatusEntityEnum,
870
+ ImplementationTypeEntityEnum
871
+ ]
872
+ });
873
+
874
+ // src/tool/tool.presentation.ts
875
+ import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
876
+ var ToolListPresentation = definePresentation({
877
+ meta: {
878
+ key: "agent-console.tool.list",
879
+ version: "1.0.0",
880
+ title: "Tool List",
881
+ description: "List view of AI tools with category, status, and version info",
882
+ goal: "Provide an overview of all available tools for agents.",
883
+ context: "Tool management dashboard.",
884
+ domain: "agent-console",
885
+ owners: ["@agent-console-team"],
886
+ tags: ["tool", "list", "dashboard"],
887
+ stability: StabilityEnum.Experimental
888
+ },
889
+ source: {
890
+ type: "component",
891
+ framework: "react",
892
+ componentKey: "ToolListView",
893
+ props: ToolSummaryModel
894
+ },
895
+ targets: ["react", "markdown", "application/json"],
896
+ policy: { flags: ["agent-console.enabled"] }
897
+ });
898
+ var ToolDetailPresentation = definePresentation({
899
+ meta: {
900
+ key: "agent-console.tool.detail",
901
+ version: "1.0.0",
902
+ title: "Tool Details",
903
+ description: "Detailed view of an AI tool with configuration and test panel",
904
+ goal: "Allow users to inspect and test a specific tool.",
905
+ context: "Detailed view of a tool.",
906
+ domain: "agent-console",
907
+ owners: ["@agent-console-team"],
908
+ tags: ["tool", "detail"],
909
+ stability: StabilityEnum.Experimental
910
+ },
911
+ source: {
912
+ type: "component",
913
+ framework: "react",
914
+ componentKey: "ToolDetailView"
915
+ },
916
+ targets: ["react", "markdown"],
917
+ policy: { flags: ["agent-console.enabled"] }
918
+ });
919
+ export {
920
+ mockUpdateToolHandler,
921
+ mockTestToolHandler,
922
+ mockListToolsHandler,
923
+ mockGetToolHandler,
924
+ mockCreateToolHandler,
925
+ UpdateToolInputModel,
926
+ UpdateToolCommand,
927
+ ToolUpdatedEvent,
928
+ ToolSummaryModel,
929
+ ToolStatusEnum,
930
+ ToolStatusEntityEnum,
931
+ ToolStatusChangedEvent,
932
+ ToolModel,
933
+ ToolListPresentation,
934
+ ToolEntity,
935
+ ToolDetailPresentation,
936
+ ToolCreatedEvent,
937
+ ToolCategoryEnum,
938
+ ToolCategoryEntityEnum,
939
+ TestToolCommand,
940
+ ListToolsQuery,
941
+ ImplementationTypeEnum,
942
+ ImplementationTypeEntityEnum,
943
+ GetToolQuery,
944
+ CreateToolInputModel,
945
+ CreateToolCommand
946
+ };