reflex-agent 0.13.5 → 0.15.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 (213) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +113 -106
  3. package/.next/app-path-routes-manifest.json +10 -9
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +7 -7
  6. package/.next/react-loadable-manifest.json +1 -1
  7. package/.next/server/app/_not-found/page.js +1 -1
  8. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  9. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/agents/[agentId]/page.js +2 -2
  11. package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
  12. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
  14. package/.next/server/app/api/agents/[agentId]/respond/route.js.nft.json +1 -1
  15. package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/roots/[id]/attachments/route.js +0 -0
  20. package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
  22. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js.nft.json +1 -1
  23. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
  25. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js.nft.json +1 -1
  26. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
  28. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js.nft.json +1 -1
  29. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
  31. package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
  32. package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
  34. package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
  35. package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
  38. package/.next/server/app/api/utilities/[scope]/[id]/host/route.js.nft.json +1 -1
  39. package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route.js +53 -1
  42. package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/utilities/install-archive/route.js +1 -0
  46. package/.next/server/app/api/utilities/install-archive/route.js.nft.json +1 -0
  47. package/.next/server/app/api/utilities/install-archive/route_client-reference-manifest.js +1 -0
  48. package/.next/server/app/audit/page.js +1 -1
  49. package/.next/server/app/audit/page.js.nft.json +1 -1
  50. package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/onboarding/page.js +3 -3
  52. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  53. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/page.js +2 -2
  55. package/.next/server/app/page.js.nft.json +1 -1
  56. package/.next/server/app/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
  58. package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
  59. package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
  61. package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
  62. package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
  63. package/.next/server/app/roots/[id]/memory/page.js +1 -1
  64. package/.next/server/app/roots/[id]/memory/page.js.nft.json +1 -1
  65. package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/roots/[id]/page.js +4 -4
  67. package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
  68. package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
  69. package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
  70. package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
  71. package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
  72. package/.next/server/app/roots/[id]/workflows/page.js +2 -2
  73. package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
  74. package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/roots/new/page.js +3 -3
  76. package/.next/server/app/roots/new/page.js.nft.json +1 -1
  77. package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app/settings/page.js +5 -5
  79. package/.next/server/app/settings/page.js.nft.json +1 -1
  80. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  81. package/.next/server/app/share/[id]/file/page.js +2 -2
  82. package/.next/server/app/share/[id]/file/page.js.nft.json +1 -1
  83. package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/share/[id]/page.js +2 -2
  85. package/.next/server/app/share/[id]/page.js.nft.json +1 -1
  86. package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
  88. package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
  89. package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/utilities/page.js +2 -2
  91. package/.next/server/app/utilities/page.js.nft.json +1 -1
  92. package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
  93. package/.next/server/app-paths-manifest.json +10 -9
  94. package/.next/server/chunks/1105.js +1 -1
  95. package/.next/server/chunks/1358.js +1 -1
  96. package/.next/server/chunks/1638.js +1 -0
  97. package/.next/server/chunks/{7239.js → 2258.js} +1 -1
  98. package/.next/server/chunks/285.js +19 -15
  99. package/.next/server/chunks/3332.js +1 -1
  100. package/.next/server/chunks/3377.js +1 -0
  101. package/.next/server/chunks/3966.js +1 -0
  102. package/.next/server/chunks/4201.js +3 -0
  103. package/.next/server/chunks/4578.js +1 -0
  104. package/.next/server/chunks/4812.js +1 -1
  105. package/.next/server/chunks/7300.js +56 -4
  106. package/.next/server/chunks/7358.js +12 -8
  107. package/.next/server/chunks/8133.js +1 -0
  108. package/.next/server/chunks/{7564.js → 8309.js} +2 -2
  109. package/.next/server/chunks/8511.js +1 -0
  110. package/.next/server/chunks/9098.js +1 -1
  111. package/.next/server/chunks/9809.js +1 -1
  112. package/.next/server/chunks/9861.js +57 -5
  113. package/.next/server/functions-config-manifest.json +4 -3
  114. package/.next/server/middleware-build-manifest.js +1 -1
  115. package/.next/server/middleware-manifest.json +5 -5
  116. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  117. package/.next/server/pages/500.html +1 -1
  118. package/.next/server/server-reference-manifest.js +1 -1
  119. package/.next/server/server-reference-manifest.json +1 -1
  120. package/.next/static/1JOww-AoS7M9R4-h4i1EK/_buildManifest.js +1 -0
  121. package/.next/static/chunks/1807-29ed83a7f19aa21e.js +1 -0
  122. package/.next/static/chunks/3908-7e7f22cd1d3c47ed.js +1 -0
  123. package/.next/static/chunks/4108.1e51cb6f9a9638b0.js +1 -0
  124. package/.next/static/chunks/6559-329fd074773ef4f2.js +1 -0
  125. package/.next/static/chunks/6560-d68897c384b289dc.js +1 -0
  126. package/.next/static/chunks/7037-7d9a908022d947da.js +1 -0
  127. package/.next/static/chunks/{8775-890699c74c28df61.js → 8775-c1985f74619ced58.js} +1 -1
  128. package/.next/static/chunks/{6231-d572db56a0a44f92.js → 9338-9f6c33a593b60e12.js} +3 -3
  129. package/.next/static/chunks/app/api/agents/[agentId]/respond/route-5d0cd3b754198853.js +1 -0
  130. package/.next/static/chunks/app/api/images/[rootId]/[file]/route-5d0cd3b754198853.js +1 -0
  131. package/.next/static/chunks/app/api/oauth/callback/route-5d0cd3b754198853.js +1 -0
  132. package/.next/static/chunks/app/api/oauth/start/route-5d0cd3b754198853.js +1 -0
  133. package/.next/static/chunks/app/api/roots/[id]/attachments/route-5d0cd3b754198853.js +1 -0
  134. package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/send/route-5d0cd3b754198853.js +1 -0
  135. package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stop/route-5d0cd3b754198853.js +1 -0
  136. package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stream/route-5d0cd3b754198853.js +1 -0
  137. package/.next/static/chunks/app/api/roots/[id]/dashboard/route-5d0cd3b754198853.js +1 -0
  138. package/.next/static/chunks/app/api/roots/[id]/suggestions/route-5d0cd3b754198853.js +1 -0
  139. package/.next/static/chunks/app/api/utilities/[scope]/[id]/bundle.js/route-5d0cd3b754198853.js +1 -0
  140. package/.next/static/chunks/app/api/utilities/[scope]/[id]/host/route-5d0cd3b754198853.js +1 -0
  141. package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-api.mjs/route-5d0cd3b754198853.js +1 -0
  142. package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-ui.mjs/route-5d0cd3b754198853.js +1 -0
  143. package/.next/static/chunks/app/api/utilities/[scope]/[id]/iframe/route-5d0cd3b754198853.js +1 -0
  144. package/.next/static/chunks/app/api/utilities/[scope]/[id]/style.css/route-5d0cd3b754198853.js +1 -0
  145. package/.next/static/chunks/app/api/utilities/install-archive/route-5d0cd3b754198853.js +1 -0
  146. package/.next/static/chunks/app/layout-0385fc4c09255a22.js +1 -0
  147. package/.next/static/chunks/app/onboarding/page-e49a9a7a81bdc74e.js +1 -0
  148. package/.next/static/chunks/app/page-d11913f531a6920e.js +1 -0
  149. package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-ac80b75a50880fef.js +1 -0
  150. package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-30c5a6767d469a99.js +1 -0
  151. package/.next/static/chunks/app/roots/[id]/layout-5d0cd3b754198853.js +1 -0
  152. package/.next/static/chunks/app/roots/[id]/memory/{page-495bfa5d5ccc95fc.js → page-ae9c453a059a7c48.js} +1 -1
  153. package/.next/static/chunks/app/roots/[id]/page-074640697b6db60a.js +1 -0
  154. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-6e23d0a8b8bc570b.js +1 -0
  155. package/.next/static/chunks/app/roots/[id]/workflows/page-2a7d5c4f49b41e14.js +1 -0
  156. package/.next/static/chunks/app/roots/new/page-530bbb61fefeadc8.js +1 -0
  157. package/.next/static/chunks/app/settings/page-3b79c11349d439b5.js +1 -0
  158. package/.next/static/chunks/app/share/[id]/page-b5e74b24b29e3918.js +1 -0
  159. package/.next/static/chunks/app/utilities/[scope]/[id]/page-ec338e725c434ecd.js +1 -0
  160. package/.next/static/chunks/app/utilities/page-fb110c605c6dedb6.js +1 -0
  161. package/.next/static/chunks/{webpack-87d6f4f6cb0681d9.js → webpack-bf73daacb1b20997.js} +1 -1
  162. package/.next/static/css/eef5a7cce3f3a4b3.css +1 -0
  163. package/.next/trace +90 -90
  164. package/.next/types/app/api/utilities/install-archive/route.ts +347 -0
  165. package/.next/types/routes.d.ts +2 -1
  166. package/.next/types/validator.ts +9 -0
  167. package/dist/lib/reflex/agents/prompts.js +22 -0
  168. package/dist/lib/reflex/agents/prompts.js.map +1 -1
  169. package/dist/lib/reflex/prompts/defaults.js +6 -2
  170. package/dist/lib/reflex/prompts/defaults.js.map +1 -1
  171. package/package.json +2 -1
  172. package/.next/server/chunks/462.js +0 -3
  173. package/.next/server/chunks/5906.js +0 -1
  174. package/.next/server/chunks/9975.js +0 -1
  175. package/.next/static/FjPl5lLyObDgORD6F9-MK/_buildManifest.js +0 -1
  176. package/.next/static/chunks/1722-1f7df607ccd79308.js +0 -1
  177. package/.next/static/chunks/4088-7c72e188b9bde99b.js +0 -1
  178. package/.next/static/chunks/4108.7b6bc850cb87e9bc.js +0 -1
  179. package/.next/static/chunks/5757-9ae2804a278bf867.js +0 -1
  180. package/.next/static/chunks/6136-9bf50790263804d1.js +0 -1
  181. package/.next/static/chunks/7260-36ed6b2076b8a79f.js +0 -1
  182. package/.next/static/chunks/app/api/agents/[agentId]/respond/route-7e2f82a91b10b7e2.js +0 -1
  183. package/.next/static/chunks/app/api/images/[rootId]/[file]/route-7e2f82a91b10b7e2.js +0 -1
  184. package/.next/static/chunks/app/api/oauth/callback/route-7e2f82a91b10b7e2.js +0 -1
  185. package/.next/static/chunks/app/api/oauth/start/route-7e2f82a91b10b7e2.js +0 -1
  186. package/.next/static/chunks/app/api/roots/[id]/attachments/route-7e2f82a91b10b7e2.js +0 -1
  187. package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/send/route-7e2f82a91b10b7e2.js +0 -1
  188. package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stop/route-7e2f82a91b10b7e2.js +0 -1
  189. package/.next/static/chunks/app/api/roots/[id]/chat/[topicId]/stream/route-7e2f82a91b10b7e2.js +0 -1
  190. package/.next/static/chunks/app/api/roots/[id]/dashboard/route-7e2f82a91b10b7e2.js +0 -1
  191. package/.next/static/chunks/app/api/roots/[id]/suggestions/route-7e2f82a91b10b7e2.js +0 -1
  192. package/.next/static/chunks/app/api/utilities/[scope]/[id]/bundle.js/route-7e2f82a91b10b7e2.js +0 -1
  193. package/.next/static/chunks/app/api/utilities/[scope]/[id]/host/route-7e2f82a91b10b7e2.js +0 -1
  194. package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-api.mjs/route-7e2f82a91b10b7e2.js +0 -1
  195. package/.next/static/chunks/app/api/utilities/[scope]/[id]/host-ui.mjs/route-7e2f82a91b10b7e2.js +0 -1
  196. package/.next/static/chunks/app/api/utilities/[scope]/[id]/iframe/route-7e2f82a91b10b7e2.js +0 -1
  197. package/.next/static/chunks/app/api/utilities/[scope]/[id]/style.css/route-7e2f82a91b10b7e2.js +0 -1
  198. package/.next/static/chunks/app/layout-0d2ea0e793b0a0da.js +0 -1
  199. package/.next/static/chunks/app/onboarding/page-9ebf81ad78d9173a.js +0 -1
  200. package/.next/static/chunks/app/page-b926895e820623de.js +0 -1
  201. package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-1868f90d718dc449.js +0 -1
  202. package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-b112a20948212db8.js +0 -1
  203. package/.next/static/chunks/app/roots/[id]/layout-7e2f82a91b10b7e2.js +0 -1
  204. package/.next/static/chunks/app/roots/[id]/page-df2eddea266dab67.js +0 -1
  205. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-9dbebdc6cf006bf3.js +0 -1
  206. package/.next/static/chunks/app/roots/[id]/workflows/page-0f527d3f6b8ab4a0.js +0 -1
  207. package/.next/static/chunks/app/roots/new/page-c2ffb2099313f672.js +0 -1
  208. package/.next/static/chunks/app/settings/page-9ee28e7943ae7620.js +0 -1
  209. package/.next/static/chunks/app/share/[id]/page-1f5f909096557c29.js +0 -1
  210. package/.next/static/chunks/app/utilities/[scope]/[id]/page-3c6c50d24b9aa8a3.js +0 -1
  211. package/.next/static/chunks/app/utilities/page-0944fa72a82e7a76.js +0 -1
  212. package/.next/static/css/6144318015aa8092.css +0 -1
  213. /package/.next/static/{FjPl5lLyObDgORD6F9-MK → 1JOww-AoS7M9R4-h4i1EK}/_ssgManifest.js +0 -0
