@commandable/mcp 0.1.2 → 0.2.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 (282) hide show
  1. package/{dist/app → .output}/nitro.json +1 -1
  2. package/{dist/app/public/_nuxt/-tOYwuj2.js → .output/public/_nuxt/B04gGCnx.js} +3 -3
  3. package/{dist/app/public/_nuxt/D-43HurL.js → .output/public/_nuxt/B2dAlp_u.js} +8 -8
  4. package/.output/public/_nuxt/Ba0BY0O0.js +1 -0
  5. package/.output/public/_nuxt/BvFUCPqA.js +1 -0
  6. package/{dist/app/public/_nuxt/BdctKXor.js → .output/public/_nuxt/Dm_hd4at.js} +1 -1
  7. package/{dist/app/public/_nuxt/BlP7Uu-5.js → .output/public/_nuxt/S2P9sd4n.js} +1 -1
  8. package/.output/public/_nuxt/builds/latest.json +1 -0
  9. package/.output/public/_nuxt/builds/meta/ee5097c4-b785-4b77-92d6-c16a7396d677.json +1 -0
  10. package/{dist/app/public/_nuxt/CsbkV5Bd.js → .output/public/_nuxt/d2XTSFt9.js} +1 -1
  11. package/{dist/app/server/chunks/build/_id_-DBwSV4AY.mjs → .output/server/chunks/build/_id_-Bnxenh08.mjs} +7 -7
  12. package/{dist/app/server/chunks/build/_id_-DBwSV4AY.mjs.map → .output/server/chunks/build/_id_-Bnxenh08.mjs.map} +1 -1
  13. package/{dist/app → .output}/server/chunks/build/client.precomputed.mjs +1 -1
  14. package/{dist/app/server/chunks/build/fetch-ZbqIFhDG.mjs → .output/server/chunks/build/fetch-BmYZnj75.mjs} +58 -6
  15. package/.output/server/chunks/build/fetch-BmYZnj75.mjs.map +1 -0
  16. package/{dist/app/server/chunks/build/index-C8flTcKI.mjs → .output/server/chunks/build/index-CL-Gkd-Y.mjs} +4 -4
  17. package/.output/server/chunks/build/index-CL-Gkd-Y.mjs.map +1 -0
  18. package/{dist/app → .output}/server/chunks/build/server.mjs +3 -3
  19. package/{dist/app → .output}/server/chunks/nitro/nitro.mjs +417 -204
  20. package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
  21. package/{dist/app → .output}/server/chunks/routes/api/index.get.mjs +1 -1
  22. package/{dist/app → .output}/server/chunks/routes/api/index.post.mjs +1 -1
  23. package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-config.get.mjs +1 -1
  24. package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-status.get.mjs +1 -1
  25. package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.delete.mjs +1 -1
  26. package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.post.mjs +1 -1
  27. package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/permissions.post.mjs +1 -1
  28. package/.output/server/chunks/routes/api/integrations/_id/tools.delete.mjs +51 -0
  29. package/.output/server/chunks/routes/api/integrations/_id/tools.delete.mjs.map +1 -0
  30. package/.output/server/chunks/routes/api/integrations/_id/tools.get.mjs +57 -0
  31. package/.output/server/chunks/routes/api/integrations/_id/tools.get.mjs.map +1 -0
  32. package/.output/server/chunks/routes/api/integrations/_id/toolsets.get.mjs +53 -0
  33. package/.output/server/chunks/routes/api/integrations/_id/toolsets.get.mjs.map +1 -0
  34. package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/toolsets.post.mjs +1 -1
  35. package/.output/server/chunks/routes/api/integrations/_id_.delete.mjs +55 -0
  36. package/.output/server/chunks/routes/api/integrations/_id_.delete.mjs.map +1 -0
  37. package/{dist/app → .output}/server/chunks/routes/mcp/create.mjs +1 -1
  38. package/{dist/app → .output}/server/chunks/routes/mcp.mjs +1 -1
  39. package/{dist/app → .output}/server/chunks/routes/renderer.mjs +1 -1
  40. package/{dist/app → .output}/server/index.mjs +1 -1
  41. package/{dist/app → .output}/server/package.json +2 -2
  42. package/LICENSE +17 -6
  43. package/README.md +32 -32
  44. package/bin/cli.mjs +552 -0
  45. package/bin/commandable-mcp.mjs +8 -0
  46. package/package.json +30 -40
  47. package/dist/app/public/_nuxt/DU1mG77A.js +0 -1
  48. package/dist/app/public/_nuxt/builds/latest.json +0 -1
  49. package/dist/app/public/_nuxt/builds/meta/b13ec2b2-ddd3-4ead-abd4-4fba9dfc0061.json +0 -1
  50. package/dist/app/public/_nuxt/uS7FY2am.js +0 -1
  51. package/dist/app/server/chunks/build/fetch-ZbqIFhDG.mjs.map +0 -1
  52. package/dist/app/server/chunks/build/index-C8flTcKI.mjs.map +0 -1
  53. package/dist/app/server/chunks/nitro/nitro.mjs.map +0 -1
  54. package/dist/app/server/chunks/routes/api/integrations/_id_.delete.mjs +0 -44
  55. package/dist/app/server/chunks/routes/api/integrations/_id_.delete.mjs.map +0 -1
  56. package/dist/app/server/migrations/pg/0000_initial.sql +0 -74
  57. package/dist/app/server/migrations/pg/meta/_journal.json +0 -13
  58. package/dist/app/server/migrations/sqlite/0000_initial.sql +0 -74
  59. package/dist/app/server/migrations/sqlite/meta/_journal.json +0 -13
  60. package/dist/cli/bin.d.ts +0 -3
  61. package/dist/cli/bin.d.ts.map +0 -1
  62. package/dist/cli/bin.js +0 -7
  63. package/dist/cli/bin.js.map +0 -1
  64. package/dist/cli/credentialManager.d.ts +0 -19
  65. package/dist/cli/credentialManager.d.ts.map +0 -1
  66. package/dist/cli/credentialManager.js +0 -82
  67. package/dist/cli/credentialManager.js.map +0 -1
  68. package/dist/cli/index.d.ts +0 -17
  69. package/dist/cli/index.d.ts.map +0 -1
  70. package/dist/cli/index.js +0 -818
  71. package/dist/cli/index.js.map +0 -1
  72. package/dist/cli/setup.d.ts +0 -3
  73. package/dist/cli/setup.d.ts.map +0 -1
  74. package/dist/cli/setup.js +0 -353
  75. package/dist/cli/setup.js.map +0 -1
  76. package/dist/config/configApply.d.ts +0 -16
  77. package/dist/config/configApply.d.ts.map +0 -1
  78. package/dist/config/configApply.js +0 -77
  79. package/dist/config/configApply.js.map +0 -1
  80. package/dist/config/configLoader.d.ts +0 -9
  81. package/dist/config/configLoader.d.ts.map +0 -1
  82. package/dist/config/configLoader.js +0 -75
  83. package/dist/config/configLoader.js.map +0 -1
  84. package/dist/config/configSchema.d.ts +0 -45
  85. package/dist/config/configSchema.d.ts.map +0 -1
  86. package/dist/config/configSchema.js +0 -23
  87. package/dist/config/configSchema.js.map +0 -1
  88. package/dist/crypto/encryption.d.ts +0 -3
  89. package/dist/crypto/encryption.d.ts.map +0 -1
  90. package/dist/crypto/encryption.js +0 -29
  91. package/dist/crypto/encryption.js.map +0 -1
  92. package/dist/db/client.d.ts +0 -24
  93. package/dist/db/client.d.ts.map +0 -1
  94. package/dist/db/client.js +0 -50
  95. package/dist/db/client.js.map +0 -1
  96. package/dist/db/credentialStore.d.ts +0 -15
  97. package/dist/db/credentialStore.d.ts.map +0 -1
  98. package/dist/db/credentialStore.js +0 -56
  99. package/dist/db/credentialStore.js.map +0 -1
  100. package/dist/db/integrationStore.d.ts +0 -12
  101. package/dist/db/integrationStore.d.ts.map +0 -1
  102. package/dist/db/integrationStore.js +0 -111
  103. package/dist/db/integrationStore.js.map +0 -1
  104. package/dist/db/integrationTypeConfigStore.d.ts +0 -6
  105. package/dist/db/integrationTypeConfigStore.d.ts.map +0 -1
  106. package/dist/db/integrationTypeConfigStore.js +0 -94
  107. package/dist/db/integrationTypeConfigStore.js.map +0 -1
  108. package/dist/db/migrate.d.ts +0 -3
  109. package/dist/db/migrate.d.ts.map +0 -1
  110. package/dist/db/migrate.js +0 -11
  111. package/dist/db/migrate.js.map +0 -1
  112. package/dist/db/migrations/pg/0000_initial.sql +0 -74
  113. package/dist/db/migrations/pg/meta/_journal.json +0 -13
  114. package/dist/db/migrations/sqlite/0000_initial.sql +0 -74
  115. package/dist/db/migrations/sqlite/meta/_journal.json +0 -13
  116. package/dist/db/schema.d.ts +0 -1863
  117. package/dist/db/schema.d.ts.map +0 -1
  118. package/dist/db/schema.js +0 -133
  119. package/dist/db/schema.js.map +0 -1
  120. package/dist/db/toolDefinitionStore.d.ts +0 -6
  121. package/dist/db/toolDefinitionStore.d.ts.map +0 -1
  122. package/dist/db/toolDefinitionStore.js +0 -95
  123. package/dist/db/toolDefinitionStore.js.map +0 -1
  124. package/dist/errors/httpError.d.ts +0 -6
  125. package/dist/errors/httpError.d.ts.map +0 -1
  126. package/dist/errors/httpError.js +0 -11
  127. package/dist/errors/httpError.js.map +0 -1
  128. package/dist/index.d.ts +0 -32
  129. package/dist/index.d.ts.map +0 -1
  130. package/dist/index.js +0 -32
  131. package/dist/index.js.map +0 -1
  132. package/dist/integrations/actionsFactory.d.ts +0 -16
  133. package/dist/integrations/actionsFactory.d.ts.map +0 -1
  134. package/dist/integrations/actionsFactory.js +0 -98
  135. package/dist/integrations/actionsFactory.js.map +0 -1
  136. package/dist/integrations/catalog.d.ts +0 -8
  137. package/dist/integrations/catalog.d.ts.map +0 -1
  138. package/dist/integrations/catalog.js +0 -45
  139. package/dist/integrations/catalog.js.map +0 -1
  140. package/dist/integrations/customToolFactory.d.ts +0 -13
  141. package/dist/integrations/customToolFactory.d.ts.map +0 -1
  142. package/dist/integrations/customToolFactory.js +0 -31
  143. package/dist/integrations/customToolFactory.js.map +0 -1
  144. package/dist/integrations/dataLoader.d.ts +0 -3
  145. package/dist/integrations/dataLoader.d.ts.map +0 -1
  146. package/dist/integrations/dataLoader.js +0 -2
  147. package/dist/integrations/dataLoader.js.map +0 -1
  148. package/dist/integrations/fileIntegrationTypeConfigStore.d.ts +0 -7
  149. package/dist/integrations/fileIntegrationTypeConfigStore.d.ts.map +0 -1
  150. package/dist/integrations/fileIntegrationTypeConfigStore.js +0 -34
  151. package/dist/integrations/fileIntegrationTypeConfigStore.js.map +0 -1
  152. package/dist/integrations/getIntegration.d.ts +0 -14
  153. package/dist/integrations/getIntegration.d.ts.map +0 -1
  154. package/dist/integrations/getIntegration.js +0 -30
  155. package/dist/integrations/getIntegration.js.map +0 -1
  156. package/dist/integrations/googleServiceAccount.d.ts +0 -6
  157. package/dist/integrations/googleServiceAccount.d.ts.map +0 -1
  158. package/dist/integrations/googleServiceAccount.js +0 -54
  159. package/dist/integrations/googleServiceAccount.js.map +0 -1
  160. package/dist/integrations/health.d.ts +0 -20
  161. package/dist/integrations/health.d.ts.map +0 -1
  162. package/dist/integrations/health.js +0 -43
  163. package/dist/integrations/health.js.map +0 -1
  164. package/dist/integrations/integrationTypeConfigLookup.d.ts +0 -12
  165. package/dist/integrations/integrationTypeConfigLookup.d.ts.map +0 -1
  166. package/dist/integrations/integrationTypeConfigLookup.js +0 -11
  167. package/dist/integrations/integrationTypeConfigLookup.js.map +0 -1
  168. package/dist/integrations/providerRegistry.d.ts +0 -2
  169. package/dist/integrations/providerRegistry.d.ts.map +0 -1
  170. package/dist/integrations/providerRegistry.js +0 -72
  171. package/dist/integrations/providerRegistry.js.map +0 -1
  172. package/dist/integrations/proxy.d.ts +0 -19
  173. package/dist/integrations/proxy.d.ts.map +0 -1
  174. package/dist/integrations/proxy.js +0 -377
  175. package/dist/integrations/proxy.js.map +0 -1
  176. package/dist/integrations/sandbox.d.ts +0 -8
  177. package/dist/integrations/sandbox.d.ts.map +0 -1
  178. package/dist/integrations/sandbox.js +0 -221
  179. package/dist/integrations/sandbox.js.map +0 -1
  180. package/dist/integrations/sandboxUtils.d.ts +0 -15
  181. package/dist/integrations/sandboxUtils.d.ts.map +0 -1
  182. package/dist/integrations/sandboxUtils.js +0 -489
  183. package/dist/integrations/sandboxUtils.js.map +0 -1
  184. package/dist/integrations/tools.d.ts +0 -3
  185. package/dist/integrations/tools.d.ts.map +0 -1
  186. package/dist/integrations/tools.js +0 -70
  187. package/dist/integrations/tools.js.map +0 -1
  188. package/dist/mcp/abilityCatalog.d.ts +0 -46
  189. package/dist/mcp/abilityCatalog.d.ts.map +0 -1
  190. package/dist/mcp/abilityCatalog.js +0 -275
  191. package/dist/mcp/abilityCatalog.js.map +0 -1
  192. package/dist/mcp/auth.d.ts +0 -18
  193. package/dist/mcp/auth.d.ts.map +0 -1
  194. package/dist/mcp/auth.js +0 -45
  195. package/dist/mcp/auth.js.map +0 -1
  196. package/dist/mcp/builder_guide.md +0 -441
  197. package/dist/mcp/commandable_readme.md +0 -29
  198. package/dist/mcp/handlers.d.ts +0 -21
  199. package/dist/mcp/handlers.d.ts.map +0 -1
  200. package/dist/mcp/handlers.js +0 -86
  201. package/dist/mcp/handlers.js.map +0 -1
  202. package/dist/mcp/metaTools.d.ts +0 -77
  203. package/dist/mcp/metaTools.d.ts.map +0 -1
  204. package/dist/mcp/metaTools.js +0 -753
  205. package/dist/mcp/metaTools.js.map +0 -1
  206. package/dist/mcp/server.d.ts +0 -25
  207. package/dist/mcp/server.d.ts.map +0 -1
  208. package/dist/mcp/server.js +0 -14
  209. package/dist/mcp/server.js.map +0 -1
  210. package/dist/mcp/sessionState.d.ts +0 -18
  211. package/dist/mcp/sessionState.d.ts.map +0 -1
  212. package/dist/mcp/sessionState.js +0 -65
  213. package/dist/mcp/sessionState.js.map +0 -1
  214. package/dist/mcp/toolAdapter.d.ts +0 -34
  215. package/dist/mcp/toolAdapter.d.ts.map +0 -1
  216. package/dist/mcp/toolAdapter.js +0 -24
  217. package/dist/mcp/toolAdapter.js.map +0 -1
  218. package/dist/types.d.ts +0 -92
  219. package/dist/types.d.ts.map +0 -1
  220. package/dist/types.js +0 -2
  221. package/dist/types.js.map +0 -1
  222. package/dist/version.d.ts +0 -2
  223. package/dist/version.d.ts.map +0 -1
  224. package/dist/version.js +0 -7
  225. package/dist/version.js.map +0 -1
  226. /package/{dist/app → .output}/public/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2 +0 -0
  227. /package/{dist/app → .output}/public/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2 +0 -0
  228. /package/{dist/app → .output}/public/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2 +0 -0
  229. /package/{dist/app → .output}/public/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2 +0 -0
  230. /package/{dist/app → .output}/public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2 +0 -0
  231. /package/{dist/app → .output}/public/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2 +0 -0
  232. /package/{dist/app → .output}/public/_nuxt/_id_.BKAjWkoP.css +0 -0
  233. /package/{dist/app → .output}/public/_nuxt/entry.Y3mA4bzA.css +0 -0
  234. /package/{dist/app → .output}/public/_nuxt/error-404.C7fg894-.css +0 -0
  235. /package/{dist/app → .output}/public/_nuxt/error-500.DjUK_N2Y.css +0 -0
  236. /package/{dist/app → .output}/public/favicon.ico +0 -0
  237. /package/{dist/app → .output}/server/chunks/_/error-500.mjs +0 -0
  238. /package/{dist/app → .output}/server/chunks/_/error-500.mjs.map +0 -0
  239. /package/{dist/app → .output}/server/chunks/_/icons.mjs +0 -0
  240. /package/{dist/app → .output}/server/chunks/_/icons.mjs.map +0 -0
  241. /package/{dist/app → .output}/server/chunks/_/icons2.mjs +0 -0
  242. /package/{dist/app → .output}/server/chunks/_/icons2.mjs.map +0 -0
  243. /package/{dist/app → .output}/server/chunks/build/IntegrationCredentials-styles.CULcCK6_.mjs +0 -0
  244. /package/{dist/app → .output}/server/chunks/build/IntegrationCredentials-styles.CULcCK6_.mjs.map +0 -0
  245. /package/{dist/app → .output}/server/chunks/build/client.precomputed.mjs.map +0 -0
  246. /package/{dist/app → .output}/server/chunks/build/error-404-D2QibUBT.mjs +0 -0
  247. /package/{dist/app → .output}/server/chunks/build/error-404-D2QibUBT.mjs.map +0 -0
  248. /package/{dist/app → .output}/server/chunks/build/error-404-styles.Bvxdxqjk.mjs +0 -0
  249. /package/{dist/app → .output}/server/chunks/build/error-404-styles.Bvxdxqjk.mjs.map +0 -0
  250. /package/{dist/app → .output}/server/chunks/build/error-500-DYvawybF.mjs +0 -0
  251. /package/{dist/app → .output}/server/chunks/build/error-500-DYvawybF.mjs.map +0 -0
  252. /package/{dist/app → .output}/server/chunks/build/error-500-styles.BnYAAXSg.mjs +0 -0
  253. /package/{dist/app → .output}/server/chunks/build/error-500-styles.BnYAAXSg.mjs.map +0 -0
  254. /package/{dist/app → .output}/server/chunks/build/index-5H-nmhph.mjs +0 -0
  255. /package/{dist/app → .output}/server/chunks/build/index-5H-nmhph.mjs.map +0 -0
  256. /package/{dist/app → .output}/server/chunks/build/server.mjs.map +0 -0
  257. /package/{dist/app → .output}/server/chunks/build/styles.mjs +0 -0
  258. /package/{dist/app → .output}/server/chunks/build/styles.mjs.map +0 -0
  259. /package/{dist/app → .output}/server/chunks/routes/api/_commandable/status.get.mjs +0 -0
  260. /package/{dist/app → .output}/server/chunks/routes/api/_commandable/status.get.mjs.map +0 -0
  261. /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/tools.get.mjs +0 -0
  262. /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/tools.get.mjs.map +0 -0
  263. /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/toolsets.get.mjs +0 -0
  264. /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/toolsets.get.mjs.map +0 -0
  265. /package/{dist/app → .output}/server/chunks/routes/api/catalog.get.mjs +0 -0
  266. /package/{dist/app → .output}/server/chunks/routes/api/catalog.get.mjs.map +0 -0
  267. /package/{dist/app → .output}/server/chunks/routes/api/index.get.mjs.map +0 -0
  268. /package/{dist/app → .output}/server/chunks/routes/api/index.post.mjs.map +0 -0
  269. /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-config.get.mjs.map +0 -0
  270. /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-status.get.mjs.map +0 -0
  271. /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.delete.mjs.map +0 -0
  272. /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.post.mjs.map +0 -0
  273. /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/permissions.post.mjs.map +0 -0
  274. /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/toolsets.post.mjs.map +0 -0
  275. /package/{dist/app → .output}/server/chunks/routes/health.get.mjs +0 -0
  276. /package/{dist/app → .output}/server/chunks/routes/health.get.mjs.map +0 -0
  277. /package/{dist/app → .output}/server/chunks/routes/mcp/create.mjs.map +0 -0
  278. /package/{dist/app → .output}/server/chunks/routes/mcp.mjs.map +0 -0
  279. /package/{dist/app → .output}/server/chunks/routes/renderer.mjs.map +0 -0
  280. /package/{dist/app → .output}/server/chunks/virtual/_virtual_spa-template.mjs +0 -0
  281. /package/{dist/app → .output}/server/chunks/virtual/_virtual_spa-template.mjs.map +0 -0
  282. /package/{dist/app → .output}/server/index.mjs.map +0 -0
