botmancers 0.6.1 → 0.8.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 (266) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +13 -12
  3. package/app/.next/BUILD_ID +1 -1
  4. package/app/.next/app-path-routes-manifest.json +1 -2
  5. package/app/.next/build-manifest.json +3 -3
  6. package/app/.next/prerender-manifest.json +4 -4
  7. package/app/.next/required-server-files.json +2 -2
  8. package/app/.next/routes-manifest.json +8 -12
  9. package/app/.next/server/app/_global-error.html +1 -1
  10. package/app/.next/server/app/_global-error.rsc +1 -1
  11. package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/_not-found.html +1 -1
  17. package/app/.next/server/app/_not-found.rsc +2 -2
  18. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  19. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  20. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/app/.next/server/app/api/bots/[id]/config/route.js.nft.json +1 -1
  22. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js +2 -2
  23. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js.nft.json +1 -1
  24. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/route.js.nft.json +1 -1
  25. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js +3 -3
  26. package/app/.next/server/app/api/bots/[id]/sessions/[ref]/shares/route.js.nft.json +1 -1
  27. package/app/.next/server/app/api/bots/[id]/sessions/route.js +5 -5
  28. package/app/.next/server/app/api/bots/[id]/sessions/route.js.nft.json +1 -1
  29. package/app/.next/server/app/api/bots/[id]/sessions/sync/route/app-paths-manifest.json +3 -0
  30. package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js +11 -0
  31. package/app/.next/server/app/api/bots/[id]/sessions/sync/route.js.nft.json +1 -0
  32. package/app/.next/server/app/api/bots/[id]/sessions/sync/route_client-reference-manifest.js +3 -0
  33. package/app/.next/server/app/api/bots/[id]/share-policy/route.js +3 -3
  34. package/app/.next/server/app/api/bots/[id]/share-policy/route.js.nft.json +1 -1
  35. package/app/.next/server/app/api/bots/[id]/skill/route.js.nft.json +1 -1
  36. package/app/.next/server/app/api/bots/availability/route.js +3 -2
  37. package/app/.next/server/app/api/bots/availability/route.js.nft.json +1 -1
  38. package/app/.next/server/app/api/bots/delete-preview/route.js.nft.json +1 -1
  39. package/app/.next/server/app/api/bots/import/route.js.nft.json +1 -1
  40. package/app/.next/server/app/api/bots/manage/route.js.nft.json +1 -1
  41. package/app/.next/server/app/api/bots/name-migrations/route.js.nft.json +1 -1
  42. package/app/.next/server/app/api/bots/route.js +4 -4
  43. package/app/.next/server/app/api/bots/route.js.nft.json +1 -1
  44. package/app/.next/server/app/api/conversations/[id]/approve/route.js.nft.json +1 -1
  45. package/app/.next/server/app/api/conversations/[id]/deny/route.js.nft.json +1 -1
  46. package/app/.next/server/app/api/conversations/[id]/draft/route.js.nft.json +1 -1
  47. package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js.nft.json +1 -1
  48. package/app/.next/server/app/api/conversations/[id]/messages/route.js +5 -5
  49. package/app/.next/server/app/api/conversations/[id]/messages/route.js.nft.json +1 -1
  50. package/app/.next/server/app/api/conversations/[id]/route.js.nft.json +1 -1
  51. package/app/.next/server/app/api/conversations/[id]/stop/route.js +6 -6
  52. package/app/.next/server/app/api/conversations/[id]/stop/route.js.nft.json +1 -1
  53. package/app/.next/server/app/api/conversations/route.js.nft.json +1 -1
  54. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js +2 -2
  55. package/app/.next/server/app/api/exchanges/[id]/cancel/route.js.nft.json +1 -1
  56. package/app/.next/server/app/api/exchanges/[id]/route.js +3 -3
  57. package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
  58. package/app/.next/server/app/api/exchanges/route.js +2 -2
  59. package/app/.next/server/app/api/exchanges/route.js.nft.json +1 -1
  60. package/app/.next/server/app/api/files/[name]/route.js.nft.json +1 -1
  61. package/app/.next/server/app/api/groups/route.js.nft.json +1 -1
  62. package/app/.next/server/app/api/health/route.js +2 -2
  63. package/app/.next/server/app/api/health/route.js.nft.json +1 -1
  64. package/app/.next/server/app/api/mcp/route.js.nft.json +1 -1
  65. package/app/.next/server/app/api/messages/[id]/between/route.js.nft.json +1 -1
  66. package/app/.next/server/app/api/runtime-connections/route.js.nft.json +1 -1
  67. package/app/.next/server/app/api/service-grants/route.js.nft.json +1 -1
  68. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js +3 -3
  69. package/app/.next/server/app/api/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  70. package/app/.next/server/app/api/shares/route.js +3 -3
  71. package/app/.next/server/app/api/shares/route.js.nft.json +1 -1
  72. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js +3 -3
  73. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js.nft.json +1 -1
  74. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js +3 -3
  75. package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js.nft.json +1 -1
  76. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js +2 -2
  77. package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js.nft.json +1 -1
  78. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js +3 -3
  79. package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js.nft.json +1 -1
  80. package/app/.next/server/app/api/v0/agents/[agentId]/route.js +3 -3
  81. package/app/.next/server/app/api/v0/agents/[agentId]/route.js.nft.json +1 -1
  82. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js +3 -3
  83. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js.nft.json +1 -1
  84. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js +3 -3
  85. package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js.nft.json +1 -1
  86. package/app/.next/server/app/api/v0/agents/route.js +3 -3
  87. package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
  88. package/app/.next/server/app/api/v0/capabilities/route.js +3 -3
  89. package/app/.next/server/app/api/v0/capabilities/route.js.nft.json +1 -1
  90. package/app/.next/server/app/api/v0/conversations/[id]/route.js +2 -2
  91. package/app/.next/server/app/api/v0/conversations/[id]/route.js.nft.json +1 -1
  92. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js +3 -3
  93. package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js.nft.json +1 -1
  94. package/app/.next/server/app/api/v0/exchanges/[id]/route.js +3 -3
  95. package/app/.next/server/app/api/v0/exchanges/[id]/route.js.nft.json +1 -1
  96. package/app/.next/server/app/api/v0/exchanges/route.js +3 -3
  97. package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
  98. package/app/.next/server/app/api/v0/mcp/route.js +4 -4
  99. package/app/.next/server/app/api/v0/mcp/route.js.nft.json +1 -1
  100. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js +3 -3
  101. package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js +3 -3
  103. package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js.nft.json +1 -1
  104. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js +3 -3
  105. package/app/.next/server/app/api/v0/pins/[pinRef]/route.js.nft.json +1 -1
  106. package/app/.next/server/app/api/v0/requests/[id]/route.js +2 -2
  107. package/app/.next/server/app/api/v0/requests/[id]/route.js.nft.json +1 -1
  108. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js +3 -3
  109. package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js.nft.json +1 -1
  110. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js +3 -3
  111. package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js.nft.json +1 -1
  112. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js +3 -3
  113. package/app/.next/server/app/api/v0/sessions/[ref]/shares/route.js.nft.json +1 -1
  114. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js +3 -3
  115. package/app/.next/server/app/api/v0/shares/[shareRef]/revoke/route.js.nft.json +1 -1
  116. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js +3 -3
  117. package/app/.next/server/app/api/v0/shares/[shareRef]/route.js.nft.json +1 -1
  118. package/app/.next/server/app/api/v0/shares/current/route.js +3 -3
  119. package/app/.next/server/app/api/v0/shares/current/route.js.nft.json +1 -1
  120. package/app/.next/server/app/api/v0/shares/route.js +3 -3
  121. package/app/.next/server/app/api/v0/shares/route.js.nft.json +1 -1
  122. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js +2 -2
  123. package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js.nft.json +1 -1
  124. package/app/.next/server/app/api/wakes/[id]/decision/route.js +2 -2
  125. package/app/.next/server/app/api/wakes/[id]/decision/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/wakes/[id]/retry/route.js +2 -2
  127. package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
  128. package/app/.next/server/app/bots/[id]/config/page.js.nft.json +1 -1
  129. package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
  130. package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
  131. package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
  132. package/app/.next/server/app/exchanges.html +1 -1
  133. package/app/.next/server/app/exchanges.rsc +3 -3
  134. package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
  135. package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
  136. package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
  137. package/app/.next/server/app/index.html +1 -1
  138. package/app/.next/server/app/index.rsc +3 -3
  139. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  140. package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
  141. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  142. package/app/.next/server/app/page.js.nft.json +1 -1
  143. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  144. package/app/.next/server/app/settings/page.js.nft.json +1 -1
  145. package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  146. package/app/.next/server/app/settings.html +1 -1
  147. package/app/.next/server/app/settings.rsc +3 -3
  148. package/app/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  149. package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  150. package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +3 -3
  151. package/app/.next/server/app/threads/[id]/page.js.nft.json +1 -1
  152. package/app/.next/server/app/threads/[id]/page_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app-paths-manifest.json +1 -2
  154. package/app/.next/server/chunks/[root-of-the-server]__0d3fjix._.js +1 -1
  155. package/app/.next/server/chunks/[root-of-the-server]__0hhill-._.js +3 -0
  156. package/app/.next/server/chunks/[root-of-the-server]__0k8wfe2._.js +3 -0
  157. package/app/.next/server/chunks/[root-of-the-server]__0mp8bap._.js +1 -1
  158. package/app/.next/server/chunks/[root-of-the-server]__0qaiqut._.js +5 -5
  159. package/app/.next/server/chunks/[root-of-the-server]__0qqsovi._.js +3 -0
  160. package/app/.next/server/chunks/[root-of-the-server]__0zrx1iz._.js +1 -1
  161. package/app/.next/server/chunks/[root-of-the-server]__10b5-i-._.js +1 -1
  162. package/app/.next/server/chunks/[root-of-the-server]__17xl_55._.js +1 -1
  163. package/app/.next/server/chunks/[root-of-the-server]__1j8fg_n._.js +3 -0
  164. package/app/.next/server/chunks/[root-of-the-server]__1x8phwp._.js +44 -0
  165. package/app/.next/server/chunks/[root-of-the-server]__200ep0k._.js +1 -1
  166. package/app/.next/server/chunks/_0061c2q._.js +1 -1
  167. package/app/.next/server/chunks/_057h7zr._.js +3 -0
  168. package/app/.next/server/chunks/_0_b7py8._.js +3 -0
  169. package/app/.next/server/chunks/_0a2do3x._.js +1 -1
  170. package/app/.next/server/chunks/_1-5mthb._.js +1 -1
  171. package/app/.next/server/chunks/_next-internal_server_app_api_bots_[id]_sessions_sync_route_actions_00y6n-f.js +3 -0
  172. package/app/.next/server/chunks/lib_0-opbv7._.js +330 -0
  173. package/app/.next/server/chunks/lib_0aejojj._.js +330 -0
  174. package/app/.next/server/chunks/lib_0il0ml1._.js +330 -0
  175. package/app/.next/server/chunks/lib_0iujsdg._.js +330 -0
  176. package/app/.next/server/chunks/lib_0kik6bx._.js +20 -20
  177. package/app/.next/server/chunks/lib_0pe3tiv._.js +20 -20
  178. package/app/.next/server/chunks/{lib_1zc7-gl._.js → lib_15a9ejf._.js} +122 -130
  179. package/app/.next/server/chunks/{lib_15adnlz._.js → lib_19pzc33._.js} +122 -130
  180. package/app/.next/server/chunks/lib_1a4ucxv._.js +330 -0
  181. package/app/.next/server/chunks/lib_1dehbst._.js +330 -0
  182. package/app/.next/server/chunks/lib_1z4vnh4._.js +330 -0
  183. package/app/.next/server/chunks/lib_1z7d95m._.js +2181 -0
  184. package/app/.next/server/chunks/lib_db_ts_1ttuckb._.js +58 -56
  185. package/app/.next/server/chunks/lib_service-api-http_ts_0xzqhny._.js +5 -5
  186. package/app/.next/server/chunks/ssr/_00ysoah._.js +3 -0
  187. package/app/.next/server/chunks/ssr/_14d-lxn._.js +3 -0
  188. package/app/.next/server/chunks/ssr/_1cvuhjt._.js +1 -1
  189. package/app/.next/server/chunks/ssr/_1lkd0ui._.js +3 -0
  190. package/app/.next/server/chunks/ssr/_1n5mvo5._.js +1 -1
  191. package/app/.next/server/chunks/ssr/_1o94bnv._.js +8 -1
  192. package/app/.next/server/chunks/ssr/_1r5kd5j._.js +3 -0
  193. package/app/.next/server/chunks/ssr/app_1-nwnha._.js +3 -0
  194. package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +1 -1
  195. package/app/.next/server/chunks/ssr/lib_exchange-view_ts_1a4q9ju._.js +3 -0
  196. package/app/.next/server/instrumentation.js +1 -1
  197. package/app/.next/server/middleware-build-manifest.js +3 -3
  198. package/app/.next/server/pages/404.html +1 -1
  199. package/app/.next/server/pages/500.html +1 -1
  200. package/app/.next/server/server-reference-manifest.js +1 -1
  201. package/app/.next/server/server-reference-manifest.json +1 -1
  202. package/app/.next/static/chunks/0y1ihx4vq8du3.js +10 -0
  203. package/app/.next/static/chunks/1c2dl2ga-lqcb.css +3 -0
  204. package/app/.next/static/chunks/2q-tgwkalrnms.js +1 -0
  205. package/app/.next/static/chunks/2qf-mb__71dkk.js +1 -0
  206. package/app/.next/static/chunks/399dvlpyl00wn.js +1 -0
  207. package/app/.next/static/chunks/3b7r6u9nfsjb1.js +1 -0
  208. package/app/.next/static/chunks/3f1v-zuki9k7k.js +1 -0
  209. package/app/.next/static/chunks/3whw2-l4a2sli.js +1 -0
  210. package/app/BUILD_INFO.json +2 -2
  211. package/app/package.json +1 -1
  212. package/app/server.js +1 -1
  213. package/dist/cli.d.ts +1 -1
  214. package/dist/cli.js +2 -2
  215. package/dist/product.d.ts +0 -1
  216. package/dist/product.js +12 -22
  217. package/dist/setup.js +9 -9
  218. package/package.json +1 -2
  219. package/schemas/botmancers.mcp.v2.tools.json +3 -3
  220. package/app/.next/server/app/api/agent-deck/decks/route/app-paths-manifest.json +0 -3
  221. package/app/.next/server/app/api/agent-deck/decks/route.js +0 -9
  222. package/app/.next/server/app/api/agent-deck/decks/route.js.nft.json +0 -1
  223. package/app/.next/server/app/api/agent-deck/decks/route_client-reference-manifest.js +0 -3
  224. package/app/.next/server/app/api/agent-deck/settings/route/app-paths-manifest.json +0 -3
  225. package/app/.next/server/app/api/agent-deck/settings/route/build-manifest.json +0 -12
  226. package/app/.next/server/app/api/agent-deck/settings/route/server-reference-manifest.json +0 -4
  227. package/app/.next/server/app/api/agent-deck/settings/route.js +0 -9
  228. package/app/.next/server/app/api/agent-deck/settings/route.js.nft.json +0 -1
  229. package/app/.next/server/app/api/agent-deck/settings/route_client-reference-manifest.js +0 -3
  230. package/app/.next/server/chunks/[root-of-the-server]__0e_agq4._.js +0 -3
  231. package/app/.next/server/chunks/[root-of-the-server]__0j4pjyg._.js +0 -3
  232. package/app/.next/server/chunks/[root-of-the-server]__0mo_kn3._.js +0 -48
  233. package/app/.next/server/chunks/[root-of-the-server]__17mum5-._.js +0 -3
  234. package/app/.next/server/chunks/[root-of-the-server]__1bhzfu_._.js +0 -7
  235. package/app/.next/server/chunks/[root-of-the-server]__1g_n99l._.js +0 -3
  236. package/app/.next/server/chunks/[root-of-the-server]__1t4ybp2._.js +0 -48
  237. package/app/.next/server/chunks/_0qv-4by._.js +0 -3
  238. package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_decks_route_actions_0yguyfv.js +0 -3
  239. package/app/.next/server/chunks/_next-internal_server_app_api_agent-deck_settings_route_actions_0z_nbkb.js +0 -3
  240. package/app/.next/server/chunks/lib_0v4d9w0._.js +0 -339
  241. package/app/.next/server/chunks/lib_0v6lblw._.js +0 -5
  242. package/app/.next/server/chunks/lib_0zzo6zb._.js +0 -339
  243. package/app/.next/server/chunks/lib_1_u7n-u._.js +0 -339
  244. package/app/.next/server/chunks/lib_1muhwn7._.js +0 -339
  245. package/app/.next/server/chunks/lib_1xnxg-q._.js +0 -339
  246. package/app/.next/server/chunks/ssr/_0_fa0na._.js +0 -3
  247. package/app/.next/server/chunks/ssr/_0epgorw._.js +0 -3
  248. package/app/.next/server/chunks/ssr/_1i02yyi._.js +0 -3
  249. package/app/.next/server/chunks/ssr/app_components_AgentDeckRuntime_tsx_024janf._.js +0 -3
  250. package/app/.next/server/chunks/ssr/app_exchanges_page_tsx_0j-n2a1._.js +0 -3
  251. package/app/.next/server/chunks/ssr/app_settings_page_tsx_1t-rdz-._.js +0 -3
  252. package/app/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a._.js +0 -3
  253. package/app/.next/static/chunks/0jon21u-9j2aw.css +0 -3
  254. package/app/.next/static/chunks/14k6cvywgknx2.js +0 -3
  255. package/app/.next/static/chunks/1ku9himlsx-hn.js +0 -1
  256. package/app/.next/static/chunks/1r5tqd-7h1xjn.js +0 -1
  257. package/app/.next/static/chunks/21aqekm5z0j47.js +0 -1
  258. package/app/.next/static/chunks/22xbkclbkct3s.js +0 -1
  259. package/app/.next/static/chunks/2c953okoei6ip.js +0 -1
  260. package/app/.next/static/chunks/2t_2gf3xoxz_m.js +0 -1
  261. package/app/.next/static/chunks/34vnvo1qssbaj.js +0 -1
  262. /package/app/.next/server/app/api/{agent-deck/decks → bots/[id]/sessions/sync}/route/build-manifest.json +0 -0
  263. /package/app/.next/server/app/api/{agent-deck/decks → bots/[id]/sessions/sync}/route/server-reference-manifest.json +0 -0
  264. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → 3rSDqQK0KGcTDI98uoZRy}/_buildManifest.js +0 -0
  265. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → 3rSDqQK0KGcTDI98uoZRy}/_clientMiddlewareManifest.js +0 -0
  266. /package/app/.next/static/{_yrIZIFsIbXA0Gaxkytjd → 3rSDqQK0KGcTDI98uoZRy}/_ssgManifest.js +0 -0