@@ -0,0 +1,347 @@
1
+ // File: /home/runner/work/reflex-agent/reflex-agent/app/api/utilities/install-archive/route.ts
2
+ import * as entry from '../../../../../../app/api/utilities/install-archive/route.js'
3
+ import type { NextRequest } from 'next/server.js'
4
+
5
+ type TEntry = typeof import('../../../../../../app/api/utilities/install-archive/route.js')
6
+
7
+ type SegmentParams<T extends Object = any> = T extends Record<string, any>
8
+ ? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
9
+ : T
10
+
11
+ // Check that the entry is a valid entry
12
+ checkFields<Diff<{
13
+ GET?: Function
14
+ HEAD?: Function
15
+ OPTIONS?: Function
16
+ POST?: Function
17
+ PUT?: Function
18
+ DELETE?: Function
19
+ PATCH?: Function
20
+ config?: {}
21
+ generateStaticParams?: Function
22
+ revalidate?: RevalidateRange<TEntry> | false
23
+ dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
24
+ dynamicParams?: boolean
25
+ fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
26
+ preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
27
+ runtime?: 'nodejs' | 'experimental-edge' | 'edge'
28
+ maxDuration?: number
29
+
30
+ }, TEntry, ''>>()
31
+
32
+ type RouteContext = { params: Promise<SegmentParams> }
33
+ // Check the prop type of the entry function
34
+ if ('GET' in entry) {
35
+ checkFields<
36
+ Diff<
37
+ ParamCheck<Request | NextRequest>,
38
+ {
39
+ __tag__: 'GET'
40
+ __param_position__: 'first'
41
+ __param_type__: FirstArg<MaybeField<TEntry, 'GET'>>
42
+ },
43
+ 'GET'
44
+ >
45
+ >()
46
+ checkFields<
47
+ Diff<
48
+ ParamCheck<RouteContext>,
49
+ {
50
+ __tag__: 'GET'
51
+ __param_position__: 'second'
52
+ __param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
53
+ },
54
+ 'GET'
55
+ >
56
+ >()
57
+
58
+ checkFields<
59
+ Diff<
60
+ {
61
+ __tag__: 'GET',
62
+ __return_type__: Response | void | never | Promise<Response | void | never>
63
+ },
64
+ {
65
+ __tag__: 'GET',
66
+ __return_type__: ReturnType<MaybeField<TEntry, 'GET'>>
67
+ },
68
+ 'GET'
69
+ >
70
+ >()
71
+ }
72
+ // Check the prop type of the entry function
73
+ if ('HEAD' in entry) {
74
+ checkFields<
75
+ Diff<
76
+ ParamCheck<Request | NextRequest>,
77
+ {
78
+ __tag__: 'HEAD'
79
+ __param_position__: 'first'
80
+ __param_type__: FirstArg<MaybeField<TEntry, 'HEAD'>>
81
+ },
82
+ 'HEAD'
83
+ >
84
+ >()
85
+ checkFields<
86
+ Diff<
87
+ ParamCheck<RouteContext>,
88
+ {
89
+ __tag__: 'HEAD'
90
+ __param_position__: 'second'
91
+ __param_type__: SecondArg<MaybeField<TEntry, 'HEAD'>>
92
+ },
93
+ 'HEAD'
94
+ >
95
+ >()
96
+
97
+ checkFields<
98
+ Diff<
99
+ {
100
+ __tag__: 'HEAD',
101
+ __return_type__: Response | void | never | Promise<Response | void | never>
102
+ },
103
+ {
104
+ __tag__: 'HEAD',
105
+ __return_type__: ReturnType<MaybeField<TEntry, 'HEAD'>>
106
+ },
107
+ 'HEAD'
108
+ >
109
+ >()
110
+ }
111
+ // Check the prop type of the entry function
112
+ if ('OPTIONS' in entry) {
113
+ checkFields<
114
+ Diff<
115
+ ParamCheck<Request | NextRequest>,
116
+ {
117
+ __tag__: 'OPTIONS'
118
+ __param_position__: 'first'
119
+ __param_type__: FirstArg<MaybeField<TEntry, 'OPTIONS'>>
120
+ },
121
+ 'OPTIONS'
122
+ >
123
+ >()
124
+ checkFields<
125
+ Diff<
126
+ ParamCheck<RouteContext>,
127
+ {
128
+ __tag__: 'OPTIONS'
129
+ __param_position__: 'second'
130
+ __param_type__: SecondArg<MaybeField<TEntry, 'OPTIONS'>>
131
+ },
132
+ 'OPTIONS'
133
+ >
134
+ >()
135
+
136
+ checkFields<
137
+ Diff<
138
+ {
139
+ __tag__: 'OPTIONS',
140
+ __return_type__: Response | void | never | Promise<Response | void | never>
141
+ },
142
+ {
143
+ __tag__: 'OPTIONS',
144
+ __return_type__: ReturnType<MaybeField<TEntry, 'OPTIONS'>>
145
+ },
146
+ 'OPTIONS'
147
+ >
148
+ >()
149
+ }
150
+ // Check the prop type of the entry function
151
+ if ('POST' in entry) {
152
+ checkFields<
153
+ Diff<
154
+ ParamCheck<Request | NextRequest>,
155
+ {
156
+ __tag__: 'POST'
157
+ __param_position__: 'first'
158
+ __param_type__: FirstArg<MaybeField<TEntry, 'POST'>>
159
+ },
160
+ 'POST'
161
+ >
162
+ >()
163
+ checkFields<
164
+ Diff<
165
+ ParamCheck<RouteContext>,
166
+ {
167
+ __tag__: 'POST'
168
+ __param_position__: 'second'
169
+ __param_type__: SecondArg<MaybeField<TEntry, 'POST'>>
170
+ },
171
+ 'POST'
172
+ >
173
+ >()
174
+
175
+ checkFields<
176
+ Diff<
177
+ {
178
+ __tag__: 'POST',
179
+ __return_type__: Response | void | never | Promise<Response | void | never>
180
+ },
181
+ {
182
+ __tag__: 'POST',
183
+ __return_type__: ReturnType<MaybeField<TEntry, 'POST'>>
184
+ },
185
+ 'POST'
186
+ >
187
+ >()
188
+ }
189
+ // Check the prop type of the entry function
190
+ if ('PUT' in entry) {
191
+ checkFields<
192
+ Diff<
193
+ ParamCheck<Request | NextRequest>,
194
+ {
195
+ __tag__: 'PUT'
196
+ __param_position__: 'first'
197
+ __param_type__: FirstArg<MaybeField<TEntry, 'PUT'>>
198
+ },
199
+ 'PUT'
200
+ >
201
+ >()
202
+ checkFields<
203
+ Diff<
204
+ ParamCheck<RouteContext>,
205
+ {
206
+ __tag__: 'PUT'
207
+ __param_position__: 'second'
208
+ __param_type__: SecondArg<MaybeField<TEntry, 'PUT'>>
209
+ },
210
+ 'PUT'
211
+ >
212
+ >()
213
+
214
+ checkFields<
215
+ Diff<
216
+ {
217
+ __tag__: 'PUT',
218
+ __return_type__: Response | void | never | Promise<Response | void | never>
219
+ },
220
+ {
221
+ __tag__: 'PUT',
222
+ __return_type__: ReturnType<MaybeField<TEntry, 'PUT'>>
223
+ },
224
+ 'PUT'
225
+ >
226
+ >()
227
+ }
228
+ // Check the prop type of the entry function
229
+ if ('DELETE' in entry) {
230
+ checkFields<
231
+ Diff<
232
+ ParamCheck<Request | NextRequest>,
233
+ {
234
+ __tag__: 'DELETE'
235
+ __param_position__: 'first'
236
+ __param_type__: FirstArg<MaybeField<TEntry, 'DELETE'>>
237
+ },
238
+ 'DELETE'
239
+ >
240
+ >()
241
+ checkFields<
242
+ Diff<
243
+ ParamCheck<RouteContext>,
244
+ {
245
+ __tag__: 'DELETE'
246
+ __param_position__: 'second'
247
+ __param_type__: SecondArg<MaybeField<TEntry, 'DELETE'>>
248
+ },
249
+ 'DELETE'
250
+ >
251
+ >()
252
+
253
+ checkFields<
254
+ Diff<
255
+ {
256
+ __tag__: 'DELETE',
257
+ __return_type__: Response | void | never | Promise<Response | void | never>
258
+ },
259
+ {
260
+ __tag__: 'DELETE',
261
+ __return_type__: ReturnType<MaybeField<TEntry, 'DELETE'>>
262
+ },
263
+ 'DELETE'
264
+ >
265
+ >()
266
+ }
267
+ // Check the prop type of the entry function
268
+ if ('PATCH' in entry) {
269
+ checkFields<
270
+ Diff<
271
+ ParamCheck<Request | NextRequest>,
272
+ {
273
+ __tag__: 'PATCH'
274
+ __param_position__: 'first'
275
+ __param_type__: FirstArg<MaybeField<TEntry, 'PATCH'>>
276
+ },
277
+ 'PATCH'
278
+ >
279
+ >()
280
+ checkFields<
281
+ Diff<
282
+ ParamCheck<RouteContext>,
283
+ {
284
+ __tag__: 'PATCH'
285
+ __param_position__: 'second'
286
+ __param_type__: SecondArg<MaybeField<TEntry, 'PATCH'>>
287
+ },
288
+ 'PATCH'
289
+ >
290
+ >()
291
+
292
+ checkFields<
293
+ Diff<
294
+ {
295
+ __tag__: 'PATCH',
296
+ __return_type__: Response | void | never | Promise<Response | void | never>
297
+ },
298
+ {
299
+ __tag__: 'PATCH',
300
+ __return_type__: ReturnType<MaybeField<TEntry, 'PATCH'>>
301
+ },
302
+ 'PATCH'
303
+ >
304
+ >()
305
+ }
306
+
307
+ // Check the arguments and return type of the generateStaticParams function
308
+ if ('generateStaticParams' in entry) {
309
+ checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
310
+ checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
311
+ }
312
+
313
+ export interface PageProps {
314
+ params?: Promise<SegmentParams>
315
+ searchParams?: Promise<any>
316
+ }
317
+ export interface LayoutProps {
318
+ children?: React.ReactNode
319
+
320
+ params?: Promise<SegmentParams>
321
+ }
322
+
323
+ // =============
324
+ // Utility types
325
+ type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
326
+
327
+ // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
328
+ type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
329
+ type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
330
+
331
+ type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
332
+ type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
333
+ type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
334
+
335
+ type ParamCheck<T> = {
336
+ __tag__: string
337
+ __param_position__: string
338
+ __param_type__: T
339
+ }
340
+
341
+ function checkFields<_ extends { [k in keyof any]: never }>() {}
342
+
343
+ // https://github.com/sindresorhus/type-fest
344
+ type Numeric = number | bigint
345
+ type Zero = 0 | 0n
346
+ type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
347
+ type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
@@ -2,7 +2,7 @@
2
2
  // Do not edit this file manually