@@ -4428,7 +4428,7 @@ function _expandFromEnv(value) {
4428
4428
  const _inlineRuntimeConfig = {
4429
4429
  "app": {
4430
4430
  "baseURL": "/",
4431
- "buildId": "b13ec2b2-ddd3-4ead-abd4-4fba9dfc0061",
4431
+ "buildId": "ee5097c4-b785-4b77-92d6-c16a7396d677",
4432
4432
  "buildAssetsDir": "/_nuxt/",
4433
4433
  "cdnURL": ""
4434
4434
  },
@@ -6570,6 +6570,10 @@ function rowToIntegrationTypeConfig(r) {
6570
6570
  updatedAt: r.updatedAt instanceof Date ? r.updatedAt : r.updatedAt ? new Date(r.updatedAt) : void 0
6571
6571
  };
6572
6572
  }
6573
+ async function listIntegrationTypeConfigs(client, spaceId) {
6574
+ const rows = await db$2(client).select().from(t$2(client)).where(eq(t$2(client).spaceId, spaceId));
6575
+ return rows.map(rowToIntegrationTypeConfig);
6576
+ }
6573
6577
  async function getIntegrationTypeConfig(client, spaceId, typeSlug) {
6574
6578
  const table = t$2(client);
6575
6579
  const rows = await db$2(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.typeSlug, typeSlug))).limit(1);
