@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
@@ -1,406 +1,483 @@
1
- import { ToolCategoryEnum, ToolStatusEnum } from "./tool.enum.js";
2
- import { CreateToolInputModel, ToolModel, ToolSummaryModel, UpdateToolInputModel } from "./tool.schema.js";
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
- import { defineCommand, defineQuery } from "@contractspec/lib.contracts/operations";
1
+ // @bun
2
+ // src/tool/tool.enum.ts
3
+ import { defineEnum } from "@contractspec/lib.schema";
4
+ var ToolCategoryEnum = defineEnum("ToolCategory", [
5
+ "RETRIEVAL",
6
+ "COMPUTATION",
7
+ "COMMUNICATION",
8
+ "INTEGRATION",
9
+ "UTILITY",
10
+ "CUSTOM"
11
+ ]);
12
+ var ToolStatusEnum = defineEnum("ToolStatus", [
13
+ "DRAFT",
14
+ "ACTIVE",
15
+ "DEPRECATED",
16
+ "DISABLED"
17
+ ]);
18
+ var ImplementationTypeEnum = defineEnum("ImplementationType", [
19
+ "http",
20
+ "function",
21
+ "workflow"
22
+ ]);
5
23
 
6
- //#region src/tool/tool.operation.ts
7
- const OWNERS = ["@agent-console-team"];
8
- /**
9
- * CreateToolCommand - Creates a new tool definition.
10
- */
11
- const CreateToolCommand = defineCommand({
12
- meta: {
13
- key: "agent.tool.create",
14
- version: "1.0.0",
15
- stability: "stable",
16
- owners: [...OWNERS],
17
- tags: ["tool", "create"],
18
- description: "Creates a new AI tool definition.",
19
- goal: "Allow users to define new tools that agents can use.",
20
- context: "Called from the tool builder UI when creating a new tool."
21
- },
22
- io: {
23
- input: CreateToolInputModel,
24
- output: defineSchemaModel({
25
- name: "CreateToolOutput",
26
- fields: {
27
- id: {
28
- type: ScalarTypeEnum.String_unsecure(),
29
- isOptional: false
30
- },
31
- name: {
32
- type: ScalarTypeEnum.NonEmptyString(),
33
- isOptional: false
34
- },
35
- slug: {
36
- type: ScalarTypeEnum.String_unsecure(),
37
- isOptional: false
38
- },
39
- status: {
40
- type: ToolStatusEnum,
41
- isOptional: false
42
- }
43
- }
44
- }),
45
- errors: { SLUG_EXISTS: {
46
- description: "A tool with this slug already exists in the organization",
47
- http: 409,
48
- gqlCode: "SLUG_EXISTS",
49
- when: "Slug is already taken"
50
- } }
51
- },
52
- policy: { auth: "user" },
53
- sideEffects: {
54
- emits: [{
55
- key: "tool.created",
56
- version: "1.0.0",
57
- stability: "stable",
58
- owners: [...OWNERS],
59
- tags: ["tool", "created"],
60
- when: "Tool is successfully created",
61
- payload: ToolSummaryModel
62
- }],
63
- audit: ["tool.created"]
64
- },
65
- acceptance: {
66
- scenarios: [{
67
- key: "create-tool-happy-path",
68
- given: ["User is authenticated", "Organization exists"],
69
- when: ["User submits valid tool configuration"],
70
- then: ["New tool is created", "ToolCreated event is emitted"]
71
- }, {
72
- key: "create-tool-slug-conflict",
73
- given: ["Tool with same slug exists"],
74
- when: ["User submits tool with duplicate slug"],
75
- then: ["SLUG_EXISTS error is returned"]
76
- }],
77
- examples: [{
78
- key: "create-api-tool",
79
- input: {
80
- name: "Weather API",
81
- slug: "weather-api",
82
- category: "api",
83
- description: "Fetches weather data"
84
- },
85
- output: {
86
- id: "tool-123",
87
- name: "Weather API",
88
- slug: "weather-api",
89
- status: "draft"
90
- }
91
- }]
92
- }
24
+ // src/tool/tool.schema.ts
25
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
26
+ var ToolModel = defineSchemaModel({
27
+ name: "Tool",
28
+ description: "AI tool definition",
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.NonEmptyString(), isOptional: false },
36
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ category: { type: ToolCategoryEnum, isOptional: false },
39
+ status: { type: ToolStatusEnum, isOptional: false },
40
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
41
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
42
+ implementationType: { type: ImplementationTypeEnum, isOptional: false },
43
+ implementationConfig: {
44
+ type: ScalarTypeEnum.JSONObject(),
45
+ isOptional: false
46
+ },
47
+ maxInvocationsPerMinute: {
48
+ type: ScalarTypeEnum.Int_unsecure(),
49
+ isOptional: true
50
+ },
51
+ timeoutMs: {
52
+ type: ScalarTypeEnum.Int_unsecure(),
53
+ isOptional: false,
54
+ defaultValue: 30000
55
+ },
56
+ version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
57
+ tags: {
58
+ type: ScalarTypeEnum.String_unsecure(),
59
+ isArray: true,
60
+ isOptional: true
61
+ },
62
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
63
+ updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
64
+ }
93
65
  });