3
3
 
4
4
  type AppRoutes = "/" | "/agents/[agentId]" | "/audit" | "/onboarding" | "/roots/[id]" | "/roots/[id]/chat/[topicId]" | "/roots/[id]/kb/[...slug]" | "/roots/[id]/memory" | "/roots/[id]/workflows" | "/roots/[id]/workflows/[wfId]" | "/roots/new" | "/settings" | "/share/[id]" | "/share/[id]/file" | "/utilities" | "/utilities/[scope]/[id]"
5
- type AppRouteHandlerRoutes = "/api/agents/[agentId]/respond" | "/api/images/[rootId]/[file]" | "/api/oauth/callback" | "/api/oauth/start" | "/api/roots/[id]/attachments" | "/api/roots/[id]/chat/[topicId]/send" | "/api/roots/[id]/chat/[topicId]/stop" | "/api/roots/[id]/chat/[topicId]/stream" | "/api/roots/[id]/dashboard" | "/api/roots/[id]/suggestions" | "/api/utilities/[scope]/[id]/bundle.js" | "/api/utilities/[scope]/[id]/host" | "/api/utilities/[scope]/[id]/host-api.mjs" | "/api/utilities/[scope]/[id]/host-ui.mjs" | "/api/utilities/[scope]/[id]/iframe" | "/api/utilities/[scope]/[id]/style.css"
5
+ type AppRouteHandlerRoutes = "/api/agents/[agentId]/respond" | "/api/images/[rootId]/[file]" | "/api/oauth/callback" | "/api/oauth/start" | "/api/roots/[id]/attachments" | "/api/roots/[id]/chat/[topicId]/send" | "/api/roots/[id]/chat/[topicId]/stop" | "/api/roots/[id]/chat/[topicId]/stream" | "/api/roots/[id]/dashboard" | "/api/roots/[id]/suggestions" | "/api/utilities/[scope]/[id]/bundle.js" | "/api/utilities/[scope]/[id]/host" | "/api/utilities/[scope]/[id]/host-api.mjs" | "/api/utilities/[scope]/[id]/host-ui.mjs" | "/api/utilities/[scope]/[id]/iframe" | "/api/utilities/[scope]/[id]/style.css" | "/api/utilities/install-archive"
6
6
  type PageRoutes = never