@@ -6590,7 +6594,7 @@ async function upsertIntegrationTypeConfig(client, cfg) {
6590
6594
  createdAt: now,
6591
6595
  updatedAt: now
6592
6596
  }).onConflictDoUpdate({
6593
- target: table.id,
6597
+ target: [table.spaceId, table.typeSlug],
6594
6598
  set: {
6595
6599
  typeSlug: cfg.typeSlug,
6596
6600
  label: cfg.label,
@@ -6600,6 +6604,12 @@ async function upsertIntegrationTypeConfig(client, cfg) {
6600
6604
  }
6601
6605
  });
6602
6606
  }
6607
+ async function deleteIntegrationTypeConfig(client, spaceId, typeSlug) {
6608
+ var _a, _b;
6609
+ const table = t$2(client);
6610
+ const result = await db$2(client).delete(table).where(and(eq(table.spaceId, spaceId), eq(table.typeSlug, typeSlug)));
6611
+ return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
6612
+ }
6603
6613
 
6604
6614
  async function checkIntegrationHealth(params) {
6605
6615
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
@@ -6742,33 +6752,39 @@ function parseJson$1(raw) {
6742
6752
  }
6743
6753
  return raw;
6744
6754
  }
6755
+ function rowToIntegrationData(r) {
6756
+ var _a, _b, _c, _d, _e, _f, _g;
6757
+ const healthCheckedAt = r.healthCheckedAt ? r.healthCheckedAt instanceof Date ? r.healthCheckedAt : new Date(r.healthCheckedAt) : null;
6758
+ return {
6759
+ id: r.id,
6760
+ spaceId: (_a = r.spaceId) != null ? _a : void 0,
6761
+ type: r.type,
6762
+ referenceId: r.referenceId,
6763
+ label: r.label,
6764
+ enabled: r.enabled === 0 ? false : true,
6765
+ connectionMethod: (_b = r.connectionMethod) != null ? _b : void 0,
6766
+ connectionId: (_c = r.connectionId) != null ? _c : void 0,
6767
+ credentialId: (_d = r.credentialId) != null ? _d : void 0,
6768
+ credentialVariant: (_e = r.credentialVariant) != null ? _e : void 0,
6769
+ enabledToolsets: parseJson$1(r.enabledToolsets),
6770
+ maxScope: (_f = r.maxScope) != null ? _f : void 0,
6771
+ disabledTools: parseJson$1(r.disabledTools),
6772
+ healthStatus: (_g = r.healthStatus) != null ? _g : null,
6773
+ healthCheckedAt
6774
+ };
6775
+ }
6745
6776
  async function listIntegrations(client, spaceId) {
6746
6777
  const table = t$1(client);
6747
6778
  let query = db$1(client).select().from(table);
6748
6779
  if (spaceId)
6749
6780
  query = query.where(eq(table.spaceId, spaceId));
6750
6781
  const rows = await query;
6751
- return rows.map((r) => {
6752
- var _a, _b, _c, _d, _e, _f, _g;
6753
- const healthCheckedAt = r.healthCheckedAt ? r.healthCheckedAt instanceof Date ? r.healthCheckedAt : new Date(r.healthCheckedAt) : null;
6754
- return {
6755
- id: r.id,
6756
- spaceId: (_a = r.spaceId) != null ? _a : void 0,
6757
- type: r.type,
6758
- referenceId: r.referenceId,
6759
- label: r.label,
6760
- enabled: r.enabled === 0 ? false : true,
6761
- connectionMethod: (_b = r.connectionMethod) != null ? _b : void 0,
6762
- connectionId: (_c = r.connectionId) != null ? _c : void 0,
6763
- credentialId: (_d = r.credentialId) != null ? _d : void 0,
6764
- credentialVariant: (_e = r.credentialVariant) != null ? _e : void 0,
6765
- enabledToolsets: parseJson$1(r.enabledToolsets),
6766
- maxScope: (_f = r.maxScope) != null ? _f : void 0,
6767
- disabledTools: parseJson$1(r.disabledTools),
6768
- healthStatus: (_g = r.healthStatus) != null ? _g : null,
6769
- healthCheckedAt
6770
- };
6771
- });
6782
+ return rows.map(rowToIntegrationData);
6783
+ }
6784
+ async function getIntegrationById(client, id) {
6785
+ const table = t$1(client);
6786
+ const rows = await db$1(client).select().from(table).where(eq(table.id, id)).limit(1);
6787
+ return rows[0] ? rowToIntegrationData(rows[0]) : null;
6772
6788
  }
6773
6789
  async function upsertIntegration(client, integration) {
6774
6790
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
@@ -6808,6 +6824,12 @@ async function upsertIntegration(client, integration) {
6808
6824
  }
6809
6825
  });
6810
6826
  }