@@ -1,5 +0,0 @@
1
- module.exports=[64909,e=>{"use strict";var t=e.i(54799),n=e.i(33405),r=e.i(22734),i=e.i(14747),a=e.i(62294),s=e.i(25211),l=e.i(51714),o=e.i(10860),u=e.i(85072);let c=["read_file","run_command","send_draft","write_file"];function d(e){return"string"==typeof e&&c.includes(e)}let f=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;class p extends Error{}function m(e){throw new p(e)}function y(e){let t=e?.name;"string"==typeof t&&t||m("read_file needs a file name"),(0,s.isSafeFileName)(t)||m(`refused: unsafe file name ${JSON.stringify(t)}`);let n=(0,u.filesRoot)();return i.default.resolve(n,t).startsWith(n+i.default.sep)||m(`refused: path traversal in ${JSON.stringify(t)}`),t}function g(e){try{return(0,l.resolveCommand)({command:e?.command??"printf",format:e?.format,word:e?.word}).argv[1]}catch(e){m(e instanceof Error?e.message:"refused: command not allowlisted")}}function h(e){let t=e?.recipient,n=e?.body;return"string"==typeof t&&t.trim()||m("send_draft needs a recipient"),"string"==typeof n&&n.trim()||m("send_draft needs a body"),e?.channel!==void 0&&"email"!==e.channel&&"slack"!==e.channel&&m("send_draft channel must be email or slack"),{recipient:t.trim(),body:n.trim()}}function w(e){let t=e?.name;"string"==typeof t&&t||m("write_file needs a file name"),(0,s.isSafeFileName)(t)||m(`refused: unsafe file name ${JSON.stringify(t)}`);let n=(0,u.filesRoot)();i.default.resolve(n,t).startsWith(n+i.default.sep)||m(`refused: path traversal in ${JSON.stringify(t)}`);let r=e?.content;return"string"==typeof r&&r||m("write_file needs content"),Buffer.byteLength(r,"utf8")>u.ARTIFACT_MAX_BYTES&&m(`refused: file content exceeds ${u.ARTIFACT_MAX_BYTES} bytes`),{name:t,content:r}}let b={read_file:{validate:e=>{y(e)},run:e=>{let t=y(e),n=i.default.join((0,u.filesRoot)(),t),a=r.default.readFileSync(n,"utf8");return{ok:!0,lines:[`[tool call] readFile ${JSON.stringify([t])}`,`[tool result] ${a}`],result:a}}},run_command:{validate:e=>{g(e)},run:e=>{let t=g(e),r=(0,n.execFileSync)("printf",["%s",t],{encoding:"utf8"});return{ok:!0,lines:[`[tool call] printf ${JSON.stringify(["%s",t])}`,`[tool result] ${r}`],result:r}}},send_draft:{validate:e=>{h(e)},run:e=>{let{recipient:t,body:n}=h(e),r=`[Sent to ${t}] ${n}`;return{ok:!0,lines:[r],result:r}}},write_file:{validate:e=>{w(e)},run:e=>{let{name:t,content:n}=w(e),a=(0,u.filesRoot)();r.default.mkdirSync(a,{recursive:!0});let s=i.default.resolve(a,t);if(!s.startsWith(a+i.default.sep))throw new p(`refused: path traversal in ${JSON.stringify(t)}`);return r.default.writeFileSync(s,n,"utf8"),{ok:!0,lines:[`[file] ${t}`],result:t}}}};function _(e,t){let n=a.default.prepare("SELECT * FROM approval_requests WHERE conversation_id = ? AND code = ?").get(e,t);return n?function(e){let t=null;if("string"==typeof e.action_args&&e.action_args)try{let n=JSON.parse(e.action_args);n&&"object"==typeof n&&!Array.isArray(n)&&(t=n)}catch{t=null}return{id:String(e.id),conversation_id:String(e.conversation_id),bot_id:e.bot_id??null,code:String(e.code),action_type:e.action_type??null,action_args:t,message_id:e.message_id??null,status:e.status,result:e.result??null,created_at:Number(e.created_at),resolved_at:e.resolved_at??null}}(n):void 0}function v(e){let n=(e.code||"").trim();if(!f.test(n))throw Error("approval code is required");let r=e.actionType??null,i=e.actionArgs??null;if(null!==r){if(!d(r))throw new p(`refused: unknown action type ${JSON.stringify(r)}`);b[r].validate(i)}let s=Date.now();a.default.prepare(`INSERT OR IGNORE INTO approval_requests
2
- (id, conversation_id, bot_id, code, action_type, action_args, message_id, status, created_at)
3
- VALUES (?, ?, ?, ?, ?, ?, ?, 'pending', ?)`).run((0,t.randomUUID)(),e.conversationId,e.botId??null,n,r,i?JSON.stringify(i):null,e.messageId??null,s);let l=_(e.conversationId,n);if(!l)throw Error("failed to store approval request");return l}function A(e,t,n){a.default.prepare("UPDATE approval_requests SET message_id = ? WHERE conversation_id = ? AND code = ?").run(n,e,t)}function $(e){let n=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,16)||"gate";return`${n}-${(0,t.randomBytes)(2).toString("hex")}`}function S(e){return e?a.bots.getById(e)?.name??null:null}function E(e,t){a.messages.create(e.conversation_id,"bot",t,e.bot_id??void 0)}function N(e){return`Approve using the code ${e}`}function T(e,t){for(let n=0;n<8;n++){let n=$(t);if(!_(e,n))return n}return $(`${t}-${Date.now().toString(36)}`)}e.s(["ApprovalActionRefused",0,p,"approvalCardText",0,N,"createApprovalRequest",0,v,"decideApproval",0,function(e,t,n){let r,i=_(e,t);if(!i)throw Error("Approval request not found");if("pending"!==i.status)return{status:i.status,code:t,ran:!1,already:!0};if("deny"===n){if(1!==Number(a.default.prepare("UPDATE approval_requests SET status = 'denied', resolved_at = ? WHERE conversation_id = ? AND code = ? AND status = 'pending'").run(Date.now(),e,t).changes)){let n=_(e,t);return{status:n?.status??"denied",code:t,ran:!1,already:!0}}return E(i,(0,o.applySkillEndToken)(S(i.bot_id),`Denied ${t}`)),{status:"denied",code:t,ran:!1,already:!1}}if(null!==i.action_type&&!d(i.action_type))return{status:"pending",code:t,ran:!1,already:!1,refused:`refused: unknown action type ${JSON.stringify(i.action_type)}`};if(null!==i.action_type)try{b[i.action_type].validate(i.action_args)}catch(e){return{status:"pending",code:t,ran:!1,already:!1,refused:e instanceof Error?e.message:String(e)}}if(1!==Number(a.default.prepare("UPDATE approval_requests SET status = 'approved', resolved_at = ? WHERE conversation_id = ? AND code = ? AND status = 'pending'").run(Date.now(),e,t).changes)){let n=_(e,t);return{status:n?.status??"approved",code:t,ran:!1,already:!0}}if(null===i.action_type)return E(i,(0,o.applySkillEndToken)(S(i.bot_id),t)),{status:"approved",code:t,ran:!1,already:!1};try{r=b[i.action_type].run(i.action_args,{conversationId:e,botId:i.bot_id})}catch(t){let e=t instanceof Error?t.message:String(t);r={ok:!1,lines:[`[tool result] Error: ${e}`],result:`Error: ${e}`}}for(let e of r.lines)E(i,e);let s=function(e){if(!e)return null;let t=a.bots.getById(e);return(0,o.skillEndToken)(t?.name)}(i.bot_id);return s&&E(i,s),a.default.prepare("UPDATE approval_requests SET status = ?, result = ? WHERE conversation_id = ? AND code = ?").run("executed",r.result,e,t),{status:"executed",code:t,ran:r.ok,already:!1}},"getApprovalByCode",0,_,"mintApprovalCode",0,$,"raiseApprovalFromUserInstruction",0,function(e){let t,n,r,{conversationId:i,botId:l,botName:u,userMessage:c,thread:d}=e,m=function(e){let t=(e||"").trim();if(!t)return null;let n=t.match(/^(?:please\s+|could you\s+)?(read|open|cat|display|show)\s+(?:me\s+)?(?:the\s+)?(?:file\s+|contents\s+of\s+(?:the\s+)?(?:file\s+)?)(\S+?)\s*(?:for me\s*)?[.?!]?\s*$/i);if(!n)return null;let r=n[2].replace(/^[`"'"]+|[`"'"]+$/g,"").replace(/[.?!]+$/,"");return r?{name:r}:null}(c.content),y=m?null:function(e){let t=(e||"").trim();if(!t)return null;let n=t.match(/^(?:please\s+)?(run|execute)\s+(?:a\s+)?command\s+(?:that\s+prints|to\s+print|printing)\s+(?:the\s+)?word\s+([A-Za-z0-9_-]+)\s*[.?!]?\s*$/i);return n?{word:n[2]}:null}(c.content),g=m||y?null:function(e){let t,n=(e||"").trim();if(!n||!/\bask\b/i.test(n)||!/\bapprov(?:e|al)\b/i.test(n)||!/\bcode\b/i.test(n)||!/\bwait\b/i.test(n))return null;let r=n.match(/code\s*:?\s*[`"'"]?([A-Za-z0-9][A-Za-z0-9_.-]*)[`"'"]?/i);return r?(t=r[1].replace(/^[`"'"]+|[`"'"]+$/g,"").replace(/[^A-Za-z0-9_-]+$/,""),f.test(t)?t:null):null}(c.content);if(!m&&!y&&!g)return!1;if(d.some(e=>{let t;return"bot"===e.sender_type&&e.sender_id===l&&e.created_at>c.created_at&&!!(t=(0,s.parseApprovalCode)(e.content))&&!!_(i,t)}))return!0;m?(t=T(i,`read-${m.name}`),n="read_file",r={name:m.name}):y?(t=T(i,`run-${y.word}`),n="run_command",r={command:"printf",format:"%s",word:y.word}):(t=g,n=null,r=null);try{v({conversationId:i,botId:l,code:t,actionType:n,actionArgs:r})}catch(e){if(e instanceof p)return!0;throw e}let h=(0,o.applySkillEndToken)(u,N(t)),w=a.messages.create(i,"bot",h,l);return A(i,t,w.id),!0},"recordModelApproval",0,function(e,t){let n=function(e){let t,n=(0,s.parseApprovalCode)(e||"");if(!n||!f.test(n))return null;let r=(e||"").match(/\[approval-action\]\s*(\{[\s\S]*?\})\s*(?:\r?\n|$)/i);if(!r)return{code:n,actionType:null,actionArgs:null};try{t=JSON.parse(r[1])}catch{return{code:n,actionType:null,actionArgs:null}}if(!t||"object"!=typeof t||Array.isArray(t))return{code:n,actionType:null,actionArgs:null};let i=t;if(!d(i.type))return{code:n,actionType:null,actionArgs:null};let a={};for(let[e,t]of Object.entries(i))"type"!==e&&(a[e]=t);try{b[i.type].validate(a)}catch{return{code:n,actionType:null,actionArgs:null}}return{code:n,actionType:i.type,actionArgs:a}}(t.content);if(!n)return null;let r=v({conversationId:e,botId:t.sender_id??null,code:n.code,actionType:n.actionType,actionArgs:n.actionArgs,messageId:t.id});return r.message_id||A(e,n.code,t.id),r},"setApprovalMessage",0,A])},85072,3620,e=>{"use strict";var t=e.i(22734),n=e.i(14747),r=e.i(25211);class i extends Error{}function a(e,t){return RegExp("\\b"+t+"\\b","i").test(e)}function s(e){return e.trim().replace(/^[@"'`]+|["'`]+$/g,"").replace(/[.?!;,:'"`]+$/g,"").trim()}function l(e){if(!e||"object"!=typeof e||Array.isArray(e))throw new i("draft needs {channel, recipient, body}");if("email"!==e.channel&&"slack"!==e.channel)throw new i("draft channel must be email or slack");if("string"!=typeof e.recipient)throw new i("draft needs a recipient string");if("string"!=typeof e.body)throw new i("draft needs a body string");let t=e.recipient.trim(),n=e.body.trim();if(t.length>256)throw new i("draft recipient is too long");if(!n)throw new i("draft needs a body");if(Buffer.byteLength(n,"utf8")>32768)throw new i("draft body is too large");return{channel:e.channel,recipient:t,body:n}}e.s(["createDraft",0,function(e){let t=l(e);return{channel:t.channel,recipient:t.recipient,body:t.body,state:"open"}},"parseDraftRequest",0,function(e){let t=(e||"").trim();if(!t||/^\s*(create a specialist|duplicate)\b/i.test(t))return null;let n=null;if(a(t,"email")?n="email":a(t,"slack")&&(n="slack"),!n)return null;let r=/\b(draft|write|compose|create|prepare|send)\b/i.test(t),i=/\bplease\b/i.test(t),o=/\b(can|could|would)\s+you\b/i.test(t),u=/^\s*(please\s+)?(email|slack)\b/i.test(t);if(!r&&!i&&!o&&!u)return null;let c=function(e){if(e.toLowerCase().includes("one-line note"))return"One-line note.";let t=e.toLowerCase(),n=-1,r="";for(let e of["that says","saying","note:"]){let i=t.indexOf(e);i>=0&&(n<0||i<n)&&(n=i,r=e)}return n<0?null:e.slice(n+r.length).trim()||null}(t);if(c){let e=function(e){let t=e.toLowerCase(),n=-1;for(let e of["that says","saying","note:"]){let r=t.indexOf(e);r>=0&&(n<0||r<n)&&(n=r)}return n<0?e:e.slice(0,n)}(t),r="",i=e.match(/\bto\s+@?([A-Za-z0-9_.-]+(?:@[A-Za-z0-9_.-]+\.[A-Za-z]+)?)/i);if(i)r=s(i[1]||"");else{let t=e.match(/\b(email|slack)\b\s+@?([A-Za-z0-9_.-]+)/i);if(t){let e=s(t[2]||"");e&&!["to","a","an","the","that","saying","note"].includes(e.toLowerCase())&&(r=e)}}try{return l({channel:n,recipient:r,body:c})}catch{return null}}if(!u)return null;let d=t.match(/^\s*(?:please\s+)?(?:email|slack)\s+@?([A-Za-z0-9_.-]+)\s+(.+?)\s*[.?!]?\s*$/i);if(!d)return null;let f=s(d[1]||""),p=(d[2]||"").trim();if(!f||["to","a","an","the","that","saying","note"].includes(f.toLowerCase())||!p||p.length<2)return null;try{return l({channel:n,recipient:f,body:p})}catch{return null}},"validateDraftRequest",0,l],3620);var o=e.i(52036);class u extends Error{}function c(){return(0,o.filesRootPath)()}function d(e){let t=f(e),r=c(),i=n.default.resolve(r,t);if(i!==r&&!i.startsWith(r+n.default.sep))throw new u(`refused: path traversal in ${JSON.stringify(e)}`);return i}function f(e){if("string"!=typeof e||!e)throw new u("file needs a name");if(e.length>128)throw new u(`refused: file name too long ${JSON.stringify(e)}`);if(!(0,r.isSafeFileName)(e))throw new u(`refused: unsafe file name ${JSON.stringify(e)}`);return e}function p(e){if(!e||"object"!=typeof e||Array.isArray(e))throw new u("file needs {name, content}");return{name:f(e.name),content:function(e){if("string"!=typeof e)throw new u("file needs string content");let t=Buffer.byteLength(e,"utf8");if(0===t)throw new u("file needs content");if(t>65536)throw new u("refused: file content exceeds 65536 bytes");return e}(e.content)}}e.s(["ARTIFACT_MAX_BYTES",0,65536,"artifactCardText",0,function(e){return`[file] ${e}`},"filesRoot",0,c,"parseFileWriteRequest",0,function(e){let t,n=(e||"").trim();if(!n||!/\b(write|create|make)\b/i.test(n)||!/\bfile\b/i.test(n)||!/\bfile\b\s+(named|called)\b/i.test(n))return null;let r=n.match(/\bfile\b\s+(?:named|called)\s+([`"'\u201c\u201d]?\S+?[`"'\u201c\u201d]?)(?:\s+|$)/i);if(!r)return null;let i=(t=(r[1]||"").trim().replace(/^["'`\u201c\u201d]+|["'`\u201c\u201d]+$/g,"").replace(/[?!;,:'"`]+$/,"").trim(),/^\.+$/.test(t)?t:t.replace(/[.]+$/,""));if(!i)return null;let a=n.match(/(?:whose\s+contents?\s+are\s+the\s+word|containing\s+the\s+word|with\s+the\s+word)\s+[`"'\u201c\u201d]?([A-Za-z0-9_-]+)[`"'\u201c\u201d]?/i);if(a)return{name:i,content:a[1]};let s=n.match(/(?:containing|with\s+contents?)\s+["\u201c](.+?)["\u201d]/i);if(s&&s[1].trim())return{name:i,content:s[1]};let l=n.match(/(?:containing|with\s+contents?)\s*:\s*(.+?)\s*$/i);if(l&&l[1].trim()){let e=l[1].trim().replace(/^["'`\u201c\u201d]+|["'`\u201c\u201d]+$/g,"").trim();if(e)return{name:i,content:e}}let o=n.match(/(?:containing|with\s+contents?)\s+(?!the\s+word\b)(.+?)\s*$/i);if(o&&o[1].trim()){let e=o[1].trim().replace(/^["'`\u201c\u201d]+|["'`\u201c\u201d]+$/g,"").trim();if(e=e.replace(/[.?!]+$/,"").trim())return{name:i,content:e}}return null},"parseTypedResult",0,function(e){for(let t of function(e){let t=[];for(let n of(e||"").split(/\r?\n/)){let e=n.match(/^\s*\[produce\]\s*(\{.*\})\s*$/i);if(e)try{t.push(JSON.parse(e[1]))}catch{}}return t}(e))if(!(!t||"object"!=typeof t||Array.isArray(t))){if("draft"===t.type)try{let e=l({channel:t.channel,recipient:t.recipient??"",body:t.body});return{kind:"draft",draft:e}}catch{break}if("file"===t.type)try{let e=p({name:t.name,content:t.content});return{kind:"file",file:e}}catch{}break}return null},"resolveArtifactPath",0,d,"validateArtifact",0,p,"writeArtifactFile",0,function(e,n,r){let i=p({name:e,content:n}),a=c();t.default.mkdirSync(a,{recursive:!0});let s=d(i.name);if(t.default.existsSync(s)){let e;try{e=t.default.statSync(s)}catch{throw new u(`refused: cannot stat ${JSON.stringify(i.name)}`)}if(!e.isFile())throw new u(`refused: not a file ${JSON.stringify(i.name)}`);if(!r?.allowOverwrite)throw new u(`refused: ${JSON.stringify(i.name)} already exists`)}return t.default.writeFileSync(s,i.content,"utf8"),s}],85072)},51714,e=>{"use strict";let t=/^[A-Za-z0-9_-]+$/;function n(e){return"printf"===e}class r extends Error{}function i(e){throw new r(e)}function a(e){return"string"==typeof e&&t.test(e)||i("refused: command not allowlisted"),e.length>64&&i("refused: command not allowlisted"),e}let s=/^(?:please\s+)?(?:print|output|display|show|echo)\s+(?:the\s+)?word\s+([A-Za-z0-9_-]+)\s*(.*?)\s*[.?!]?\s*$/i,l=[/^$/,/^wait\s+(\d+)\s*seconds?$/,/^and\s+wait\s+(\d+)\s*seconds?$/,/^wait\s+for\s+(\d+)\s*seconds?$/,/^and\s+wait\s+for\s+(\d+)\s*seconds?$/,/^then\s+wait\s+(\d+)\s*seconds?$/];function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}e.s(["COMMAND_OUTPUT_MAX_BYTES",0,4096,"commandRunPage",0,function(e,t){let n=`printf %s ${e.args.word}`;return'<!doctype html><html><body style="margin:0;background:#0d1117;color:#c9d1d9;font:13px/1.5 ui-monospace,monospace;padding:12px">'+(null===t?`<div class="cmd">$ ${o(n)}</div><div class="dim">waiting ${e.waitSeconds}s…</div>`:`<div class="cmd">$ ${o(n)}</div><div class="out">${o(t)}</div>`)+"</body></html>"},"commandTimeoutMs",0,function(e){return 1e3*e+1e4},"parseCommandAsk",0,function(e){let n=(e||"").trim();if(!n||/^(?:please\s+)?(run|execute)\s+(?:a\s+)?command\b/i.test(n))return null;let r=n.match(s);if(!r)return null;let i=r[1];if(!t.test(i)||i.length>64)return null;let a=(r[2]||"").trim().replace(/^[,\s]+/,"").trim();for(let e of(a=a.replace(/\s+/g," "),l)){let t=a.match(e);if(!t)continue;if(!t[1])return{command:"printf",args:{word:i},waitSeconds:4};let n=Number(t[1]);if(!Number.isInteger(n)||n<1||n>30)break;return{command:"printf",args:{word:i},waitSeconds:n}}return null},"resolveCommand",0,function(e){n(e.command)||i("refused: command not allowlisted");let t=e.args??null,r=t?.format??e.format;void 0!==r&&"%s"!==r&&i("refused: command not allowlisted");let s=a(t?.word??e.word);return{bin:"/usr/bin/printf",argv:["%s",s],display:`printf %s ${s}`}},"validateCommandRequest",0,function(e){var t;n(e.command)||i("refused: command not allowlisted");let r=e.args,s=a(r?.word);return{command:e.command,args:{word:s},waitSeconds:(("number"!=typeof(t=e.waitSeconds)||!Number.isInteger(t)||t<1||t>30)&&i("refused: wait must be 1 to 30 seconds"),t)}}])},25211,e=>{"use strict";let t=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;e.s(["isSafeFileName",0,function(e){return t.test(e)},"parseApprovalCode",0,function(e){let t=e.match(/approve using the code ([A-Za-z0-9][A-Za-z0-9_-]*)/i);return t?t[1]:null},"parseDraft",0,function(e){let t,n=e.match(/^\s*\[draft\]\s*([\s\S]*)$/);if(!n)return null;try{t=JSON.parse(n[1])}catch{return null}if(!t||"object"!=typeof t)return null;let r=t;return"email"!==r.channel&&"slack"!==r.channel||"open"!==r.state&&"sent"!==r.state&&"discarded"!==r.state||"string"!=typeof r.recipient||"string"!=typeof r.body?null:{channel:r.channel,recipient:r.recipient,body:r.body,state:r.state}},"parseFileNames",0,function(e){let t=[];for(let n of e.split("\n")){let e=n.match(/^\s*\[file\]\s*(\S+)\s*$/i);e&&!t.includes(e[1])&&t.push(e[1])}return t},"serializeDraft",0,function(e){return"[draft]\n"+JSON.stringify({channel:e.channel,recipient:e.recipient,body:e.body,state:e.state})}])}];
4
-
5
- //# sourceMappingURL=lib_0v6lblw._.js.map