7
7
  type LayoutRoutes = "/" | "/roots/[id]"
8
8
  type RedirectRoutes = never
@@ -29,6 +29,7 @@ interface ParamMap {
29
29
  "/api/utilities/[scope]/[id]/host-ui.mjs": { "scope": string; "id": string; }
30
30
  "/api/utilities/[scope]/[id]/iframe": { "scope": string; "id": string; }
31
31
  "/api/utilities/[scope]/[id]/style.css": { "scope": string; "id": string; }
32
+ "/api/utilities/install-archive": {}
32
33
  "/audit": {}
33
34
  "/onboarding": {}
34
35
  "/roots/[id]": { "id": string; }
@@ -335,6 +335,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
335
335
  type __Unused = __Check
336
336
  }
337
337
 
338
+ // Validate ../../app/api/utilities/install-archive/route.ts
339
+ {
340
+ type __IsExpected<Specific extends RouteHandlerConfig<"/api/utilities/install-archive">> = Specific
341
+ const handler = {} as typeof import("../../app/api/utilities/install-archive/route.js")
342
+ type __Check = __IsExpected<typeof handler>
343
+ // @ts-ignore
344
+ type __Unused = __Check
345
+ }
346
+
338
347
 
339
348
 
340
349
 
@@ -42,8 +42,30 @@ export async function chatSystemPrompt(scope) {
42
42
  skillAuthoringInstructions(),
43
43
  taskAuthoringInstructions(),
44
44
  appBuildRoutingInstructions(),
45
+ notifyInstructions(),
45
46
  ].join("\n\n");
46
47
  }