6827
+ async function deleteIntegrationById(client, id) {
6828
+ var _a, _b;
6829
+ const table = t$1(client);
6830
+ const result = await db$1(client).delete(table).where(eq(table.id, id));
6831
+ return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
6832
+ }
6811
6833
  async function updateIntegrationCredentials(client, integrationId, fields) {
6812
6834
  var _a, _b, _c;
6813
6835
  const table = t$1(client);
@@ -6822,6 +6844,108 @@ async function updateIntegrationHealth(client, integrationId, healthStatus, chec
6822
6844
  await db$1(client).update(table).set({ healthStatus, healthCheckedAt: checkedAt != null ? checkedAt : /* @__PURE__ */ new Date() }).where(and(eq(table.id, integrationId)));
6823
6845
  }
6824
6846
 
6847
+ function t(client) {
6848
+ return client.dialect === "sqlite" ? sqliteToolDefinitions : pgToolDefinitions;
6849
+ }
6850
+ function db(client) {
6851
+ return client.db;
6852
+ }
6853
+ function normalizeScope(raw) {
6854
+ const s = String(raw || "").toLowerCase().trim();
6855
+ if (s === "read" || s === "write" || s === "admin")
6856
+ return s;
6857
+ return "write";
6858
+ }
6859
+ function parseJson(raw) {
6860
+ if (raw == null)
6861
+ return null;
6862
+ if (typeof raw === "string") {
6863
+ try {
6864
+ return JSON.parse(raw);
6865
+ } catch {
6866
+ return null;
6867
+ }
6868
+ }
6869
+ return raw;
6870
+ }
6871
+ function rowToToolDefinition(r) {
6872
+ var _a;
6873
+ return {
6874
+ id: r.id,
6875
+ spaceId: r.spaceId,
6876
+ integrationId: r.integrationId,
6877
+ name: r.name,
6878
+ displayName: (_a = r.displayName) != null ? _a : null,
6879
+ description: r.description,
6880
+ scope: normalizeScope(r.scope),
6881
+ inputSchema: parseJson(r.inputSchemaJson) || { type: "object", additionalProperties: true },
6882
+ handlerCode: r.handlerCode,
6883
+ utils: parseJson(r.utilsJson),
6884
+ createdAt: r.createdAt instanceof Date ? r.createdAt : r.createdAt ? new Date(r.createdAt) : void 0,
6885
+ updatedAt: r.updatedAt instanceof Date ? r.updatedAt : r.updatedAt ? new Date(r.updatedAt) : void 0
6886
+ };
6887
+ }
6888
+ async function listToolDefinitions(client, spaceId) {
6889
+ const rows = await db(client).select().from(t(client)).where(eq(t(client).spaceId, spaceId));
6890
+ return rows.map(rowToToolDefinition);
6891
+ }
6892
+ async function listToolDefinitionsForIntegration(client, spaceId, integrationId) {
6893
+ const table = t(client);
6894
+ const rows = await db(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId)));
6895
+ return rows.map(rowToToolDefinition);
6896
+ }
6897
+ async function getToolDefinitionByName(client, spaceId, integrationId, name) {
6898
+ const table = t(client);
6899
+ const rows = await db(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId), eq(table.name, name))).limit(1);
6900
+ return rows[0] ? rowToToolDefinition(rows[0]) : null;
6901
+ }
6902
+ async function upsertToolDefinition(client, tool) {
6903
+ var _a, _b, _c, _d, _e;
6904
+ const table = t(client);
6905
+ const now = /* @__PURE__ */ new Date();
6906
+ const schemaValue = client.dialect === "sqlite" ? JSON.stringify((_a = tool.inputSchema) != null ? _a : {}) : (_b = tool.inputSchema) != null ? _b : {};
6907
+ const utilsValue = ((_c = tool.utils) == null ? void 0 : _c.length) ? client.dialect === "sqlite" ? JSON.stringify(tool.utils) : tool.utils : null;
6908
+ await db(client).insert(table).values({
6909
+ id: tool.id,
6910
+ spaceId: tool.spaceId,
6911
+ integrationId: tool.integrationId,
6912
+ name: tool.name,
6913
+ displayName: (_d = tool.displayName) != null ? _d : null,
6914
+ description: tool.description,
6915
+ scope: tool.scope,
6916
+ inputSchemaJson: schemaValue,
6917
+ handlerCode: tool.handlerCode,
6918
+ utilsJson: utilsValue,
6919
+ createdAt: now,
6920
+ updatedAt: now
6921
+ }).onConflictDoUpdate({
6922
+ target: [table.spaceId, table.integrationId, table.name],
6923
+ set: {
6924
+ integrationId: tool.integrationId,
6925
+ name: tool.name,
6926
+ displayName: (_e = tool.displayName) != null ? _e : null,
6927
+ description: tool.description,
6928
+ scope: tool.scope,
6929
+ inputSchemaJson: schemaValue,
6930
+ handlerCode: tool.handlerCode,
6931
+ utilsJson: utilsValue,
6932
+ updatedAt: now
6933
+ }
6934
+ });
6935
+ }
6936
+ async function deleteToolDefinitionByName(client, spaceId, integrationId, name) {
6937
+ var _a, _b;
6938
+ const table = t(client);
6939
+ const result = await db(client).delete(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId), eq(table.name, name)));
6940
+ return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
6941
+ }
6942
+ async function deleteToolDefinitionsForIntegration(client, spaceId, integrationId) {
6943
+ var _a, _b;
6944
+ const table = t(client);
6945
+ const result = await db(client).delete(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId)));
6946
+ return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
6947
+ }
6948
+
6825
6949
  function buildMcpToolIndex(params) {
6826
6950
  const toolsByIntegration = buildToolsByIntegration(params.spaceId, params.integrations, params.proxy, {
6827
6951
  integrationsRef: params.integrationsRef,
@@ -6862,8 +6986,10 @@ const BUILDER_ABILITY_ID = "commandable__builder";
6862
6986
  const BUILDER_TOOL_NAMES = [
6863
6987
  "commandable_list_prebuilt_integrations",
6864
6988
  "commandable_add_prebuilt_integration",
6865
- "commandable_create_custom_integration",
6866
- "commandable_create_custom_tool",
6989
+ "commandable_upsert_custom_integration",
6990
+ "commandable_upsert_custom_tool",
6991
+ "commandable_delete_custom_tool",
6992
+ "commandable_delete_custom_integration",
6867
6993
  "commandable_test_custom_tool"
6868
6994
  ];
6869
6995
  function makeAbilityId(integ, toolsetKey) {
@@ -6966,6 +7092,29 @@ class AbilityCatalog {
6966
7092
  this.byId.set(created.id, created);
6967
7093
  return created;
6968
7094
  }
7095
+ removeCustomTool(params) {
7096
+ const abilityId = makeAbilityId(params.integration, "custom");
7097
+ const existing = this.byId.get(abilityId);
7098
+ if (!existing)
7099
+ return false;
7100
+ const before = existing.toolNames.length;
7101
+ existing.toolNames = existing.toolNames.filter((name) => name !== params.toolName);
7102
+ if (!existing.toolNames.length) {
7103
+ this.byId.delete(abilityId);
7104
+ this.abilities = this.abilities.filter((a) => a.id !== abilityId);
7105
+ }
7106
+ return existing.toolNames.length !== before;
7107
+ }
7108
+ removeIntegrationAbilities(integration) {
7109
+ const suffix = `__n${shortNodeId(integration.id)}`;
7110
+ const removed = this.abilities.filter((a) => a.id.endsWith(suffix)).map((a) => a.id);
7111
+ if (!removed.length)
7112
+ return 0;
7113
+ for (const id of removed)
7114
+ this.byId.delete(id);
7115
+ this.abilities = this.abilities.filter((a) => !removed.includes(a.id));
7116
+ return removed.length;
7117
+ }
6969
7118
  getToolDefinitions(toolNames) {
6970
7119
  const out = [];
6971
7120
  for (const n of toolNames) {
@@ -7112,87 +7261,6 @@ class AbilityCatalog {
7112
7261
  }
7113
7262
  }
7114
7263
 
7115
- function t(client) {
7116
- return client.dialect === "sqlite" ? sqliteToolDefinitions : pgToolDefinitions;
7117
- }
7118
- function db(client) {
7119
- return client.db;
7120
- }
7121
- function normalizeScope(raw) {
7122
- const s = String(raw || "").toLowerCase().trim();
7123
- if (s === "read" || s === "write" || s === "admin")
7124
- return s;
7125
- return "write";
7126
- }
7127
- function parseJson(raw) {
7128
- if (raw == null)
7129
- return null;
7130
- if (typeof raw === "string") {
7131
- try {
7132
- return JSON.parse(raw);
7133
- } catch {
7134
- return null;
7135
- }
7136
- }
7137
- return raw;
7138
- }
7139
- function rowToToolDefinition(r) {
7140
- var _a;
7141
- return {
7142
- id: r.id,
7143
- spaceId: r.spaceId,
7144
- integrationId: r.integrationId,
7145
- name: r.name,
7146
- displayName: (_a = r.displayName) != null ? _a : null,
7147
- description: r.description,
7148
- scope: normalizeScope(r.scope),
7149
- inputSchema: parseJson(r.inputSchemaJson) || { type: "object", additionalProperties: true },
7150
- handlerCode: r.handlerCode,
7151
- utils: parseJson(r.utilsJson),
7152
- createdAt: r.createdAt instanceof Date ? r.createdAt : r.createdAt ? new Date(r.createdAt) : void 0,
7153
- updatedAt: r.updatedAt instanceof Date ? r.updatedAt : r.updatedAt ? new Date(r.updatedAt) : void 0
7154
- };
7155
- }
7156
- async function getToolDefinitionByName(client, spaceId, integrationId, name) {
7157
- const table = t(client);
7158
- const rows = await db(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId), eq(table.name, name))).limit(1);
7159
- return rows[0] ? rowToToolDefinition(rows[0]) : null;
7160
- }
7161
- async function upsertToolDefinition(client, tool) {
7162
- var _a, _b, _c, _d, _e;
7163
- const table = t(client);
7164
- const now = /* @__PURE__ */ new Date();
7165
- const schemaValue = client.dialect === "sqlite" ? JSON.stringify((_a = tool.inputSchema) != null ? _a : {}) : (_b = tool.inputSchema) != null ? _b : {};
7166
- const utilsValue = ((_c = tool.utils) == null ? void 0 : _c.length) ? client.dialect === "sqlite" ? JSON.stringify(tool.utils) : tool.utils : null;
7167
- await db(client).insert(table).values({
7168
- id: tool.id,
7169
- spaceId: tool.spaceId,
7170
- integrationId: tool.integrationId,
7171
- name: tool.name,
7172
- displayName: (_d = tool.displayName) != null ? _d : null,
7173
- description: tool.description,
7174
- scope: tool.scope,
7175
- inputSchemaJson: schemaValue,
7176
- handlerCode: tool.handlerCode,
7177
- utilsJson: utilsValue,
7178
- createdAt: now,
7179
- updatedAt: now
7180
- }).onConflictDoUpdate({
7181
- target: table.id,
7182
- set: {
7183
- integrationId: tool.integrationId,
7184
- name: tool.name,
7185
- displayName: (_e = tool.displayName) != null ? _e : null,
7186
- description: tool.description,
7187
- scope: tool.scope,
7188
- inputSchemaJson: schemaValue,
7189
- handlerCode: tool.handlerCode,
7190
- utilsJson: utilsValue,
7191
- updatedAt: now
7192
- }
7193
- });
7194
- }
7195
-
7196
7264
  function humanize(s) {
7197
7265
  return (s || "").replace(/_/g, " ").split(/\s+/g).filter(Boolean).map((w) => w.length ? `${w[0].toUpperCase()}${w.slice(1).toLowerCase()}` : w).join(" ");
7198
7266
  }
@@ -7227,8 +7295,10 @@ const META_TOOL_NAMES = {
7227
7295
  disableToolset: "commandable_disable_toolset",
7228
7296
  listPrebuiltIntegrations: "commandable_list_prebuilt_integrations",
7229
7297
  addPrebuiltIntegration: "commandable_add_prebuilt_integration",
7230
- createCustomIntegration: "commandable_create_custom_integration",
7231
- createCustomTool: "commandable_create_custom_tool",
7298
+ upsertCustomIntegration: "commandable_upsert_custom_integration",
7299
+ upsertCustomTool: "commandable_upsert_custom_tool",
7300
+ deleteCustomIntegration: "commandable_delete_custom_integration",
7301
+ deleteCustomTool: "commandable_delete_custom_tool",
7232
7302
  testCustomTool: "commandable_test_custom_tool"
7233
7303
  };
7234
7304
  function normalizeHintMarkdown(value) {
@@ -7306,7 +7376,7 @@ function getMetaToolDefinitions() {
7306
7376
  ];
7307
7377
  }
7308
7378
  async function handleMetaToolCall(params) {
7309
- var _a, _b, _c, _d, _e;
7379
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
7310
7380
  const { name, args, sessionId, catalog, sessionState, ctx } = params;
7311
7381
  if (name === META_TOOL_NAMES.readme) {
7312
7382
  return { handled: true, listChanged: false, result: { markdown: buildCommandableReadme() } };
@@ -7554,14 +7624,15 @@ ${lines ? `${lines}
7554
7624
  }
7555
7625
  };
7556
7626
  }
7557
- if (name === META_TOOL_NAMES.createCustomIntegration) {
7558
- requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.createCustomIntegration);
7627
+ if (name === META_TOOL_NAMES.upsertCustomIntegration) {
7628
+ requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.upsertCustomIntegration);
7559
7629
  if (!ctx)
7560
7630
  throw new Error("Integration management is not available in this server mode.");
7561
7631
  if (!ctx.integrationsRef)
7562
7632
  throw new Error("integrationsRef is required for builder mode.");
7563
7633
  if (!ctx.integrationTypeConfigsRef)
7564
7634
  throw new Error("integrationTypeConfigsRef is required for custom integrations.");
7635
+ const typeSlugInput = typeof (args == null ? void 0 : args.type_slug) === "string" ? args.type_slug.trim() : "";
7565
7636
  const label = String((args == null ? void 0 : args.label) || "").trim();
7566
7637
  const baseUrl = String((args == null ? void 0 : args.base_url) || "").trim();
7567
7638
  const authType = (args == null ? void 0 : args.auth_type) === "basic" || (args == null ? void 0 : args.auth_type) === "custom" ? String(args.auth_type) : null;
@@ -7606,16 +7677,21 @@ ${lines ? `${lines}
7606
7677
  const toKebab = (s) => (s || "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32) || "integration";
7607
7678
  const suffix = () => crypto.randomBytes(2).toString("hex");
7608
7679
  const existingSlugs = new Set(ctx.integrationTypeConfigsRef.current.filter((c) => c.spaceId === ctx.spaceId).map((c) => c.typeSlug));
7609
- let typeSlug = "";
7610
- for (let i = 0; i < 20; i++) {
7611
- const candidate = `${toKebab(label)}-${suffix()}`;
7612
- if (!existingSlugs.has(candidate)) {
7613
- typeSlug = candidate;
7614
- break;
7680
+ let typeSlug = typeSlugInput;
7681
+ if (!typeSlug) {
7682
+ for (let i = 0; i < 20; i++) {
7683
+ const candidate = `${toKebab(label)}-${suffix()}`;
7684
+ if (!existingSlugs.has(candidate)) {
7685
+ typeSlug = candidate;
7686
+ break;
7687
+ }
7615
7688
  }
7689
+ if (!typeSlug)
7690
+ throw new Error("Failed to generate a unique type slug");
7616
7691
  }
7617
- if (!typeSlug)
7618
- throw new Error("Failed to generate a unique type slug");
7692
+ const existingCfg = typeSlugInput ? await getIntegrationTypeConfig(ctx.db, ctx.spaceId, typeSlugInput) : null;
7693
+ if (typeSlugInput && !existingCfg)
7694
+ throw new Error(`Unknown type_slug: ${typeSlugInput}`);
7619
7695
  const schemaProps = {};
7620
7696
  const required = [];
7621
7697
  for (const f of credentialFields) {
@@ -7642,7 +7718,7 @@ ${lines ? `${lines}
7642
7718
  additionalProperties: false
7643
7719
  });
7644
7720
  const id = crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex");
7645
- const cfgId = crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex");
7721
+ const cfgId = (existingCfg == null ? void 0 : existingCfg.id) || (crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex"));
7646
7722
  const defaultVariantConfig = {
7647
7723
  label,
7648
7724
  credentialSchema,
@@ -7660,10 +7736,21 @@ ${lines ? `${lines}
7660
7736
  variants: { default: defaultVariantConfig }
7661
7737
  };
7662
7738
  await upsertIntegrationTypeConfig(ctx.db, customCfg);
7663
- ctx.integrationTypeConfigsRef.current.push(customCfg);
7739
+ const cfgIndex = ctx.integrationTypeConfigsRef.current.findIndex((c) => c.spaceId === ctx.spaceId && c.typeSlug === typeSlug);
7740
+ if (cfgIndex >= 0)
7741
+ ctx.integrationTypeConfigsRef.current[cfgIndex] = customCfg;
7742
+ else
7743
+ ctx.integrationTypeConfigsRef.current.push(customCfg);
7744
+ const existingIntegration = ctx.integrationsRef.current.find((i) => i.type === typeSlug);
7745
+ const created = !existingIntegration;
7664
7746
  const shortId = id.replace(/[^a-z0-9]/gi, "").slice(0, 8).toLowerCase();
7665
- const referenceId = `${typeSlug}-${shortId}`;
7666
- const integration = {
7747
+ const referenceId = (existingIntegration == null ? void 0 : existingIntegration.referenceId) || `${typeSlug}-${shortId}`;
7748
+ const integration = existingIntegration ? {
7749
+ ...existingIntegration,
7750
+ spaceId: ctx.spaceId,
7751
+ type: typeSlug,
7752
+ label
7753
+ } : {
7667
7754
  spaceId: ctx.spaceId,
7668
7755
  id,
7669
7756
  type: typeSlug,
@@ -7680,22 +7767,23 @@ ${lines ? `${lines}
7680
7767
  }
7681
7768
  const base = ctx.credentialSetupBaseUrl ? ctx.credentialSetupBaseUrl.replace(/\/+$/, "") : null;
7682
7769
  const managementUrl = base ? `${base}/integrations` : null;
7683
- const credentialUrl = base ? `${base}/integrations/${encodeURIComponent(id)}` : null;
7770
+ const credentialUrl = base ? `${base}/integrations/${encodeURIComponent(integration.id)}` : null;
7684
7771
  return {
7685
7772
  handled: true,
7686
7773
  listChanged: false,
7687
7774
  result: {
7688
- created: true,
7689
7775
  integration: {
7690
- id,
7776
+ id: integration.id,
7691
7777
  type: typeSlug,
7692
7778
  label,
7693
- reference_id: referenceId,
7779
+ reference_id: integration.referenceId,
7694
7780
  auth_type: authType
7695
7781
  },
7782
+ upserted: true,
7783
+ created,
7696
7784
  management_url: managementUrl,
7697
7785
  credential_url: credentialUrl,
7698
- next_steps: credentialUrl ? ["Open credential_url to enter credentials, then create tools with commandable_create_custom_tool."] : ["Start the management UI (create mode) to get a credential URL, then create tools with commandable_create_custom_tool."]
7786
+ next_steps: credentialUrl ? ["Open credential_url to enter credentials, then create tools with commandable_upsert_custom_tool."] : ["Start the management UI (create mode) to get a credential URL, then create tools with commandable_upsert_custom_tool."]
7699
7787
  }
7700
7788
  };
7701
7789
  }
@@ -7724,8 +7812,8 @@ ${lines ? `${lines}
7724
7812
  const res = await safe(testInput);
7725
7813
  return { handled: true, listChanged: false, result: res };
7726
7814
  }
7727
- if (name === META_TOOL_NAMES.createCustomTool) {
7728
- requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.createCustomTool);
7815
+ if (name === META_TOOL_NAMES.upsertCustomTool) {
7816
+ requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.upsertCustomTool);
7729
7817
  if (!ctx)
7730
7818
  throw new Error("Tool building is not available in this server mode.");
7731
7819
  const integrationId = String((args == null ? void 0 : args.integration_id) || "").trim();
@@ -7750,6 +7838,7 @@ ${lines ? `${lines}
7750
7838
  if (!integration)
7751
7839
  throw new Error(`Unknown integration_id: ${integrationId}`);
7752
7840
  const existing = await getToolDefinitionByName(ctx.db, ctx.spaceId, integration.id, toolNameRaw);
7841
+ const created = !existing;
7753
7842
  const id = (existing == null ? void 0 : existing.id) || (crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex"));
7754
7843
  const inputSchema = sanitizeJsonSchema(inputSchemaObj);
7755
7844
  await upsertToolDefinition(ctx.db, {
@@ -7801,7 +7890,8 @@ ${lines ? `${lines}
7801
7890
  handled: true,
7802
7891
  listChanged: true,
7803
7892
  result: {
7804
- added: true,
7893
+ upserted: true,
7894
+ created,
7805
7895
  tool: {
7806
7896
  id,
7807
7897
  name: executable.name,
@@ -7815,6 +7905,101 @@ ${lines ? `${lines}
7815
7905
  }
7816
7906
  };
7817
7907
  }
7908
+ if (name === META_TOOL_NAMES.deleteCustomTool) {
7909
+ requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.deleteCustomTool);
7910
+ if (!ctx)
7911
+ throw new Error("Tool building is not available in this server mode.");
7912
+ const integrationId = String((args == null ? void 0 : args.integration_id) || "").trim();
7913
+ const toolNameRaw = String((args == null ? void 0 : args.name) || "").trim();
7914
+ if (!integrationId)
7915
+ throw new Error("integration_id is required");
7916
+ if (!toolNameRaw)
7917
+ throw new Error("name is required");
7918
+ const integration = (_g = (_f = ctx.integrationsRef) == null ? void 0 : _f.current) == null ? void 0 : _g.find((i) => i.id === integrationId || i.referenceId === integrationId);
7919
+ if (!integration)
7920
+ throw new Error(`Unknown integration_id: ${integrationId}`);
7921
+ const existing = await getToolDefinitionByName(ctx.db, ctx.spaceId, integration.id, toolNameRaw);
7922
+ if (!existing) {
7923
+ return {
7924
+ handled: true,
7925
+ listChanged: false,
7926
+ result: { deleted: false, reason: "not_found" }
7927
+ };
7928
+ }
7929
+ const executable = buildExecutableToolFromDefinition({
7930
+ spaceId: ctx.spaceId,
7931
+ integration,
7932
+ tool: existing,
7933
+ proxy: ctx.proxy,
7934
+ integrationsRef: ctx.integrationsRef
7935
+ });
7936
+ await deleteToolDefinitionByName(ctx.db, ctx.spaceId, integration.id, toolNameRaw);
7937
+ if (ctx.toolIndexRef) {
7938
+ ctx.toolIndexRef.byName.delete(executable.name);
7939
+ if (ctx.toolIndexRef.list)
7940
+ ctx.toolIndexRef.list = ctx.toolIndexRef.list.filter((t) => t.name !== executable.name);
7941
+ }
7942
+ if (ctx.catalogRef)
7943
+ ctx.catalogRef.current.removeCustomTool({ integration, toolName: executable.name });
7944
+ sessionState.removeToolFromAllSessions(executable.name);
7945
+ return {
7946
+ handled: true,
7947
+ listChanged: true,
7948
+ result: {
7949
+ deleted: true,
7950
+ tool: {
7951
+ raw_name: toolNameRaw,
7952
+ name: executable.name
7953
+ }
7954
+ }
7955
+ };
7956
+ }
7957
+ if (name === META_TOOL_NAMES.deleteCustomIntegration) {
7958
+ requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.deleteCustomIntegration);
7959
+ if (!ctx)
7960
+ throw new Error("Integration management is not available in this server mode.");
7961
+ if (!ctx.integrationsRef)
7962
+ throw new Error("integrationsRef is required for builder mode.");
7963
+ if (!ctx.integrationTypeConfigsRef)
7964
+ throw new Error("integrationTypeConfigsRef is required for custom integrations.");
7965
+ const integrationId = String((args == null ? void 0 : args.integration_id) || "").trim();
7966
+ if (!integrationId)
7967
+ throw new Error("integration_id is required");
7968
+ const integration = ctx.integrationsRef.current.find((i) => i.id === integrationId || i.referenceId === integrationId);
7969
+ if (!integration)
7970
+ throw new Error(`Unknown integration_id: ${integrationId}`);
7971
+ const materializedToolNames = [...((_h = ctx.toolIndexRef) == null ? void 0 : _h.byName.keys()) || []].filter((toolName) => toolName.endsWith(`__n${integration.id.replace(/[^a-z0-9]/gi, "").slice(0, 8).toLowerCase()}`));
7972
+ for (const toolName of materializedToolNames) {
7973
+ (_i = ctx.toolIndexRef) == null ? void 0 : _i.byName.delete(toolName);
7974
+ sessionState.removeToolFromAllSessions(toolName);
7975
+ }
7976
+ if ((_j = ctx.toolIndexRef) == null ? void 0 : _j.list)
7977
+ ctx.toolIndexRef.list = ctx.toolIndexRef.list.filter((t) => !materializedToolNames.includes(t.name));
7978
+ await deleteToolDefinitionsForIntegration(ctx.db, ctx.spaceId, integration.id);
7979
+ if (integration.connectionMethod === "credentials" && integration.credentialId)
7980
+ await ctx.credentialStore.deleteCredentials(ctx.spaceId, integration.credentialId);
7981
+ await deleteIntegrationById(ctx.db, integration.id);
7982
+ const remainingIntegrations = await listIntegrations(ctx.db, ctx.spaceId);
7983
+ ctx.integrationsRef.current = remainingIntegrations;
7984
+ if (!remainingIntegrations.some((i) => i.type === integration.type)) {
7985
+ await deleteIntegrationTypeConfig(ctx.db, ctx.spaceId, integration.type);
7986
+ ctx.integrationTypeConfigsRef.current = ctx.integrationTypeConfigsRef.current.filter((cfg) => !(cfg.spaceId === ctx.spaceId && cfg.typeSlug === integration.type));
7987
+ }
7988
+ if (ctx.catalogRef)
7989
+ ctx.catalogRef.current.removeIntegrationAbilities(integration);
7990
+ return {
7991
+ handled: true,
7992
+ listChanged: materializedToolNames.length > 0,
7993
+ result: {
7994
+ deleted: true,
7995
+ integration: {
7996
+ id: integration.id,
7997
+ type: integration.type,
7998
+ label: integration.label
7999
+ }
8000
+ }
8001
+ };
8002
+ }
7818
8003
  return { handled: false };
7819
8004
  }
7820
8005
 
@@ -7969,6 +8154,20 @@ const _SessionAbilityState = class _SessionAbilityState {
7969
8154
  isToolActive(sessionId, toolName) {
7970
8155
  return this.getOrCreate(sessionId).activeToolNames.has(toolName);
7971
8156
  }
8157
+ removeToolFromAllSessions(toolName) {
8158
+ for (const st of this.sessions.values()) {
8159
+ if (!st.activeToolNames.has(toolName))
8160
+ continue;
8161
+ st.activeToolNames.delete(toolName);
8162
+ for (const [abilityId, names] of st.loadedAbilities.entries()) {
8163
+ const next = names.filter((n) => n !== toolName);
8164
+ if (next.length)
8165
+ st.loadedAbilities.set(abilityId, next);
8166
+ else
8167
+ st.loadedAbilities.delete(abilityId);
8168
+ }
8169
+ }
8170
+ }
7972
8171
  cleanup(sessionId) {
7973
8172
  const k = this.key(sessionId);
7974
8173
  this.sessions.delete(k);
@@ -8260,142 +8459,142 @@ const assets = {
8260
8459
  "/favicon.ico": {
8261
8460
  "type": "image/vnd.microsoft.icon",
8262
8461
  "etag": "\"10be-n8egyE9tcb7sKGr/pYCaQ4uWqxI\"",
8263
- "mtime": "2026-03-08T08:18:08.219Z",
8462
+ "mtime": "2026-03-08T16:28:20.554Z",
8264
8463
  "size": 4286,
8265
8464
  "path": "../public/favicon.ico"
8266
8465
  },
8267
8466
  "/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2": {
8268
8467
  "type": "font/woff2",
8269
8468
  "etag": "\"4b5c-TAo9mx7r3xQs52+HbHcHJ52z8Qo\"",
8270
- "mtime": "2026-03-08T08:18:08.211Z",
8469
+ "mtime": "2026-03-08T16:28:20.549Z",
8271
8470
  "size": 19292,
8272
8471
  "path": "../public/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2"
8273
8472
  },
8274
8473
  "/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2": {
8275
8474
  "type": "font/woff2",
8276
8475
  "etag": "\"212c-FshXJibFzNhd2HEIMP8C3JR5PYg\"",
8277
- "mtime": "2026-03-08T08:18:08.211Z",
8476
+ "mtime": "2026-03-08T16:28:20.549Z",
8278
8477
  "size": 8492,
8279
8478
  "path": "../public/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2"
8280
8479
  },
8281
8480
  "/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2": {
8282
8481
  "type": "font/woff2",
8283
8482
  "etag": "\"680c-mJtsV33lkTAKSmfq5k3lKHSllcU\"",
8284
- "mtime": "2026-03-08T08:18:08.211Z",
8483
+ "mtime": "2026-03-08T16:28:20.549Z",
8285
8484
  "size": 26636,
8286
8485
  "path": "../public/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2"
8287
8486
  },
8288
- "/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2": {
8289
- "type": "font/woff2",
8290
- "etag": "\"1d98-cDZfMibtk4T04FTTAmlfhWDpkN0\"",
8291
- "mtime": "2026-03-08T08:18:08.211Z",
8292
- "size": 7576,
8293
- "path": "../public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2"
8294
- },
8295
8487
  "/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2": {
8296
8488
  "type": "font/woff2",
8297
8489
  "etag": "\"6ec4-8OoFFPZKF1grqmfGVjh5JDE6DOU\"",
8298
- "mtime": "2026-03-08T08:18:08.211Z",
8490
+ "mtime": "2026-03-08T16:28:20.549Z",
8299
8491
  "size": 28356,
8300
8492
  "path": "../public/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2"
8301
8493
  },
8494
+ "/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2": {
8495
+ "type": "font/woff2",
8496
+ "etag": "\"1d98-cDZfMibtk4T04FTTAmlfhWDpkN0\"",
8497
+ "mtime": "2026-03-08T16:28:20.550Z",
8498
+ "size": 7576,
8499
+ "path": "../public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2"
8500
+ },
8302
8501
  "/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2": {
8303
8502
  "type": "font/woff2",
8304
8503
  "etag": "\"47c4-5xyngHnzzhetUee74tMx9OTgqNQ\"",
8305
- "mtime": "2026-03-08T08:18:08.211Z",
8504
+ "mtime": "2026-03-08T16:28:20.550Z",
8306
8505
  "size": 18372,
8307
8506
  "path": "../public/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2"
8308
8507
  },
8309
- "/_nuxt/BdctKXor.js": {
8508
+ "/_nuxt/B2dAlp_u.js": {
8310
8509
  "type": "text/javascript; charset=utf-8",
8311
- "etag": "\"ab-p9GRhgVlsrHGj44seRXAUpGFtMM\"",
8312
- "mtime": "2026-03-08T08:18:08.217Z",
8313
- "size": 171,
8314
- "path": "../public/_nuxt/BdctKXor.js"
8510
+ "etag": "\"eba0-wf6kssOw4eNs97QyNojAg32DloY\"",
8511
+ "mtime": "2026-03-08T16:28:20.552Z",
8512
+ "size": 60320,
8513
+ "path": "../public/_nuxt/B2dAlp_u.js"
8315
8514
  },
8316
- "/_nuxt/BlP7Uu-5.js": {
8515
+ "/_nuxt/BvFUCPqA.js": {
8317
8516
  "type": "text/javascript; charset=utf-8",
8318
- "etag": "\"e99-50WoDVJj60/zXoeeZ8CnpzDnQOs\"",
8319
- "mtime": "2026-03-08T08:18:08.217Z",
8320
- "size": 3737,
8321
- "path": "../public/_nuxt/BlP7Uu-5.js"
8517
+ "etag": "\"1def-GjWsOK4crVgdvsvob4q4AcQU3eE\"",
8518
+ "mtime": "2026-03-08T16:28:20.552Z",
8519
+ "size": 7663,
8520
+ "path": "../public/_nuxt/BvFUCPqA.js"
8322
8521
  },
8323
- "/_nuxt/CsbkV5Bd.js": {
8522
+ "/_nuxt/Dm_hd4at.js": {
8324
8523
  "type": "text/javascript; charset=utf-8",
8325
- "etag": "\"d7b-Fwv19+xzEDgBFVyj6cRw7Mwc0O4\"",
8326
- "mtime": "2026-03-08T08:18:08.217Z",
8327
- "size": 3451,
8328
- "path": "../public/_nuxt/CsbkV5Bd.js"
8524
+ "etag": "\"ab-krq+bSQAVNARAnmcr6pb3p09JGM\"",
8525
+ "mtime": "2026-03-08T16:28:20.552Z",
8526
+ "size": 171,
8527
+ "path": "../public/_nuxt/Dm_hd4at.js"
8329
8528
  },
8330
- "/_nuxt/DU1mG77A.js": {
8529
+ "/_nuxt/S2P9sd4n.js": {
8331
8530
  "type": "text/javascript; charset=utf-8",
8332
- "etag": "\"1dc9-kaQLF5RZtp8tbUvdUgC5gjaR7wg\"",
8333
- "mtime": "2026-03-08T08:18:08.217Z",
8334
- "size": 7625,
8335
- "path": "../public/_nuxt/DU1mG77A.js"
8531
+ "etag": "\"e99-6ab7sqCWIEbGMF8iRCoX06GCU6M\"",
8532
+ "mtime": "2026-03-08T16:28:20.552Z",
8533
+ "size": 3737,
8534
+ "path": "../public/_nuxt/S2P9sd4n.js"
8336
8535
  },
8337
8536
  "/_nuxt/_id_.BKAjWkoP.css": {
8338
8537
  "type": "text/css; charset=utf-8",
8339
8538
  "etag": "\"2f4-WvSreXC5yG1/cIV/f4qFH6C3ROw\"",
8340
- "mtime": "2026-03-08T08:18:08.217Z",
8539
+ "mtime": "2026-03-08T16:28:20.553Z",
8341
8540
  "size": 756,
8342
8541
  "path": "../public/_nuxt/_id_.BKAjWkoP.css"
8343
8542
  },
8344
- "/_nuxt/D-43HurL.js": {
8543
+ "/_nuxt/Ba0BY0O0.js": {
8345
8544
  "type": "text/javascript; charset=utf-8",
8346
- "etag": "\"eb8a-//0+Qznm0MWCbNwr0UCp3hqXfPA\"",
8347
- "mtime": "2026-03-08T08:18:08.217Z",
8348
- "size": 60298,
8349
- "path": "../public/_nuxt/D-43HurL.js"
8545
+ "etag": "\"19215-vDS/v7twXUEHmC7Vwb8hpHtOY10\"",
8546
+ "mtime": "2026-03-08T16:28:20.552Z",
8547
+ "size": 102933,
8548
+ "path": "../public/_nuxt/Ba0BY0O0.js"
8350
8549
  },
8351
- "/_nuxt/-tOYwuj2.js": {
8550
+ "/_nuxt/d2XTSFt9.js": {
8352
8551
  "type": "text/javascript; charset=utf-8",
8353
- "etag": "\"66cba-B7FNXfL/zyN/RTZNdELnFU+fJfQ\"",
8354
- "mtime": "2026-03-08T08:18:08.217Z",
8355
- "size": 421050,
8356
- "path": "../public/_nuxt/-tOYwuj2.js"
8357
- },
8358
- "/_nuxt/entry.Y3mA4bzA.css": {
8359
- "type": "text/css; charset=utf-8",
8360
- "etag": "\"2d46b-zfrD3Ny9WW6qm4fCXAfX5eIAxPA\"",
8361
- "mtime": "2026-03-08T08:18:08.217Z",
8362
- "size": 185451,
8363
- "path": "../public/_nuxt/entry.Y3mA4bzA.css"
8552
+ "etag": "\"d7b-8ryX9kOW13aLMnbzFyfd6FPpcQQ\"",
8553
+ "mtime": "2026-03-08T16:28:20.553Z",
8554
+ "size": 3451,
8555
+ "path": "../public/_nuxt/d2XTSFt9.js"
8364
8556
  },
8365
8557
  "/_nuxt/error-404.C7fg894-.css": {
8366
8558
  "type": "text/css; charset=utf-8",
8367
8559
  "etag": "\"97e-fiQ3o7A11L9BuXRBr0GJldkx0AU\"",
8368
- "mtime": "2026-03-08T08:18:08.217Z",
8560
+ "mtime": "2026-03-08T16:28:20.553Z",
8369
8561
  "size": 2430,
8370
8562
  "path": "../public/_nuxt/error-404.C7fg894-.css"
8371
8563
  },
8372
- "/_nuxt/uS7FY2am.js": {
8373
- "type": "text/javascript; charset=utf-8",
8374
- "etag": "\"18eea-xM8Um3EWhi5vmG4NU1j7c3jh5dc\"",
8375
- "mtime": "2026-03-08T08:18:08.217Z",
8376
- "size": 102122,
8377
- "path": "../public/_nuxt/uS7FY2am.js"
8564
+ "/_nuxt/error-500.DjUK_N2Y.css": {
8565
+ "type": "text/css; charset=utf-8",
8566
+ "etag": "\"773-Qf61bSDos4KtmZDaA06FmZyUYNo\"",
8567
+ "mtime": "2026-03-08T16:28:20.553Z",
8568
+ "size": 1907,
8569
+ "path": "../public/_nuxt/error-500.DjUK_N2Y.css"
8378
8570
  },
8379
8571
  "/_nuxt/builds/latest.json": {
8380
8572
  "type": "application/json",
8381
- "etag": "\"47-EJXUgIknt1NtRGrfbIg0y1oCkKo\"",
8382
- "mtime": "2026-03-08T08:18:08.210Z",
8573
+ "etag": "\"47-op9Jfo5oQLm36mD0gRz+ndCW6Io\"",
8574
+ "mtime": "2026-03-08T16:28:20.548Z",
8383
8575
  "size": 71,
8384
8576
  "path": "../public/_nuxt/builds/latest.json"
8385
8577
  },
8386
- "/_nuxt/builds/meta/b13ec2b2-ddd3-4ead-abd4-4fba9dfc0061.json": {
8578
+ "/_nuxt/builds/meta/ee5097c4-b785-4b77-92d6-c16a7396d677.json": {
8387
8579
  "type": "application/json",
8388
- "etag": "\"58-4LV7CGlrqQtIsZtBvXP/nL5aCwQ\"",
8389
- "mtime": "2026-03-08T08:18:08.207Z",
8580
+ "etag": "\"58-C3SJHjRgAe3fjVEO8JR6Pab6zyo\"",
8581
+ "mtime": "2026-03-08T16:28:20.546Z",
8390
8582
  "size": 88,
8391
- "path": "../public/_nuxt/builds/meta/b13ec2b2-ddd3-4ead-abd4-4fba9dfc0061.json"
8583
+ "path": "../public/_nuxt/builds/meta/ee5097c4-b785-4b77-92d6-c16a7396d677.json"
8392
8584
  },
8393
- "/_nuxt/error-500.DjUK_N2Y.css": {
8585
+ "/_nuxt/B04gGCnx.js": {
8586
+ "type": "text/javascript; charset=utf-8",
8587
+ "etag": "\"66cba-KFKixdFAdkdkbCxucEEHBnimIKw\"",
8588
+ "mtime": "2026-03-08T16:28:20.553Z",
8589
+ "size": 421050,
8590
+ "path": "../public/_nuxt/B04gGCnx.js"
8591
+ },
8592
+ "/_nuxt/entry.Y3mA4bzA.css": {
8394
8593
  "type": "text/css; charset=utf-8",
8395
- "etag": "\"773-Qf61bSDos4KtmZDaA06FmZyUYNo\"",
8396
- "mtime": "2026-03-08T08:18:08.217Z",
8397
- "size": 1907,
8398
- "path": "../public/_nuxt/error-500.DjUK_N2Y.css"
8594
+ "etag": "\"2d46b-zfrD3Ny9WW6qm4fCXAfX5eIAxPA\"",
8595
+ "mtime": "2026-03-08T16:28:20.553Z",
8596
+ "size": 185451,
8597
+ "path": "../public/_nuxt/entry.Y3mA4bzA.css"
8399
8598
  }
8400
8599
  };
8401
8600
 
@@ -8698,7 +8897,10 @@ function getSpaceId() {
8698
8897
  return v && v.trim().length ? v.trim() : "local";
8699
8898
  }
8700
8899
  function getServerInfo() {
8701
- return { name: "commandable", version: "0.0.1" };
8900
+ return {
8901
+ name: "commandable",
8902
+ version: (process.env.COMMANDABLE_VERSION || "").trim() || "0.0.0"
8903
+ };
8702
8904
  }
8703
8905
  function isCreateEndpoint(endpoint) {
8704
8906
  return endpoint === "create";
@@ -8714,12 +8916,16 @@ async function buildState(endpoint) {
8714
8916
  const credentialStore = new SqlCredentialStore(db, secret);
8715
8917
  const spaceId = getSpaceId();
8716
8918
  const integrations = await listIntegrations(db, spaceId);
8919
+ const toolDefinitions = await listToolDefinitions(db, spaceId);
8920
+ const integrationTypeConfigs = await listIntegrationTypeConfigs(db, spaceId);
8717
8921
  const integrationsRef = { current: integrations };
8922
+ const integrationTypeConfigsRef = { current: integrationTypeConfigs };
8718
8923
  const proxy = new IntegrationProxy({
8719
8924
  credentialStore,
8720
- trelloApiKey: process.env.TRELLO_API_KEY
8925
+ trelloApiKey: process.env.TRELLO_API_KEY,
8926
+ integrationTypeConfigsRef
8721
8927
  });
8722
- const index = buildMcpToolIndex({ spaceId, integrations, proxy, integrationsRef });
8928
+ const index = buildMcpToolIndex({ spaceId, integrations, proxy, integrationsRef, toolDefinitions });
8723
8929
  const toolIndexRef = { list: index.tools, byName: index.byName };
8724
8930
  const port = (process.env.PORT || "").trim() || "23432";
8725
8931
  const host = (process.env.HOST || "").trim() || "127.0.0.1";
@@ -8733,6 +8939,7 @@ async function buildState(endpoint) {
8733
8939
  proxy,
8734
8940
  credentialSetupBaseUrl,
8735
8941
  integrationsRef,
8942
+ integrationTypeConfigsRef,
8736
8943
  toolIndexRef,
8737
8944
  catalogRef
8738
8945
  } : void 0;
@@ -8909,6 +9116,9 @@ const _lazy_sOFl5X = () => import('../routes/api/integrations/_id/credentials-st
8909
9116
  const _lazy_zXPBbA = () => import('../routes/api/integrations/_id/credentials.delete.mjs');
8910
9117
  const _lazy_69ylR_ = () => import('../routes/api/integrations/_id/credentials.post.mjs');
8911
9118
  const _lazy_lumeOp = () => import('../routes/api/integrations/_id/permissions.post.mjs');
9119
+ const _lazy_4q0YgG = () => import('../routes/api/integrations/_id/tools.delete.mjs');
9120
+ const _lazy_c2AGl_ = () => import('../routes/api/integrations/_id/tools.get.mjs');
9121
+ const _lazy_CTS1ok = () => import('../routes/api/integrations/_id/toolsets.get.mjs');
8912
9122
  const _lazy_1IpV3C = () => import('../routes/api/integrations/_id/toolsets.post.mjs');
8913
9123
  const _lazy_lN21pE = () => import('../routes/api/index.get.mjs');
8914
9124
  const _lazy_uOi51L = () => import('../routes/api/index.post.mjs');
@@ -8930,6 +9140,9 @@ const handlers = [
8930
9140
  { route: '/api/integrations/:id/credentials', handler: _lazy_zXPBbA, lazy: true, middleware: false, method: "delete" },
8931
9141
  { route: '/api/integrations/:id/credentials', handler: _lazy_69ylR_, lazy: true, middleware: false, method: "post" },
8932
9142
  { route: '/api/integrations/:id/permissions', handler: _lazy_lumeOp, lazy: true, middleware: false, method: "post" },
9143
+ { route: '/api/integrations/:id/tools', handler: _lazy_4q0YgG, lazy: true, middleware: false, method: "delete" },
9144
+ { route: '/api/integrations/:id/tools', handler: _lazy_c2AGl_, lazy: true, middleware: false, method: "get" },
9145
+ { route: '/api/integrations/:id/toolsets', handler: _lazy_CTS1ok, lazy: true, middleware: false, method: "get" },
8933
9146
  { route: '/api/integrations/:id/toolsets', handler: _lazy_1IpV3C, lazy: true, middleware: false, method: "post" },
8934
9147
  { route: '/api/integrations', handler: _lazy_lN21pE, lazy: true, middleware: false, method: "get" },
8935
9148
  { route: '/api/integrations', handler: _lazy_uOi51L, lazy: true, middleware: false, method: "post" },
@@ -9355,5 +9568,5 @@ trapUnhandledNodeErrors();
9355
9568
  setupGracefulShutdown(listener, nitroApp);
9356
9569
  const nodeServer = {};
9357
9570
 
9358
- export { $fetch$1 as $, publicAssetsURL as A, getQuery as B, destr as C, getRouteRules as D, joinURL as E, useNitroApp as F, serialize$1 as G, klona as H, IntegrationProxy as I, defu as J, hasProtocol as K, isScriptProtocol as L, parseQuery as M, defuFn as N, withQuery as O, sanitizeStatusCode as P, parseURL as Q, encodePath as R, SqlCredentialStore as S, decodePath as T, isEqual as U, getContext as V, withTrailingSlash as W, withoutTrailingSlash as X, baseURL as Y, createHooks as Z, executeAsync as _, loadIntegrationCredentialConfig as a, hash$1 as a0, nodeServer as a1, loadIntegrationToolList as b, createError$1 as c, defineEventHandler as d, loadIntegrationToolsets as e, getDb as f, getRouterParam as g, findIntegrationTypeConfig as h, getOrCreateEncryptionSecret as i, updateIntegrationHealth as j, readBody as k, listIntegrationCatalog as l, checkIntegrationHealth as m, listIntegrations as n, upsertIntegration as o, pgIntegrations as p, handleMcpHttp as q, refreshMcpState as r, sqliteIntegrations as s, setResponseStatus as t, updateIntegrationCredentials as u, buildAssetsURL as v, useRuntimeConfig as w, getResponseStatusText as x, getResponseStatus as y, defineRenderHandler as z };
9571
+ export { getContext as $, setResponseStatus as A, buildAssetsURL as B, useRuntimeConfig as C, getResponseStatusText as D, getResponseStatus as E, defineRenderHandler as F, publicAssetsURL as G, getQuery as H, IntegrationProxy as I, destr as J, getRouteRules as K, joinURL as L, useNitroApp as M, serialize$1 as N, klona as O, defu as P, hasProtocol as Q, isScriptProtocol as R, SqlCredentialStore as S, parseQuery as T, defuFn as U, withQuery as V, sanitizeStatusCode as W, parseURL as X, encodePath as Y, decodePath as Z, isEqual as _, loadIntegrationCredentialConfig as a, withTrailingSlash as a0, withoutTrailingSlash as a1, $fetch$1 as a2, baseURL as a3, createHooks as a4, executeAsync as a5, hash$1 as a6, nodeServer as a7, loadIntegrationToolList as b, createError$1 as c, defineEventHandler as d, loadIntegrationToolsets as e, getDb as f, getRouterParam as g, getIntegrationById as h, deleteToolDefinitionsForIntegration as i, getOrCreateEncryptionSecret as j, deleteIntegrationById as k, listIntegrationCatalog as l, listIntegrations as m, deleteIntegrationTypeConfig as n, findIntegrationTypeConfig as o, pgIntegrations as p, updateIntegrationHealth as q, refreshMcpState as r, sqliteIntegrations as s, readBody as t, updateIntegrationCredentials as u, checkIntegrationHealth as v, upsertIntegration as w, deleteToolDefinitionByName as x, listToolDefinitionsForIntegration as y, handleMcpHttp as z };
9359
9572
  //# sourceMappingURL=nitro.mjs.map