94
- /**
95
- * UpdateToolCommand - Updates an existing tool.
96
- */
97
- const UpdateToolCommand = defineCommand({
98
- meta: {
99
- key: "agent.tool.update",
100
- version: "1.0.0",
101
- stability: "stable",
102
- owners: [...OWNERS],
103
- tags: ["tool", "update"],
104
- description: "Updates an existing AI tool definition.",
105
- goal: "Allow users to modify tool settings and configuration.",
106
- context: "Called from the tool settings UI."
107
- },
108
- io: {
109
- input: UpdateToolInputModel,
110
- output: defineSchemaModel({
111
- name: "UpdateToolOutput",
112
- fields: {
113
- id: {
114
- type: ScalarTypeEnum.String_unsecure(),
115
- isOptional: false
116
- },
117
- name: {
118
- type: ScalarTypeEnum.NonEmptyString(),
119
- isOptional: false
120
- },
121
- status: {
122
- type: ToolStatusEnum,
123
- isOptional: false
124
- },
125
- updatedAt: {
126
- type: ScalarTypeEnum.DateTime(),
127
- isOptional: false
128
- }
129
- }
130
- }),
131
- errors: { TOOL_NOT_FOUND: {
132
- description: "The specified tool does not exist",
133
- http: 404,
134
- gqlCode: "TOOL_NOT_FOUND",
135
- when: "Tool ID is invalid"
136
- } }
137
- },
138
- policy: { auth: "user" },
139
- sideEffects: {
140
- emits: [{
141
- key: "tool.updated",
142
- version: "1.0.0",
143
- stability: "stable",
144
- owners: [...OWNERS],
145
- tags: ["tool", "updated"],
146
- when: "Tool is updated",
147
- payload: ToolSummaryModel
148
- }],
149
- audit: ["tool.updated"]
150
- },
151
- acceptance: {
152
- scenarios: [{
153
- key: "update-tool-happy-path",
154
- given: ["Tool exists", "User owns the tool"],
155
- when: ["User submits updated configuration"],
156
- then: ["Tool is updated", "ToolUpdated event is emitted"]
157
- }],
158
- examples: [{
159
- key: "update-description",
160
- input: {
161
- toolId: "tool-123",
162
- description: "Updated weather API tool"
163
- },
164
- output: {
165
- id: "tool-123",
166
- name: "Weather API",
167
- status: "draft",
168
- updatedAt: "2025-01-01T00:00:00Z"
169
- }
170
- }]
171
- }
66
+ var ToolSummaryModel = defineSchemaModel({
67
+ name: "ToolSummary",
68
+ description: "Summary of a tool for list views",
69
+ fields: {
70
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
71
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
72
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
73
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
74
+ category: { type: ToolCategoryEnum, isOptional: false },
75
+ status: { type: ToolStatusEnum, isOptional: false },
76
+ version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
77
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
78
+ }
172
79
  });
173
- /**
174
- * GetToolQuery - Retrieves a tool by ID.
175
- */
176
- const GetToolQuery = defineQuery({
177
- meta: {
178
- key: "agent.tool.get",
179
- version: "1.0.0",
180
- stability: "stable",
181
- owners: [...OWNERS],
182
- tags: ["tool", "get"],
183
- description: "Retrieves a tool by its ID.",
184
- goal: "View detailed tool configuration.",
185
- context: "Called when viewing tool details or editing."
186
- },
187
- io: {
188
- input: defineSchemaModel({
189
- name: "GetToolInput",
190
- fields: { toolId: {
191
- type: ScalarTypeEnum.String_unsecure(),
192
- isOptional: false
193
- } }
194
- }),
195
- output: ToolModel,
196
- errors: { TOOL_NOT_FOUND: {
197
- description: "The specified tool does not exist",
198
- http: 404,
199
- gqlCode: "TOOL_NOT_FOUND",
200
- when: "Tool ID is invalid"
201
- } }
202
- },
203
- policy: { auth: "user" },
204
- acceptance: {
205
- scenarios: [{
206
- key: "get-tool-happy-path",
207
- given: ["Tool exists"],
208
- when: ["User requests tool by ID"],
209
- then: ["Tool details are returned"]
210
- }],
211
- examples: [{
212
- key: "get-basic",
213
- input: { toolId: "tool-123" },
214
- output: {
215
- id: "tool-123",
216
- name: "Weather API",
217
- status: "active",
218
- category: "api"
219
- }
220
- }]
221
- }
80
+ var CreateToolInputModel = defineSchemaModel({
81
+ name: "CreateToolInput",
82
+ description: "Input for creating a tool",
83
+ fields: {
84
+ organizationId: {
85
+ type: ScalarTypeEnum.String_unsecure(),
86
+ isOptional: false
87
+ },
88
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
89
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
90
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
91
+ category: { type: ToolCategoryEnum, isOptional: true },
92
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
93
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
94
+ implementationType: { type: ImplementationTypeEnum, isOptional: false },
95
+ implementationConfig: {
96
+ type: ScalarTypeEnum.JSONObject(),
97
+ isOptional: false
98
+ },
99
+ maxInvocationsPerMinute: {
100
+ type: ScalarTypeEnum.Int_unsecure(),
101
+ isOptional: true
102
+ },
103
+ timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
104
+ tags: {
105
+ type: ScalarTypeEnum.String_unsecure(),
106
+ isArray: true,
107
+ isOptional: true
108
+ }
109
+ }
222
110
  });
223
- /**
224
- * ListToolsQuery - Lists tools for an organization.
225
- */
226
- const ListToolsQuery = defineQuery({
227
- meta: {
228
- key: "agent.tool.list",
229
- version: "1.0.0",
230
- stability: "stable",
231
- owners: [...OWNERS],
232
- tags: ["tool", "list"],
233
- description: "Lists tools for an organization with optional filtering.",
234
- goal: "Browse and search available tools.",
235
- context: "Tool list/dashboard view."
236
- },
237
- io: {
238
- input: defineSchemaModel({
239
- name: "ListToolsInput",
240
- fields: {
241
- organizationId: {
242
- type: ScalarTypeEnum.String_unsecure(),
243
- isOptional: false
244
- },
245
- category: {
246
- type: ToolCategoryEnum,
247
- isOptional: true
248
- },
249
- status: {
250
- type: ToolStatusEnum,
251
- isOptional: true
252
- },
253
- search: {
254
- type: ScalarTypeEnum.String_unsecure(),
255
- isOptional: true
256
- },
257
- limit: {
258
- type: ScalarTypeEnum.Int_unsecure(),
259
- isOptional: true,
260
- defaultValue: 20
261
- },
262
- offset: {
263
- type: ScalarTypeEnum.Int_unsecure(),
264
- isOptional: true,
265
- defaultValue: 0
266
- }
267
- }
268
- }),
269
- output: defineSchemaModel({
270
- name: "ListToolsOutput",
271
- fields: {
272
- items: {
273
- type: ToolSummaryModel,
274
- isArray: true,
275
- isOptional: false
276
- },
277
- total: {
278
- type: ScalarTypeEnum.Int_unsecure(),
279
- isOptional: false
280
- },
281
- hasMore: {
282
- type: ScalarTypeEnum.Boolean(),
283
- isOptional: false
284
- }
285
- }
286
- })
287
- },
288
- policy: { auth: "user" },
289
- acceptance: {
290
- scenarios: [{
291
- key: "list-tools-happy-path",
292
- given: ["Organization has tools"],
293
- when: ["User lists tools"],
294
- then: ["Paginated list of tools is returned"]
295
- }],
296
- examples: [{
297
- key: "list-by-category",
298
- input: {
299
- organizationId: "org-123",
300
- category: "api",
301
- limit: 10
302
- },
303
- output: {
304
- items: [],
305
- total: 0,
306
- hasMore: false
307
- }
308
- }]
309
- }
310
- });
311
- /**
312
- * TestToolCommand - Tests a tool with sample input.
313
- */
314
- const TestToolCommand = defineCommand({
315
- meta: {
316
- key: "agent.tool.test",
317
- version: "1.0.0",
318
- stability: "stable",
319
- owners: [...OWNERS],
320
- tags: ["tool", "test"],
321
- description: "Tests a tool with sample input to verify it works correctly.",
322
- goal: "Validate tool configuration before deployment.",
323
- context: "Tool builder UI - test panel."
324
- },
325
- io: {
326
- input: defineSchemaModel({
327
- name: "TestToolInput",
328
- fields: {
329
- toolId: {
330
- type: ScalarTypeEnum.String_unsecure(),
331
- isOptional: false
332
- },
333
- testInput: {
334
- type: ScalarTypeEnum.JSONObject(),
335
- isOptional: false
336
- }
337
- }
338
- }),
339
- output: defineSchemaModel({
340
- name: "TestToolOutput",
341
- fields: {
342
- success: {
343
- type: ScalarTypeEnum.Boolean(),
344
- isOptional: false
345
- },
346
- output: {
347
- type: ScalarTypeEnum.JSONObject(),
348
- isOptional: true
349
- },
350
- error: {
351
- type: ScalarTypeEnum.String_unsecure(),
352
- isOptional: true
353
- },
354
- durationMs: {
355
- type: ScalarTypeEnum.Int_unsecure(),
356
- isOptional: false
357
- }
358
- }
359
- }),
360
- errors: {
361
- TOOL_NOT_FOUND: {
362
- description: "The specified tool does not exist",
363
- http: 404,
364
- gqlCode: "TOOL_NOT_FOUND",
365
- when: "Tool ID is invalid"
366
- },
367
- TOOL_EXECUTION_ERROR: {
368
- description: "Tool execution failed",
369
- http: 500,
370
- gqlCode: "TOOL_EXECUTION_ERROR",
371
- when: "Tool returns an error"
372
- }
373
- }
374
- },
375
- policy: { auth: "user" },
376
- sideEffects: { audit: ["tool.tested"] },
377
- acceptance: {
378
- scenarios: [{
379
- key: "test-tool-success",
380
- given: ["Tool exists", "Tool is configured correctly"],
381
- when: ["User runs test with valid input"],
382
- then: ["Tool executes successfully", "Output is returned"]
383
- }, {
384
- key: "test-tool-failure",
385
- given: ["Tool exists", "Tool has configuration error"],
386
- when: ["User runs test"],
387
- then: ["TOOL_EXECUTION_ERROR is returned"]
388
- }],
389
- examples: [{
390
- key: "test-weather-api",
391
- input: {
392
- toolId: "tool-123",
393
- testInput: { city: "Paris" }
394
- },
395
- output: {
396
- success: true,
397
- output: { temperature: 22 },
398
- durationMs: 150
399
- }
400
- }]
401
- }
111
+ var UpdateToolInputModel = defineSchemaModel({
112
+ name: "UpdateToolInput",
113
+ description: "Input for updating a tool",
114
+ fields: {
115
+ toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
116
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: true },
117
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
118
+ status: { type: ToolStatusEnum, isOptional: true },
119
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
120
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
121
+ implementationConfig: {
122
+ type: ScalarTypeEnum.JSONObject(),
123
+ isOptional: true
124
+ },
125
+ maxInvocationsPerMinute: {
126
+ type: ScalarTypeEnum.Int_unsecure(),
127
+ isOptional: true
128
+ },
129
+ timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
130
+ tags: {
131
+ type: ScalarTypeEnum.String_unsecure(),
132
+ isArray: true,
133
+ isOptional: true
134
+ }
135
+ }
402
136
  });
403
137
 
404
- //#endregion
405
- export { CreateToolCommand, GetToolQuery, ListToolsQuery, TestToolCommand, UpdateToolCommand };
406
- //# sourceMappingURL=tool.operation.js.map
138
+ // src/tool/tool.operation.ts
139
+ import {
140
+ defineCommand,
141
+ defineQuery
142
+ } from "@contractspec/lib.contracts/operations";
143
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
144
+ var OWNERS = ["@agent-console-team"];
145
+ var CreateToolCommand = defineCommand({
146
+ meta: {
147
+ key: "agent.tool.create",
148
+ version: "1.0.0",
149
+ stability: "stable",
150
+ owners: [...OWNERS],
151
+ tags: ["tool", "create"],
152
+ description: "Creates a new AI tool definition.",
153
+ goal: "Allow users to define new tools that agents can use.",
154
+ context: "Called from the tool builder UI when creating a new tool."
155
+ },
156
+ io: {
157
+ input: CreateToolInputModel,
158
+ output: defineSchemaModel2({
159
+ name: "CreateToolOutput",
160
+ fields: {
161
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
162
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
163
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
164
+ status: { type: ToolStatusEnum, isOptional: false }
165
+ }
166
+ }),
167
+ errors: {
168
+ SLUG_EXISTS: {
169
+ description: "A tool with this slug already exists in the organization",
170
+ http: 409,
171
+ gqlCode: "SLUG_EXISTS",
172
+ when: "Slug is already taken"
173
+ }
174
+ }
175
+ },
176
+ policy: { auth: "user" },
177
+ sideEffects: {
178
+ emits: [
179
+ {
180
+ key: "tool.created",
181
+ version: "1.0.0",
182
+ stability: "stable",
183
+ owners: [...OWNERS],
184
+ tags: ["tool", "created"],
185
+ when: "Tool is successfully created",
186
+ payload: ToolSummaryModel
187
+ }
188
+ ],
189
+ audit: ["tool.created"]
190
+ },
191
+ acceptance: {
192
+ scenarios: [
193
+ {
194
+ key: "create-tool-happy-path",
195
+ given: ["User is authenticated", "Organization exists"],
196
+ when: ["User submits valid tool configuration"],
197
+ then: ["New tool is created", "ToolCreated event is emitted"]
198
+ },
199
+ {
200
+ key: "create-tool-slug-conflict",
201
+ given: ["Tool with same slug exists"],
202
+ when: ["User submits tool with duplicate slug"],
203
+ then: ["SLUG_EXISTS error is returned"]
204
+ }
205
+ ],
206
+ examples: [
207
+ {
208
+ key: "create-api-tool",
209
+ input: {
210
+ name: "Weather API",
211
+ slug: "weather-api",
212
+ category: "api",
213
+ description: "Fetches weather data"
214
+ },
215
+ output: {
216
+ id: "tool-123",
217
+ name: "Weather API",
218
+ slug: "weather-api",
219
+ status: "draft"
220
+ }
221
+ }
222
+ ]
223
+ }
224
+ });
225
+ var UpdateToolCommand = defineCommand({
226
+ meta: {
227
+ key: "agent.tool.update",
228
+ version: "1.0.0",
229
+ stability: "stable",
230
+ owners: [...OWNERS],
231
+ tags: ["tool", "update"],
232
+ description: "Updates an existing AI tool definition.",
233
+ goal: "Allow users to modify tool settings and configuration.",
234
+ context: "Called from the tool settings UI."
235
+ },
236
+ io: {
237
+ input: UpdateToolInputModel,
238
+ output: defineSchemaModel2({
239
+ name: "UpdateToolOutput",
240
+ fields: {
241
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
242
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
243
+ status: { type: ToolStatusEnum, isOptional: false },
244
+ updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
245
+ }
246
+ }),
247
+ errors: {
248
+ TOOL_NOT_FOUND: {
249
+ description: "The specified tool does not exist",
250
+ http: 404,
251
+ gqlCode: "TOOL_NOT_FOUND",
252
+ when: "Tool ID is invalid"
253
+ }
254
+ }
255
+ },
256
+ policy: { auth: "user" },
257
+ sideEffects: {
258
+ emits: [
259
+ {
260
+ key: "tool.updated",
261
+ version: "1.0.0",
262
+ stability: "stable",
263
+ owners: [...OWNERS],
264
+ tags: ["tool", "updated"],
265
+ when: "Tool is updated",
266
+ payload: ToolSummaryModel
267
+ }
268
+ ],
269
+ audit: ["tool.updated"]
270
+ },
271
+ acceptance: {
272
+ scenarios: [
273
+ {
274
+ key: "update-tool-happy-path",
275
+ given: ["Tool exists", "User owns the tool"],
276
+ when: ["User submits updated configuration"],
277
+ then: ["Tool is updated", "ToolUpdated event is emitted"]
278
+ }
279
+ ],
280
+ examples: [
281
+ {
282
+ key: "update-description",
283
+ input: { toolId: "tool-123", description: "Updated weather API tool" },
284
+ output: {
285
+ id: "tool-123",
286
+ name: "Weather API",
287
+ status: "draft",
288
+ updatedAt: "2025-01-01T00:00:00Z"
289
+ }
290
+ }
291
+ ]
292
+ }
293
+ });
294
+ var GetToolQuery = defineQuery({
295
+ meta: {
296
+ key: "agent.tool.get",
297
+ version: "1.0.0",
298
+ stability: "stable",
299
+ owners: [...OWNERS],
300
+ tags: ["tool", "get"],
301
+ description: "Retrieves a tool by its ID.",
302
+ goal: "View detailed tool configuration.",
303
+ context: "Called when viewing tool details or editing."
304
+ },
305
+ io: {
306
+ input: defineSchemaModel2({
307
+ name: "GetToolInput",
308
+ fields: {
309
+ toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
310
+ }
311
+ }),
312
+ output: ToolModel,
313
+ errors: {
314
+ TOOL_NOT_FOUND: {
315
+ description: "The specified tool does not exist",
316
+ http: 404,
317
+ gqlCode: "TOOL_NOT_FOUND",
318
+ when: "Tool ID is invalid"
319
+ }
320
+ }
321
+ },
322
+ policy: { auth: "user" },
323
+ acceptance: {
324
+ scenarios: [
325
+ {
326
+ key: "get-tool-happy-path",
327
+ given: ["Tool exists"],
328
+ when: ["User requests tool by ID"],
329
+ then: ["Tool details are returned"]
330
+ }
331
+ ],
332
+ examples: [
333
+ {
334
+ key: "get-basic",
335
+ input: { toolId: "tool-123" },
336
+ output: {
337
+ id: "tool-123",
338
+ name: "Weather API",
339
+ status: "active",
340
+ category: "api"
341
+ }
342
+ }
343
+ ]
344
+ }
345
+ });
346
+ var ListToolsQuery = defineQuery({
347
+ meta: {
348
+ key: "agent.tool.list",
349
+ version: "1.0.0",
350
+ stability: "stable",
351
+ owners: [...OWNERS],
352
+ tags: ["tool", "list"],
353
+ description: "Lists tools for an organization with optional filtering.",
354
+ goal: "Browse and search available tools.",
355
+ context: "Tool list/dashboard view."
356
+ },
357
+ io: {
358
+ input: defineSchemaModel2({
359
+ name: "ListToolsInput",
360
+ fields: {
361
+ organizationId: {
362
+ type: ScalarTypeEnum2.String_unsecure(),
363
+ isOptional: false
364
+ },
365
+ category: { type: ToolCategoryEnum, isOptional: true },
366
+ status: { type: ToolStatusEnum, isOptional: true },
367
+ search: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
368
+ limit: {
369
+ type: ScalarTypeEnum2.Int_unsecure(),
370
+ isOptional: true,
371
+ defaultValue: 20
372
+ },
373
+ offset: {
374
+ type: ScalarTypeEnum2.Int_unsecure(),
375
+ isOptional: true,
376
+ defaultValue: 0
377
+ }
378
+ }
379
+ }),
380
+ output: defineSchemaModel2({
381
+ name: "ListToolsOutput",
382
+ fields: {
383
+ items: { type: ToolSummaryModel, isArray: true, isOptional: false },
384
+ total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
385
+ hasMore: { type: ScalarTypeEnum2.Boolean(), isOptional: false }
386
+ }
387
+ })
388
+ },
389
+ policy: { auth: "user" },
390
+ acceptance: {
391
+ scenarios: [
392
+ {
393
+ key: "list-tools-happy-path",
394
+ given: ["Organization has tools"],
395
+ when: ["User lists tools"],
396
+ then: ["Paginated list of tools is returned"]
397
+ }
398
+ ],
399
+ examples: [
400
+ {
401
+ key: "list-by-category",
402
+ input: { organizationId: "org-123", category: "api", limit: 10 },
403
+ output: { items: [], total: 0, hasMore: false }
404
+ }
405
+ ]
406
+ }
407
+ });
408
+ var TestToolCommand = defineCommand({
409
+ meta: {
410
+ key: "agent.tool.test",
411
+ version: "1.0.0",
412
+ stability: "stable",
413
+ owners: [...OWNERS],
414
+ tags: ["tool", "test"],
415
+ description: "Tests a tool with sample input to verify it works correctly.",
416
+ goal: "Validate tool configuration before deployment.",
417
+ context: "Tool builder UI - test panel."
418
+ },
419
+ io: {
420
+ input: defineSchemaModel2({
421
+ name: "TestToolInput",
422
+ fields: {
423
+ toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
424
+ testInput: { type: ScalarTypeEnum2.JSONObject(), isOptional: false }
425
+ }
426
+ }),
427
+ output: defineSchemaModel2({
428
+ name: "TestToolOutput",
429
+ fields: {
430
+ success: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
431
+ output: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
432
+ error: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
433
+ durationMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
434
+ }
435
+ }),
436
+ errors: {
437
+ TOOL_NOT_FOUND: {
438
+ description: "The specified tool does not exist",
439
+ http: 404,
440
+ gqlCode: "TOOL_NOT_FOUND",
441
+ when: "Tool ID is invalid"
442
+ },
443
+ TOOL_EXECUTION_ERROR: {
444
+ description: "Tool execution failed",
445
+ http: 500,
446
+ gqlCode: "TOOL_EXECUTION_ERROR",
447
+ when: "Tool returns an error"
448
+ }
449
+ }
450
+ },
451
+ policy: { auth: "user" },
452
+ sideEffects: { audit: ["tool.tested"] },
453
+ acceptance: {
454
+ scenarios: [
455
+ {
456
+ key: "test-tool-success",
457
+ given: ["Tool exists", "Tool is configured correctly"],
458
+ when: ["User runs test with valid input"],
459
+ then: ["Tool executes successfully", "Output is returned"]
460
+ },
461
+ {
462
+ key: "test-tool-failure",
463
+ given: ["Tool exists", "Tool has configuration error"],
464
+ when: ["User runs test"],
465
+ then: ["TOOL_EXECUTION_ERROR is returned"]
466
+ }
467
+ ],
468
+ examples: [
469
+ {
470
+ key: "test-weather-api",
471
+ input: { toolId: "tool-123", testInput: { city: "Paris" } },
472
+ output: { success: true, output: { temperature: 22 }, durationMs: 150 }
473
+ }
474
+ ]
475
+ }
476
+ });
477
+ export {
478
+ UpdateToolCommand,
479
+ TestToolCommand,
480
+ ListToolsQuery,
481
+ GetToolQuery,
482
+ CreateToolCommand
483
+ };