48
+ /**
49
+ * Proactive reach. When a long/background task finishes or something
50
+ * genuinely needs the user (and they may not have a tab open), the agent
51
+ * can ping their configured channels (Telegram, …). Harmless no-op when
52
+ * nothing is configured.
53
+ */
54
+ function notifyInstructions() {
55
+ return [
56
+ "## Reaching the user outside the app",
57
+ "",
58
+ "If a long-running or scheduled task finishes, or something needs the user's attention and they likely don't have Reflex open, you can push a short message to their configured channels (Telegram, etc.):",
59
+ "",
60
+ "```",
61
+ `<<reflex:notify>>{"title":"Digest ready","body":"3 new items in your morning digest","link":"optional url"}<</reflex:notify>>`,
62
+ "```",
63
+ "",
64
+ "- `body` is required; `title` and `link` are optional.",
65
+ "- Use sparingly — for completions, alerts, and things worth interrupting for. Not for every reply (the user already sees those in chat).",
66
+ "- No-op if the user hasn't set up a channel, so it's safe to emit when warranted.",
67
+ ].join("\n");
68
+ }
47
69
  /**
48
70
  * Disambiguation guard for "build me an app / tool / bot / integration"
49
71
  * requests. Reflex's flagship output is a *utility* (a mini-app that
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../lib/reflex/agents/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEnC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAmB;IACrD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;IAC/D,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;IACpD,MAAM,QAAQ,GACZ,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,aAAa;QAChC,CAAC,CAAC,UAAU,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,aAAa,0BAA0B;QACxE,CAAC,CAAC,EAAE,CAAC;IACT,OAAO,cAAc,CAAC,QAAQ,EAAE;QAC9B,QAAQ,EAAE,KAAK,CAA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B;QAC3B,KAAK;QACL,EAAE;QACF,WAAW;QACX,EAAE;QACF,gIAAgI;QAChI,sLAAsL;QACtL,gKAAgK;QAChK,+IAA+I;QAC/I,gFAAgF;QAChF,qFAAqF;QACrF,EAAE;QACF,aAAa;QACb,EAAE;QACF,gNAAgN;QAChN,EAAE;QACF,0lBAA0lB;QAC1lB,EAAE;QACF,sHAAsH;KACvH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAS,yBAAyB;IAChC,OAAO;QACL,4CAA4C;QAC5C,EAAE;QACF,6ZAA6Z;QAC7Z,EAAE;QACF,KAAK;QACL,yBAAyB;QACzB,wCAAwC;QACxC,uGAAuG;QACvG,yGAAyG;QACzG,oFAAoF;QACpF,0CAA0C;QAC1C,+BAA+B;QAC/B,+CAA+C;QAC/C,0BAA0B;QAC1B,KAAK;QACL,EAAE;QACF,uSAAuS;QACvS,EAAE;QACF,KAAK;QACL,yBAAyB;QACzB,gBAAgB;QAChB,cAAc;QACd,uBAAuB;QACvB,sEAAsE;QACtE,KAAK;QACL,0BAA0B;QAC1B,KAAK;QACL,EAAE;QACF,QAAQ;QACR,4FAA4F;QAC5F,qJAAqJ;QACrJ,mIAAmI;QACnI,uEAAuE;QACvE,iFAAiF;KAClF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../lib/reflex/agents/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEnC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAmB;IACrD,MAAM,QAAQ,GAAG,MAAM,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AC1C,+BAA+B;QAC/B,+CAA+C;QAC/C,0BAA0B;QAC1B,KAAK;QACL,EAAE;QACF,uSAAuS;QACvS,EAAE;QACF,KAAK;QACL,yBAAyB;QACzB,gBAAgB;QAChB,cAAc;QACd,uBAAuB;QACvB,sEAAsE;QACtE,KAAK;QACL,0BAA0B;QAC1B,KAAK;QACL,EAAE;QACF,QAAQ;QACR,4FAA4F;QAC5F,qJAAqJ;QACrJ,mIAAmI;QACnI,uEAAuE;QACvE,iFAAiF;KAClF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -218,9 +218,12 @@ To create a utility, emit a marker:
218
218
  2. **Imports ONLY**:
219
219
  - \`"react"\`, \`"react-dom"\`, \`"react-dom/client"\` — resolved by the bundler.
220
220
  - \`"@host/api"\` — gives the \`{ reflex }\` object (see below).
221
- - \`"@host/ui"\` — gives primitives: Button, Input, Textarea, Label, Card, CardContent, CardHeader, CardTitle, Badge, ScrollArea.
222
- - No other packages / node_modules / node:* modules. esbuild rejects any other import.
221
+ - \`"@host/ui"\` — primitives (Button, Input, Textarea, Label, Card, CardContent, CardHeader, CardTitle, Badge, ScrollArea) + a router (\`RouterView\`, \`useReflexRoute\`) for multi-view utilities.
222
+ - npm packages declared in \`manifest.dependencies\` (bundled from esm.sh at build). \`node:*\` modules are always rejected; an undeclared bare import is a build error.
223
223
  3. **No fetch/XHR/WebSocket/localStorage** inside the utility. Only \`reflex.web.fetch({url})\` with an explicitly whitelisted domain in the manifest. To DISPLAY external images via \`<img src>\`, list their hosts in \`permissions.images.domains\` — the CSP blocks any host not on that list.
224
+ - **Third-party packages**: declare them in \`manifest.dependencies\` (e.g. \`{"dayjs":"1.11.10"}\`) — they're fetched from esm.sh and bundled AT BUILD TIME (nothing loads at runtime). Pin exact versions, pure-JS/ESM only. A bare import not listed (and not react/@host) is a build error.
225
+ - **Server actions**: any top-level \`actions/<name>.ts\` is auto-registered (no need to hand-list in \`serverActions\` unless you want a custom timeout). \`_\`-prefixed files are private helpers.
226
+ - **Multiple views**: import \`{ RouterView, useReflexRoute }\` from \`@host/ui\` for in-iframe navigation instead of hand-rolling view state.
224
227
  4. **State** is persisted via \`reflex.fs.write({path, content})\` (in \`<utility>/data/\`) or \`reflex.kb.add({...})\`.
225
228
  5. **Manifest** must list every required permission — the user sees this list at install time and can refuse.
226
229
 
@@ -233,6 +236,7 @@ To create a utility, emit a marker:
233
236
  "description": "What the utility does",
234
237
  "version": "1.0.0",
235
238
  "ui": "ui.tsx",
239
+ "dependencies": {"dayjs": "1.11.10"},
236
240
  "permissions": {
237
241
  "llm": {"tasks": ["chat", "quick"]},
238
242
  "kb": {"read": true, "write": true, "kinds": ["3d-model"]},
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../../lib/reflex/prompts/defaults.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,eAAe,GAAiC;IAC3D,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,eAAe;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAmC;IAChE,OAAO,EAAE;QACP,UAAU;QACV,MAAM;QACN,OAAO;QACP,UAAU;QACV,aAAa;QACb,OAAO;QACP,WAAW;QACX,UAAU;KACX;IACD,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;CACnD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAiC;IAC7D,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DV;IAEC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACA,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reflex-agent",
3
- "version": "0.13.5",
3
+ "version": "0.15.0",
4
4
  "private": false,
5
5
  "description": "Local-first knowledge base built by an agent over a chosen directory.",
6
6
  "license": "MIT",
@@ -57,6 +57,7 @@
57
57
  "commander": "^14",
58
58
  "esbuild": "^0.28.0",
59
59
  "execa": "^9",
60
+ "fflate": "^0.8.3",
60
61
  "gray-matter": "^4.0.3",
61
62
  "highlight.js": "^11.11.1",
62
63
  "ignore": "^7",
@@ -1,3 +0,0 @@
1
- "use strict";exports.id=462,exports.ids=[462],exports.modules={12650:(a,b,c)=>{c.d(b,{E:()=>f});var d=c(64173),e=c(91344);function f({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"skeleton",className:(0,e.cn)("animate-pulse rounded-md bg-accent",a),...b})}},14425:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},15620:(a,b,c)=>{c.d(b,{CommandBar:()=>o});var d=c(64173),e=c(17240),f=c(87671),g=c(71813),h=c(73569),i=c(44052),j=c(77823),k=c(61466),l=c(8836),m=c(88724),n=c(41631);function o({rootId:a,focusFile:b}){let c=(0,g.c)("roots"),[,o]=(0,e.useTransition)(),p=(0,f.useRouter)();return(0,d.jsx)(l.E,{label:c("commandBar.label"),children:(0,d.jsx)(n.L,{rootId:a,placeholder:c("commandBar.placeholder"),submitLabel:c("commandBar.submit"),pendingLabel:c("commandBar.submitPending"),SubmitIcon:h.A,onSubmit:async({message:d,attachments:e})=>await new Promise(f=>{o(async()=>{let g=await (0,j.g)(a,d,e,b);if(!g.ok){i.oR.error(g.error??c("commandBar.startFailed")),f(!1);return}(0,m.$d)(m.Zi.topicsChanged(a)),d.trim()&&(0,k.h)(a,g.topicId,d).then(b=>{b.ok&&(0,m.$d)(m.Zi.topicsChanged(a))}),p.push(`/roots/${a}/chat/${g.topicId}`),f(!0)})})})})}},16551:(a,b,c)=>{c.d(b,{Xi:()=>k,av:()=>l,j7:()=>j,tU:()=>h});var d=c(64173);c(17240);var e=c(20483),f=c(61193),g=c(91344);function h({className:a,orientation:b="horizontal",...c}){return(0,d.jsx)(f.Root,{"data-slot":"tabs","data-orientation":b,orientation:b,className:(0,g.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",a),...c})}let i=(0,e.F)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function j({className:a,variant:b="default",...c}){return(0,d.jsx)(f.List,{"data-slot":"tabs-list","data-variant":b,className:(0,g.cn)(i({variant:b}),a),...c})}function k({className:a,...b}){return(0,d.jsx)(f.Trigger,{"data-slot":"tabs-trigger",className:(0,g.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",a),...b})}function l({className:a,...b}){return(0,d.jsx)(f.Content,{"data-slot":"tabs-content",className:(0,g.cn)("flex-1 outline-none",a),...b})}},16805:(a,b,c)=>{c.d(b,{ShareButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call ShareButton() from the server but ShareButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/_components/share-button.tsx","ShareButton")},27129:(a,b,c)=>{c.d(b,{Cz:()=>k,IK:()=>l,hN:()=>j,uA:()=>i});var d=c(73745);c(66493);var e=c(56942),f=c(53905),g=c(84579),h=c(91388);async function i(a){try{let b,c=await (0,g.generateImage)({rootId:a.rootId,prompt:a.prompt,...a.provider?{provider:a.provider}:{},...a.aspectRatio?{aspectRatio:a.aspectRatio}:{},...a.alt?{alt:a.alt}:{}}),d=n(a.alt||a.prompt),e=`![${d}](${c.urlPath})`;return a.attachToKb&&(b=await m(a.rootId,{title:a.alt||a.prompt.slice(0,80),markdown:e,meta:{provider:c.provider,prompt:a.prompt,sha:c.sha,...a.aspectRatio?{aspectRatio:a.aspectRatio}:{}}})),{ok:!0,url:c.urlPath,sha:c.sha,markdown:e,...b?{kbRelPath:b}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function j(a){try{let b=await (0,g.searchImages)({query:a.query,...a.provider?{provider:a.provider}:{},...a.count?{count:a.count}:{}});return{ok:!0,results:b}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function k(a){try{let b,c=await (0,g.attachRemote)({rootId:a.rootId,sourceUrl:a.sourceUrl}),d=n(a.alt||"image"),e=a.attribution?`
2
-
3
- _Photo: [${a.attribution.name}](${a.attribution.link})_`:"",f=`![${d}](${c.urlPath})${e}`;return a.attachToKb&&(b=await m(a.rootId,{title:a.alt||"Found image",markdown:f,meta:{source:"web",sourceUrl:a.sourceUrl,sha:c.sha,...a.attribution?{author:a.attribution.name,authorUrl:a.attribution.link}:{}}})),{ok:!0,url:c.urlPath,sha:c.sha,markdown:f,...b?{kbRelPath:b}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function l(a){try{let b,c=Buffer.from(a.base64,"base64");if(0===c.byteLength)return{ok:!1,error:"Empty upload"};if(!a.mime.startsWith("image/"))return{ok:!1,error:`Unsupported mime: ${a.mime}`};let d=await (0,h.YN)(a.rootId,c,a.mime),e=n(a.alt||"image"),f=`![${e}](${d.urlPath})`;return a.attachToKb&&(b=await m(a.rootId,{title:a.alt||"Uploaded image",markdown:f,meta:{source:"upload",sha:d.sha,mime:a.mime}})),{ok:!0,url:d.urlPath,sha:d.sha,markdown:f,...b?{kbRelPath:b}:{}}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function m(a,b){let c=await (0,f.Zn)(a);if(!c)throw Error(`unknown rootId: ${a}`);return(await (0,e.j)({rootPath:c.path,directive:{kind:"image",title:b.title,body:b.markdown,meta:b.meta}})).relPath}function n(a){return a.replace(/[\[\]\n]/g," ").slice(0,200)}(0,c(63781).D)([i,j,k,l]),(0,d.A)(i,"40b8fd9aca22a899a2671a6bcd068db60bb4af4d41",null),(0,d.A)(j,"408399ca6bed9adb61cd28a87f8cdba1af1972599e",null),(0,d.A)(k,"404476436d9cba7a8ed511de7fcc11ca777ddd37e1",null),(0,d.A)(l,"40dfb25f67bf96437f6566142f8f4d373021d74aa7",null)},29130:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},49335:(a,b,c)=>{c.d(b,{ShareButton:()=>p});var d=c(64173),e=c(17240);let f=(0,c(42557).A)("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);var g=c(12619),h=c(28082),i=c(66979),j=c(42324),k=c(44052),l=c(71813),m=c(3265);let n=(0,m.createServerReference)("4045ba78e573d7efed1a4fbcb5e9177a992f2d8a5c",m.callServer,void 0,m.findSourceMapURL,"createShareAction");var o=c(56550);function p(a){let b=(0,l.c)("app"),[c,m]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useTransition)(),[t,u]=(0,e.useState)(null);return c?t?(0,d.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-700",children:[(0,d.jsx)(g.A,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"font-medium",children:b("share.button.createdTitle")})]}),(0,d.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"block font-mono text-[11px] text-violet-700 hover:underline break-all",children:t.url}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(t.url).then(()=>k.oR.success(b("share.button.copied"))),className:"inline-flex items-center gap-1 rounded border px-2 py-0.5 hover:bg-accent",children:[(0,d.jsx)(h.A,{className:"h-3 w-3"}),b("share.button.copy")]}),(0,d.jsx)("button",{type:"button",onClick:()=>{u(null),m(!1),q("")},className:"text-muted-foreground hover:text-foreground",children:b("share.button.done")})]})]}):(0,d.jsxs)("div",{className:"rounded border bg-card p-2 text-xs space-y-1.5 w-full max-w-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(f,{className:"h-3.5 w-3.5 text-violet-600"}),(0,d.jsx)("span",{className:"font-medium",children:b("share.button.newLink")}),(0,d.jsx)("button",{type:"button",onClick:()=>m(!1),className:"ml-auto text-muted-foreground hover:text-foreground",children:(0,d.jsx)(i.A,{className:"h-3 w-3"})})]}),(0,d.jsx)("label",{className:"block text-[10px] text-muted-foreground",children:b("share.button.passwordLabel")}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(j.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,d.jsx)("input",{type:"password",value:p,onChange:a=>q(a.target.value),autoFocus:!0,placeholder:b("share.button.passwordPlaceholder"),className:"w-full rounded border bg-background pl-6 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{s(async()=>{let c=await (0,o.N)(),d=await n({kind:a.kind,...a.rootId?{rootId:a.rootId}:{},...a.utilityScope?{utilityScope:a.utilityScope}:{},...a.utilityId?{utilityId:a.utilityId}:{},...a.kbRelPath?{kbRelPath:a.kbRelPath}:{},...a.label?{label:a.label}:{},...p.trim()?{password:p.trim()}:{}});if(!d.ok)return void k.oR.error(d.error);let e=c.status.publicUrl??window.location.origin,f=new URL(`/share/${d.share.id}`,e).toString();u({share:d.share,url:f}),navigator.clipboard.writeText(f).catch(()=>null),k.oR.success(c.status.running?b("share.button.created"):b("share.button.createdNoTunnel"))})},disabled:r,className:"w-full rounded bg-violet-600 text-white px-2 py-1 hover:bg-violet-700 disabled:opacity-50 inline-flex items-center justify-center gap-1",children:r?b("share.button.creating"):b("share.button.create")}),(0,d.jsx)("p",{className:"text-[10px] text-muted-foreground",children:b("share.button.footer")})]}):(0,d.jsxs)("button",{type:"button",onClick:()=>m(!0),className:a.iconOnly?"p-1 rounded hover:bg-accent text-muted-foreground hover:text-violet-700":"inline-flex items-center gap-1 rounded border px-2 py-1 text-xs hover:bg-accent",title:b("share.button.title"),children:[(0,d.jsx)(f,{className:"h-3.5 w-3.5"}),!a.iconOnly&&b("share.button.label")]})}},61466:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(3265);let e=(0,d.createServerReference)("70c7696134251d1c3fcccceb55dc1bb902a0ba21bb",d.callServer,void 0,d.findSourceMapURL,"generateTopicTitleAction")},68336:(a,b,c)=>{c.d(b,{InsertImageButton:()=>C});var d=c(64173),e=c(17240),f=c(87671),g=c(29130),h=c(71813),i=c(20583),j=c(66979),k=c(69552),l=c(65943);let m=(0,c(42557).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var n=c(44052),o=c(47071),p=c(45477),q=c(80281),r=c(71155),s=c(16551),t=c(27456),u=c(12650),v=c(3265);let w=(0,v.createServerReference)("40b8fd9aca22a899a2671a6bcd068db60bb4af4d41",v.callServer,void 0,v.findSourceMapURL,"generateAction"),x=(0,v.createServerReference)("408399ca6bed9adb61cd28a87f8cdba1af1972599e",v.callServer,void 0,v.findSourceMapURL,"searchAction"),y=(0,v.createServerReference)("404476436d9cba7a8ed511de7fcc11ca777ddd37e1",v.callServer,void 0,v.findSourceMapURL,"attachAction"),z=(0,v.createServerReference)("40dfb25f67bf96437f6566142f8f4d373021d74aa7",v.callServer,void 0,v.findSourceMapURL,"uploadAction"),A=["1:1","16:9","9:16","4:3","3:4","21:9"];function B({rootId:a,open:b,onOpenChange:c,onInsert:f}){let v=(0,h.c)("app"),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)("gemini"),[F,G]=(0,e.useState)("1:1"),[H,I]=(0,e.useState)(!0),[J,K]=(0,e.useState)(null),[L,M]=(0,e.useTransition)(),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)("unsplash"),[R,S]=(0,e.useState)([]),[T,U]=(0,e.useTransition)(),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)(!0),[Z,$]=(0,e.useState)(""),[_,aa]=(0,e.useState)(!0),[ab,ac]=(0,e.useTransition)();if(!b)return null;let ad=()=>{N.trim()&&(S([]),U(async()=>{let b=await x({rootId:a,query:N.trim(),provider:P,count:12});if(!b.ok)return void n.oR.error(b.error);S(b.results)}))};return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&c(!1)},children:[(0,d.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:()=>c(!1)}),(0,d.jsxs)("div",{className:"relative bg-card border rounded-lg shadow-xl w-full max-w-3xl max-h-[85vh] flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b",children:[(0,d.jsx)(g.A,{className:"h-4 w-4 text-violet-600"}),(0,d.jsx)("h2",{className:"text-sm font-medium flex-1",children:v("images.titleHeader")}),(0,d.jsx)(i.$,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>c(!1),children:(0,d.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,d.jsxs)(s.tU,{defaultValue:"generate",className:"flex-1 min-h-0 flex flex-col",children:[(0,d.jsxs)(s.j7,{className:"mx-4 mt-3 self-start",children:[(0,d.jsxs)(s.Xi,{value:"generate",children:[(0,d.jsx)(k.A,{className:"mr-1 h-3.5 w-3.5"})," ",v("images.tabGenerate")]}),(0,d.jsxs)(s.Xi,{value:"search",children:[(0,d.jsx)(l.A,{className:"mr-1 h-3.5 w-3.5"})," ",v("images.tabSearch")]}),(0,d.jsxs)(s.Xi,{value:"upload",children:[(0,d.jsx)(m,{className:"mr-1 h-3.5 w-3.5"})," ",v("images.tabUpload")]})]}),(0,d.jsxs)(t.F,{className:"flex-1 min-h-0",children:[(0,d.jsxs)(s.av,{value:"generate",className:"px-4 py-4 space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{htmlFor:"img-prompt",children:v("images.promptLabel")}),(0,d.jsx)(p.T,{id:"img-prompt",value:B,onChange:a=>C(a.target.value),placeholder:v("images.promptPlaceholder"),rows:4})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{children:v("images.providerLabel")}),(0,d.jsxs)(r.l6,{value:D,onValueChange:a=>E(a),children:[(0,d.jsx)(r.bq,{children:(0,d.jsx)(r.yv,{})}),(0,d.jsxs)(r.gC,{children:[(0,d.jsx)(r.eb,{value:"gemini",children:"Gemini Nano Banana"}),(0,d.jsx)(r.eb,{value:"codex",children:"Codex $imagegen"})]})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{children:v("images.aspectLabel")}),(0,d.jsxs)(r.l6,{value:F,onValueChange:G,children:[(0,d.jsx)(r.bq,{children:(0,d.jsx)(r.yv,{})}),(0,d.jsx)(r.gC,{children:A.map(a=>(0,d.jsx)(r.eb,{value:a,children:a},a))})]})]})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked)}),v("images.saveToKb")]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(i.$,{type:"button",size:"sm",onClick:()=>{B.trim()&&(K(null),M(async()=>{let b=await w({rootId:a,prompt:B.trim(),provider:D,aspectRatio:F,attachToKb:H});if(!b.ok)return void n.oR.error(b.error);K({url:b.url,markdown:b.markdown,...b.kbRelPath?{kbRelPath:b.kbRelPath}:{}})}))},disabled:L||!B.trim(),children:L?v("images.generating"):v("images.generate")}),L&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:v("images.takesAMinute")})]}),L?(0,d.jsx)(u.E,{className:"h-64 w-full"}):J?(0,d.jsxs)("div",{className:"space-y-2 border rounded p-3",children:[(0,d.jsx)("img",{src:J.url,alt:B,className:"max-h-80 mx-auto rounded"}),(0,d.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,d.jsx)(i.$,{type:"button",size:"sm",variant:"outline",onClick:()=>K(null),children:v("images.again")}),(0,d.jsx)(i.$,{type:"button",size:"sm",onClick:()=>{J&&(f?.(J),n.oR.success(J.kbRelPath?v("images.savedToKb",{path:J.kbRelPath}):v("images.ready")),c(!1))},children:v("images.insert")})]})]}):null]}),(0,d.jsxs)(s.av,{value:"search",className:"px-4 py-4 space-y-3",children:[(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(o.p,{value:N,onChange:a=>O(a.target.value),placeholder:v("images.searchPlaceholder"),onKeyDown:a=>{"Enter"===a.key&&ad()}}),(0,d.jsxs)(r.l6,{value:P,onValueChange:a=>Q(a),children:[(0,d.jsx)(r.bq,{className:"w-36",children:(0,d.jsx)(r.yv,{})}),(0,d.jsxs)(r.gC,{children:[(0,d.jsx)(r.eb,{value:"unsplash",children:"Unsplash"}),(0,d.jsx)(r.eb,{value:"pexels",children:"Pexels"}),(0,d.jsx)(r.eb,{value:"brave",children:v("images.braveWeb")})]})]}),(0,d.jsx)(i.$,{type:"button",size:"sm",onClick:ad,disabled:T||!N.trim(),children:v("images.find")})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:X,onChange:a=>Y(a.target.checked)}),v("images.saveToKb")]}),T&&0===R.length?(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:Array.from({length:6}).map((a,b)=>(0,d.jsx)(u.E,{className:"h-32 w-full"},b))}):R.length>0?(0,d.jsx)("div",{className:"grid grid-cols-3 gap-2",children:R.map(b=>(0,d.jsxs)("button",{type:"button",disabled:null!==V,onClick:()=>{W(b.url),U(async()=>{let d=await y({rootId:a,sourceUrl:b.url,alt:N.trim()||"image",attribution:b.attribution,attachToKb:X});if(W(null),!d.ok)return void n.oR.error(d.error);f?.({url:d.url,markdown:d.markdown,...d.kbRelPath?{kbRelPath:d.kbRelPath}:{}}),n.oR.success(d.kbRelPath?v("images.savedToKb",{path:d.kbRelPath}):v("images.savedToProject")),c(!1)})},className:"group relative overflow-hidden rounded border hover:border-violet-500 disabled:opacity-50",title:`${b.attribution.name} \xb7 ${b.provider}`,children:[(0,d.jsx)("img",{src:b.thumb,alt:"",className:"h-32 w-full object-cover"}),(0,d.jsx)("div",{className:"absolute bottom-0 inset-x-0 px-1.5 py-0.5 text-[10px] bg-black/60 text-white truncate",children:b.attribution.name}),V===b.url&&(0,d.jsx)("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center text-xs text-white",children:v("images.saving")})]},b.url))}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:v("images.noKeys")})]}),(0,d.jsxs)(s.av,{value:"upload",className:"px-4 py-4 space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{htmlFor:"img-alt",children:v("images.altLabel")}),(0,d.jsx)(o.p,{id:"img-alt",value:Z,onChange:a=>$(a.target.value),placeholder:v("images.altPlaceholder")})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:_,onChange:a=>aa(a.target.checked)}),v("images.saveToKb")]}),(0,d.jsx)(o.p,{type:"file",accept:"image/*",disabled:ab,onChange:b=>{let d=b.target.files?.[0];d&&ac(async()=>{let b=function(a){let b=new Uint8Array(a),c="";for(let a=0;a<b.length;a+=32768){let d=b.subarray(a,a+32768);c+=String.fromCharCode.apply(null,Array.from(d))}return btoa(c)}(await d.arrayBuffer()),e=await z({rootId:a,base64:b,mime:d.type,alt:Z||d.name.replace(/\.[^.]+$/,""),attachToKb:_});if(!e.ok)return void n.oR.error(e.error);f?.({url:e.url,markdown:e.markdown,...e.kbRelPath?{kbRelPath:e.kbRelPath}:{}}),n.oR.success(e.kbRelPath?v("images.savedToKb",{path:e.kbRelPath}):v("images.uploaded")),c(!1)})}}),ab&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:v("images.uploading")})]})]})]})]})]})}function C({rootId:a,redirectToKb:b=!0}){let[c,j]=(0,e.useState)(!1),k=(0,f.useRouter)(),l=(0,h.c)("app");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>j(!0),children:[(0,d.jsx)(g.A,{className:"mr-1 h-4 w-4"})," ",l("images.button")]}),(0,d.jsx)(B,{rootId:a,open:c,onOpenChange:j,onInsert:({kbRelPath:c})=>{if(b&&c){let b=c.split("/").map(encodeURIComponent).join("/");k.push(`/roots/${a}/kb/${b}`)}}})]})}},71155:(a,b,c)=>{c.d(b,{bq:()=>l,eb:()=>n,gC:()=>m,l6:()=>j,yv:()=>k});var d=c(64173);c(17240);var e=c(58405),f=c(12619),g=c(78724),h=c(13976),i=c(91344);function j({...a}){return(0,d.jsx)(h.Root,{"data-slot":"select",...a})}function k({...a}){return(0,d.jsx)(h.Value,{"data-slot":"select-value",...a})}function l({className:a,size:b="default",children:c,...f}){return(0,d.jsxs)(h.Trigger,{"data-slot":"select-trigger","data-size":b,className:(0,i.cn)("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",a),...f,children:[c,(0,d.jsx)(h.Icon,{asChild:!0,children:(0,d.jsx)(e.A,{className:"size-4 opacity-50"})})]})}function m({className:a,children:b,position:c="item-aligned",align:e="center",...f}){return(0,d.jsx)(h.Portal,{children:(0,d.jsxs)(h.Content,{"data-slot":"select-content",className:(0,i.cn)("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","popper"===c&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:c,align:e,...f,children:[(0,d.jsx)(o,{}),(0,d.jsx)(h.Viewport,{className:(0,i.cn)("p-1","popper"===c&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:b}),(0,d.jsx)(p,{})]})})}function n({className:a,children:b,...c}){return(0,d.jsxs)(h.Item,{"data-slot":"select-item",className:(0,i.cn)("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",a),...c,children:[(0,d.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,d.jsx)(h.ItemIndicator,{children:(0,d.jsx)(f.A,{className:"size-4"})})}),(0,d.jsx)(h.ItemText,{children:b})]})}function o({className:a,...b}){return(0,d.jsx)(h.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,d.jsx)(g.A,{className:"size-4"})})}function p({className:a,...b}){return(0,d.jsx)(h.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,d.jsx)(e.A,{className:"size-4"})})}},77823:(a,b,c)=>{c.d(b,{g:()=>e});var d=c(3265);let e=(0,d.createServerReference)("7892ede80f585746906d1bb2d8473c9b863c8513db",d.callServer,void 0,d.findSourceMapURL,"startTopicAction")},78724:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(42557).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},86673:(a,b,c)=>{c.d(b,{InsertImageButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call InsertImageButton() from the server but InsertImageButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/_components/kb/insert-image-button.tsx","InsertImageButton")},88842:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(19963).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])}};