@sleep2agi/agent-network-dashboard 0.6.3-preview.37 → 0.6.3-preview.39

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 (203) hide show
  1. package/.next/BUILD_COMMIT +1 -1
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/diagnostics/route-bundle-stats.json +14 -14
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +2 -2
  15. package/.next/server/app/_not-found.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/admin.html +2 -2
  24. package/.next/server/app/admin.rsc +2 -2
  25. package/.next/server/app/admin.segments/_full.segment.rsc +2 -2
  26. package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
  27. package/.next/server/app/admin.segments/_index.segment.rsc +2 -2
  28. package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
  29. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
  30. package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
  31. package/.next/server/app/index.html +2 -2
  32. package/.next/server/app/index.rsc +3 -3
  33. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  34. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  35. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  36. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  37. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  38. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/login.html +2 -2
  40. package/.next/server/app/login.rsc +3 -3
  41. package/.next/server/app/login.segments/_full.segment.rsc +3 -3
  42. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  43. package/.next/server/app/login.segments/_index.segment.rsc +2 -2
  44. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  45. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  46. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  47. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/logs.html +2 -2
  49. package/.next/server/app/logs.rsc +2 -2
  50. package/.next/server/app/logs.segments/_full.segment.rsc +2 -2
  51. package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
  52. package/.next/server/app/logs.segments/_index.segment.rsc +2 -2
  53. package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
  55. package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
  56. package/.next/server/app/messages/page.js.nft.json +1 -1
  57. package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/messages.html +2 -2
  59. package/.next/server/app/messages.rsc +3 -3
  60. package/.next/server/app/messages.segments/_full.segment.rsc +3 -3
  61. package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
  62. package/.next/server/app/messages.segments/_index.segment.rsc +2 -2
  63. package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
  64. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +2 -2
  65. package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
  66. package/.next/server/app/node/page.js.nft.json +1 -1
  67. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  68. package/.next/server/app/node.html +2 -2
  69. package/.next/server/app/node.rsc +3 -3
  70. package/.next/server/app/node.segments/_full.segment.rsc +3 -3
  71. package/.next/server/app/node.segments/_head.segment.rsc +1 -1
  72. package/.next/server/app/node.segments/_index.segment.rsc +2 -2
  73. package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
  74. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +2 -2
  75. package/.next/server/app/node.segments/node.segment.rsc +1 -1
  76. package/.next/server/app/nodes/page.js.nft.json +1 -1
  77. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app/nodes.html +2 -2
  79. package/.next/server/app/nodes.rsc +3 -3
  80. package/.next/server/app/nodes.segments/_full.segment.rsc +3 -3
  81. package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
  82. package/.next/server/app/nodes.segments/_index.segment.rsc +2 -2
  83. package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
  84. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +2 -2
  85. package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
  86. package/.next/server/app/page.js.nft.json +1 -1
  87. package/.next/server/app/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app/providers/page_client-reference-manifest.js +1 -1
  89. package/.next/server/app/providers.html +2 -2
  90. package/.next/server/app/providers.rsc +2 -2
  91. package/.next/server/app/providers.segments/_full.segment.rsc +2 -2
  92. package/.next/server/app/providers.segments/_head.segment.rsc +1 -1
  93. package/.next/server/app/providers.segments/_index.segment.rsc +2 -2
  94. package/.next/server/app/providers.segments/_tree.segment.rsc +2 -2
  95. package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +1 -1
  96. package/.next/server/app/providers.segments/providers.segment.rsc +1 -1
  97. package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
  98. package/.next/server/app/server-logs.html +2 -2
  99. package/.next/server/app/server-logs.rsc +2 -2
  100. package/.next/server/app/server-logs.segments/_full.segment.rsc +2 -2
  101. package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
  102. package/.next/server/app/server-logs.segments/_index.segment.rsc +2 -2
  103. package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
  104. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +1 -1
  105. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +1 -1
  106. package/.next/server/app/servers/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/servers.html +2 -2
  108. package/.next/server/app/servers.rsc +2 -2
  109. package/.next/server/app/servers.segments/_full.segment.rsc +2 -2
  110. package/.next/server/app/servers.segments/_head.segment.rsc +1 -1
  111. package/.next/server/app/servers.segments/_index.segment.rsc +2 -2
  112. package/.next/server/app/servers.segments/_tree.segment.rsc +2 -2
  113. package/.next/server/app/servers.segments/servers/__PAGE__.segment.rsc +1 -1
  114. package/.next/server/app/servers.segments/servers.segment.rsc +1 -1
  115. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/settings/networks.html +2 -2
  117. package/.next/server/app/settings/networks.rsc +2 -2
  118. package/.next/server/app/settings/networks.segments/_full.segment.rsc +2 -2
  119. package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
  120. package/.next/server/app/settings/networks.segments/_index.segment.rsc +2 -2
  121. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
  122. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
  123. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
  124. package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
  125. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  126. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  127. package/.next/server/app/settings/tokens.html +2 -2
  128. package/.next/server/app/settings/tokens.rsc +2 -2
  129. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +2 -2
  130. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
  131. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +2 -2
  132. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
  133. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
  134. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
  135. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
  136. package/.next/server/app/settings.html +2 -2
  137. package/.next/server/app/settings.rsc +3 -3
  138. package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  139. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  140. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  141. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  142. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  143. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  144. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  145. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  146. package/.next/server/app/tasks.html +2 -2
  147. package/.next/server/app/tasks.rsc +2 -2
  148. package/.next/server/app/tasks.segments/_full.segment.rsc +2 -2
  149. package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
  150. package/.next/server/app/tasks.segments/_index.segment.rsc +2 -2
  151. package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
  152. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
  153. package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
  154. package/.next/server/chunks/[root-of-the-server]__0nhjt1j._.js +1 -1
  155. package/.next/server/chunks/[root-of-the-server]__0nhjt1j._.js.map +1 -1
  156. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_01~-ebd._.js +3 -0
  157. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_01~-ebd._.js.map +1 -0
  158. package/.next/server/chunks/ssr/{0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0~af09u._.js → 0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0ei5728._.js} +2 -2
  159. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0ei5728._.js.map +1 -0
  160. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0lzn~cs._.js +3 -0
  161. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0lzn~cs._.js.map +1 -0
  162. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0mek_e~._.js +1 -1
  163. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0mek_e~._.js.map +1 -1
  164. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0wz8z_e._.js +3 -0
  165. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0wz8z_e._.js.map +1 -0
  166. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0~ejwde._.js +1 -1
  167. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0~ejwde._.js.map +1 -1
  168. package/.next/server/chunks/ssr/[root-of-the-server]__04fj5h4._.js +3 -0
  169. package/.next/server/chunks/ssr/[root-of-the-server]__04fj5h4._.js.map +1 -0
  170. package/.next/server/chunks/ssr/[root-of-the-server]__05plnr_._.js +3 -0
  171. package/.next/server/chunks/ssr/[root-of-the-server]__05plnr_._.js.map +1 -0
  172. package/.next/server/chunks/ssr/[root-of-the-server]__0l~vdgn._.js +3 -0
  173. package/.next/server/chunks/ssr/[root-of-the-server]__0l~vdgn._.js.map +1 -0
  174. package/.next/server/middleware-build-manifest.js +3 -3
  175. package/.next/server/pages/404.html +2 -2
  176. package/.next/server/pages/500.html +1 -1
  177. package/.next/static/chunks/{0a~ml7_0i0z70.js → 0.o~6-f11_j6i.js} +1 -1
  178. package/.next/static/chunks/{0.wmcjkg_pule.js → 01cd3uiuzejbt.js} +1 -1
  179. package/.next/static/chunks/{17xziuvljtbgu.js → 04y_am25nk4g..js} +2 -2
  180. package/.next/static/chunks/04~ypes~t4khh.js +1 -0
  181. package/.next/static/chunks/0p~997s2myymh.js +1 -0
  182. package/.next/static/chunks/0xy6sa.x2zvar.css +1 -0
  183. package/.next/static/chunks/{05q4-tajm2ro0.js → 14xnrhzhmv37o.js} +2 -2
  184. package/.next/trace +2 -2
  185. package/.next/trace-build +1 -1
  186. package/app/api/hub/files/[fileId]/route.ts +147 -14
  187. package/app/components/AttachmentBlock.tsx +316 -19
  188. package/package.json +1 -1
  189. package/tests/e2e-492-inline-preview/verify-summary.md +41 -0
  190. package/tests/e2e-492-inline-preview/verify.sh +227 -0
  191. package/.next/server/chunks/ssr/0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_0~af09u._.js.map +0 -1
  192. package/.next/server/chunks/ssr/[root-of-the-server]__00kmdl9._.js +0 -3
  193. package/.next/server/chunks/ssr/[root-of-the-server]__00kmdl9._.js.map +0 -1
  194. package/.next/server/chunks/ssr/[root-of-the-server]__0lazm_f._.js +0 -3
  195. package/.next/server/chunks/ssr/[root-of-the-server]__0lazm_f._.js.map +0 -1
  196. package/.next/server/chunks/ssr/[root-of-the-server]__0na-tid._.js +0 -3
  197. package/.next/server/chunks/ssr/[root-of-the-server]__0na-tid._.js.map +0 -1
  198. package/.next/static/chunks/0hz543f47.wfq.js +0 -1
  199. package/.next/static/chunks/13yysku~0ccjx.css +0 -1
  200. package/.next/static/chunks/16ix0.lg2.ee1.js +0 -1
  201. /package/.next/static/{DfxWRgilFHyub5iovIeiq → FHSqMAj0yD_AXCKEYrGTW}/_buildManifest.js +0 -0
  202. /package/.next/static/{DfxWRgilFHyub5iovIeiq → FHSqMAj0yD_AXCKEYrGTW}/_clientMiddlewareManifest.js +0 -0
  203. /package/.next/static/{DfxWRgilFHyub5iovIeiq → FHSqMAj0yD_AXCKEYrGTW}/_ssgManifest.js +0 -0
@@ -6,5 +6,5 @@
6
6
  6:I[21637,["/_next/static/chunks/08zoo9fiegm~i.js","/_next/static/chunks/0f9t_qujwbffz.js","/_next/static/chunks/0pks~2shyhhw9.js","/_next/static/chunks/0qddp9ub8gzk7.js"],"default"]
7
7
  7:I[83679,["/_next/static/chunks/08zoo9fiegm~i.js","/_next/static/chunks/0f9t_qujwbffz.js","/_next/static/chunks/0pks~2shyhhw9.js","/_next/static/chunks/0qddp9ub8gzk7.js"],"default"]
8
8
  :HL["/_next/static/chunks/066jf0nk75nic.css","style"]
9
- :HL["/_next/static/chunks/13yysku~0ccjx.css","style"]
10
- 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/066jf0nk75nic.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/chunks/13yysku~0ccjx.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/08zoo9fiegm~i.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/0f9t_qujwbffz.js","async":true}],["$","script","script-2",{"src":"/_next/static/chunks/0pks~2shyhhw9.js","async":true}],["$","script","script-3",{"src":"/_next/static/chunks/0qddp9ub8gzk7.js","async":true}]],["$","html",null,{"lang":"en","data-theme":"cyber","className":"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased","children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\ntry {\n var t = localStorage.getItem('anet-theme') || 'cyber';\n document.documentElement.setAttribute('data-theme', t);\n} catch (e) {}\n"}}]}],["$","body",null,{"className":"min-h-full","style":{"background":"var(--bg)","color":"var(--fg)"},"children":["$","$L2",null,{"children":["$","$L3",null,{"children":[["$","$L4",null,{}],["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","template":["$","$L7",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"DfxWRgilFHyub5iovIeiq"}
9
+ :HL["/_next/static/chunks/0xy6sa.x2zvar.css","style"]
10
+ 0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/066jf0nk75nic.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/chunks/0xy6sa.x2zvar.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/08zoo9fiegm~i.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/0f9t_qujwbffz.js","async":true}],["$","script","script-2",{"src":"/_next/static/chunks/0pks~2shyhhw9.js","async":true}],["$","script","script-3",{"src":"/_next/static/chunks/0qddp9ub8gzk7.js","async":true}]],["$","html",null,{"lang":"en","data-theme":"cyber","className":"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable h-full antialiased","children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\ntry {\n var t = localStorage.getItem('anet-theme') || 'cyber';\n document.documentElement.setAttribute('data-theme', t);\n} catch (e) {}\n"}}]}],["$","body",null,{"className":"min-h-full","style":{"background":"var(--bg)","color":"var(--fg)"},"children":["$","$L2",null,{"children":["$","$L3",null,{"children":[["$","$L4",null,{}],["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","template":["$","$L7",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]]}]}]}]]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"FHSqMAj0yD_AXCKEYrGTW"}
@@ -1,5 +1,5 @@
1
1
  :HL["/_next/static/chunks/066jf0nk75nic.css","style"]
2
- :HL["/_next/static/chunks/13yysku~0ccjx.css","style"]
2
+ :HL["/_next/static/chunks/0xy6sa.x2zvar.css","style"]
3
3
  :HL["/_next/static/media/797e433ab948586e-s.p.08e28id.o-okb.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
4
4
  :HL["/_next/static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
5
- 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"tasks","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"DfxWRgilFHyub5iovIeiq"}
5
+ 0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"tasks","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"FHSqMAj0yD_AXCKEYrGTW"}
@@ -3,7 +3,7 @@
3
3
  3:I[71522,["/_next/static/chunks/08zoo9fiegm~i.js","/_next/static/chunks/0f9t_qujwbffz.js","/_next/static/chunks/0pks~2shyhhw9.js","/_next/static/chunks/0qddp9ub8gzk7.js","/_next/static/chunks/147qv0tn7w~6..js"],"default"]
4
4
  6:I[11466,["/_next/static/chunks/08zoo9fiegm~i.js","/_next/static/chunks/0f9t_qujwbffz.js","/_next/static/chunks/0pks~2shyhhw9.js","/_next/static/chunks/0qddp9ub8gzk7.js"],"OutletBoundary"]
5
5
  7:"$Sreact.suspense"
6
- 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/147qv0tn7w~6..js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"DfxWRgilFHyub5iovIeiq"}
6
+ 0:{"rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","script","script-0",{"src":"/_next/static/chunks/147qv0tn7w~6..js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"FHSqMAj0yD_AXCKEYrGTW"}
7
7
  4:{}
8
8
  5:"$0:rsc:props:children:0:props:serverProvidedParams:params"
9
9
  8:null
@@ -2,4 +2,4 @@
2
2
  2:I[21637,["/_next/static/chunks/08zoo9fiegm~i.js","/_next/static/chunks/0f9t_qujwbffz.js","/_next/static/chunks/0pks~2shyhhw9.js","/_next/static/chunks/0qddp9ub8gzk7.js"],"default"]
3
3
  3:I[83679,["/_next/static/chunks/08zoo9fiegm~i.js","/_next/static/chunks/0f9t_qujwbffz.js","/_next/static/chunks/0pks~2shyhhw9.js","/_next/static/chunks/0qddp9ub8gzk7.js"],"default"]
4
4
  4:[]
5
- 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"DfxWRgilFHyub5iovIeiq"}
5
+ 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"FHSqMAj0yD_AXCKEYrGTW"}
@@ -1,3 +1,3 @@
1
- module.exports=[50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},22809,e=>{"use strict";var t=e.i(47376),r=e.i(87350),a=e.i(98420),n=e.i(93236),s=e.i(7818),o=e.i(99799),i=e.i(28658),l=e.i(26414),d=e.i(11638),u=e.i(72978),p=e.i(94886),c=e.i(69576),h=e.i(45058),f=e.i(40142),x=e.i(53170),R=e.i(93695);e.i(38610);var v=e.i(39243),g=e.i(33555);let w=process.env.COMMHUB_URL||"http://127.0.0.1:9200",m=/^[A-Za-z0-9_-]{8,64}$/,E=["content-type","content-length","content-disposition","x-content-type-options"];async function y(e,{params:t}){let r,a=await (0,g.requireDashboardAuth)();if(a)return a;let{fileId:n}=await t;if(!n||!m.test(n))return Response.json({error:"invalid file_id"},{status:400});let s=await (0,g.getV3UserToken)();if(!s)return Response.json({error:"no session token"},{status:401});let o=`${w}/api/files/${encodeURIComponent(n)}`;try{r=await fetch(o,{method:"GET",headers:{Authorization:`Bearer ${s}`},cache:"no-store"})}catch(e){return Response.json({error:"hub unreachable",detail:e instanceof Error?e.message:String(e)},{status:502})}if(!r.ok){if((r.headers.get("content-type")||"").includes("json"))try{let e=await r.json();return Response.json(e,{status:r.status})}catch{}return new Response(null,{status:r.status})}let i=new Headers;for(let e of E){let t=r.headers.get(e);null!==t&&i.set(e,t)}return i.set("x-content-type-options","nosniff"),new Response(r.body,{status:200,headers:i})}e.s(["GET",0,y],37083);var b=e.i(37083);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/hub/files/[fileId]/route",pathname:"/api/hub/files/[fileId]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/[fileId]/route.ts",nextConfigOutput:"",userland:b,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:T,serverHooks:q}=C;async function N(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/hub/files/[fileId]/route";g=g.replace(/\/index$/,"")||"/";let w=await C.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:m,params:E,nextConfig:y,parsedUrl:b,isDraftMode:A,prerenderManifest:T,routerServerContext:q,isOnDemandRevalidate:N,revalidateOnlyGenerated:_,resolvedPathname:k,clientReferenceManifest:P,serverActionsManifest:j}=w,S=(0,i.normalizeAppPath)(g),O=!!(T.dynamicRoutes[S]||T.routes[k]),I=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,b,!1):t.end("This page could not be found"),null);if(O&&!A){let e=!!T.routes[k],t=T.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await I();throw new R.NoFallbackError}}let U=null;!O||C.isDev||A||(U="/index"===(U=k)?"/":U);let H=!0===C.isDev||!O,M=O&&!H;j&&P&&(0,o.setManifestsSingleton)({page:g,clientReferenceManifest:P,serverActionsManifest:j});let D=e.method||"GET",$=(0,s.getTracer)(),B=$.getActiveScopeSpan(),F=!!(null==q?void 0:q.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),L=(0,n.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,y,T,K);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let G={params:E,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:H,incrementalCache:L,cacheLifeProfiles:y.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,q)},sharedContext:{buildId:m}},V=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(V,(0,d.signalFromNodeResponse)(t));try{let n,o=async e=>C.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${D} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${D} ${g}`)}),i=async n=>{var s,i;let l=async({previousCacheEntry:r})=>{try{if(!K&&N&&_&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let i=G.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let l=G.renderOpts.collectedTags;if(!O)return await (0,c.sendResponse)(V,z,s,G.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[x.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,q),t}},d=await C.handleResponse({req:e,nextConfig:y,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:_,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:K});if(!O)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return K&&O||u.delete(x.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,f.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(V,z,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};F&&B?await i(B):(n=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${D} ${g}`,kind:s.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},i),void 0,!F))}catch(t){if(t instanceof R.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,q),O)throw t;return await (0,c.sendResponse)(V,z,new Response(null,{status:500})),null}}e.s(["handler",0,N,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:T})},"routeModule",0,C,"serverHooks",0,q,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,T],22809)}];
1
+ module.exports=[50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},22809,e=>{"use strict";var t=e.i(47376),r=e.i(87350),a=e.i(98420),n=e.i(93236),s=e.i(7818),i=e.i(99799),o=e.i(28658),l=e.i(26414),d=e.i(11638),u=e.i(72978),p=e.i(94886),c=e.i(69576),h=e.i(45058),f=e.i(40142),g=e.i(53170),x=e.i(93695);e.i(38610);var R=e.i(39243),v=e.i(33555);let m=process.env.COMMHUB_URL||"http://127.0.0.1:9200",w=/^[A-Za-z0-9_-]{8,64}$/,b=["content-type","content-length"];async function y(e,{params:t}){var r;let a,n=await (0,v.requireDashboardAuth)();if(n)return n;let{fileId:s}=await t;if(!s||!w.test(s))return Response.json({error:"invalid file_id"},{status:400});let i=await (0,v.getV3UserToken)();if(!i)return Response.json({error:"no session token"},{status:401});let o=`${m}/api/files/${encodeURIComponent(s)}`;try{a=await fetch(o,{method:"GET",headers:{Authorization:`Bearer ${i}`},cache:"no-store"})}catch(e){return Response.json({error:"hub unreachable",detail:e instanceof Error?e.message:String(e)},{status:502})}if(!a.ok){if((a.headers.get("content-type")||"").includes("json"))try{let e=await a.json();return Response.json(e,{status:a.status})}catch{}return new Response(null,{status:a.status})}let l=new Uint8Array(await a.arrayBuffer()),d=(r=l.subarray(0,32)).length<4?null:r.length>=8&&137===r[0]&&80===r[1]&&78===r[2]&&71===r[3]&&13===r[4]&&10===r[5]&&26===r[6]&&10===r[7]?"image/png":255===r[0]&&216===r[1]&&255===r[2]?"image/jpeg":r.length>=6&&71===r[0]&&73===r[1]&&70===r[2]&&56===r[3]&&(55===r[4]||57===r[4])&&97===r[5]?"image/gif":r.length>=12&&82===r[0]&&73===r[1]&&70===r[2]&&70===r[3]&&87===r[8]&&69===r[9]&&66===r[10]&&80===r[11]?"image/webp":26===r[0]&&69===r[1]&&223===r[2]&&163===r[3]?"video/webm":r.length>=8&&102===r[4]&&116===r[5]&&121===r[6]&&112===r[7]?"video/mp4":null,u=new Headers;for(let e of b){let t=a.headers.get(e);null!==t&&u.set(e,t)}u.set("content-length",String(l.length)),u.set("x-content-type-options","nosniff");let p=a.headers.get("content-disposition")||"";return/^\s*attachment\b/i.test(p)?u.set("content-disposition",p):u.set("content-disposition",`attachment; filename="${s}"`),d&&u.set("x-verified-type",d),new Response(l,{status:200,headers:u})}e.s(["GET",0,y],37083);var E=e.i(37083);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/hub/files/[fileId]/route",pathname:"/api/hub/files/[fileId]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/[fileId]/route.ts",nextConfigOutput:"",userland:E,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:T,serverHooks:q}=C;async function N(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/hub/files/[fileId]/route";v=v.replace(/\/index$/,"")||"/";let m=await C.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:w,params:b,nextConfig:y,parsedUrl:E,isDraftMode:A,prerenderManifest:T,routerServerContext:q,isOnDemandRevalidate:N,revalidateOnlyGenerated:_,resolvedPathname:j,clientReferenceManifest:k,serverActionsManifest:P}=m,S=(0,o.normalizeAppPath)(v),O=!!(T.dynamicRoutes[S]||T.routes[j]),I=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,E,!1):t.end("This page could not be found"),null);if(O&&!A){let e=!!T.routes[j],t=T.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await I();throw new x.NoFallbackError}}let U=null;!O||C.isDev||A||(U="/index"===(U=j)?"/":U);let H=!0===C.isDev||!O,M=O&&!H;P&&k&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:k,serverActionsManifest:P});let D=e.method||"GET",$=(0,s.getTracer)(),B=$.getActiveScopeSpan(),F=!!(null==q?void 0:q.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),L=(0,n.getRequestMeta)(e,"incrementalCache")||await C.getIncrementalCache(e,y,T,K);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let G={params:b,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:H,incrementalCache:L,cacheLifeProfiles:y.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>C.onRequestError(e,t,a,n,q)},sharedContext:{buildId:w}},V=new l.NodeNextRequest(e),z=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(V,(0,d.signalFromNodeResponse)(t));try{let n,i=async e=>C.handle(W,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${D} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${D} ${v}`)}),o=async n=>{var s,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&N&&_&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!O)return await (0,c.sendResponse)(V,z,s,G.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[g.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,q),t}},d=await C.handleResponse({req:e,nextConfig:y,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:_,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:K});if(!O)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return K&&O||u.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,f.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(V,z,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};F&&B?await o(B):(n=$.getActiveScopeSpan(),await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${D} ${v}`,kind:s.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},o),void 0,!F))}catch(t){if(t instanceof x.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,q),O)throw t;return await (0,c.sendResponse)(V,z,new Response(null,{status:500})),null}}e.s(["handler",0,N,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:T})},"routeModule",0,C,"serverHooks",0,q,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,T],22809)}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__0nhjt1j._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/%5BfileId%5D/route.ts","../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { requireDashboardAuth, getV3UserToken } from '@/app/lib/dashboard-auth';\n\nconst HUB_URL = process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n\n/**\n * File ID shape: mirrors server/src/uploads.ts FILE_ID_REGEX exactly.\n * Token-exact check before any URL composition — refuse\n * `../../etc/passwd` before it can reach the hub.\n */\nconst FILE_ID_REGEX = /^[A-Za-z0-9_-]{8,64}$/;\n\n/**\n * Header allowlist for the pass-through. We deliberately do NOT forward\n * everything from the hub response — the browser must NOT see anything\n * that could leak the internal request path or the Bearer token.\n * Only the four headers the browser genuinely needs for a safe download.\n */\nconst HEADER_PASSTHROUGH = [\n 'content-type',\n 'content-length',\n 'content-disposition',\n 'x-content-type-options',\n] as const;\n\n/**\n * #492 — file download proxy: browser fetches `/api/hub/files/<file_id>`,\n * this proxy attaches the browser session's V3 user token as\n * `Authorization: Bearer <utok>` and streams the response through.\n *\n * Why proxy vs direct-browser-fetch to `/api/files/<id>`:\n *\n * - Hub `/api/files/<id>` requires `Authorization: Bearer <token>`.\n * If the client tried to fetch it directly, the browser would need\n * the token in-page. Putting the token in a URL query string\n * leaks it into browser history + server access logs + Referer\n * headers on any follow-up navigation. Attaching it as an\n * `Authorization` header from the client requires the client to\n * hold the token, which we already refused to do (dashboard V3\n * tokens are HttpOnly-cookie-only per `dashboard-auth.ts`).\n * - By proxying, the token stays server-side. The client sends\n * nothing but its own session cookie; the server adds the Bearer.\n *\n * Streaming — we forward `res.body` (a ReadableStream) directly rather\n * than buffering `await res.arrayBuffer()`. A 44 KB pptx (Vincent's\n * demo case) buffers fine, but users can upload up to the hub's\n * 12 MiB cap and bundle-loading that into node memory 100x per\n * concurrent request is a memory footgun. Streaming keeps the proxy\n * O(1) memory regardless of file size.\n *\n * Content-Disposition + X-Content-Type-Options come from the hub\n * response and are passed through verbatim — the hub already stamps\n * `attachment` disposition + `nosniff` on downloads (issue #221),\n * meaning the browser will download-not-render even if the file\n * happens to be text/html. Do not add or alter those headers here.\n */\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ fileId: string }> },\n) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n const { fileId } = await params;\n if (!fileId || !FILE_ID_REGEX.test(fileId)) {\n return Response.json({ error: 'invalid file_id' }, { status: 400 });\n }\n\n const userToken = await getV3UserToken();\n if (!userToken) {\n return Response.json({ error: 'no session token' }, { status: 401 });\n }\n\n const url = `${HUB_URL}/api/files/${encodeURIComponent(fileId)}`;\n let hubRes: Response;\n try {\n hubRes = await fetch(url, {\n method: 'GET',\n headers: { Authorization: `Bearer ${userToken}` },\n // Streaming: avoid Next.js caching of the file bytes.\n cache: 'no-store',\n });\n } catch (e: unknown) {\n return Response.json(\n { error: 'hub unreachable', detail: e instanceof Error ? e.message : String(e) },\n { status: 502 },\n );\n }\n\n // Forward hub's status verbatim so a 404 (unknown file_id) surfaces\n // as a 404 the client can distinguish from a proxy error.\n if (!hubRes.ok) {\n // Try to keep JSON error shape when the hub gave one; otherwise\n // return a generic status-only response.\n const ct = hubRes.headers.get('content-type') || '';\n if (ct.includes('json')) {\n try {\n const errBody = await hubRes.json();\n return Response.json(errBody, { status: hubRes.status });\n } catch {\n // fall through to generic\n }\n }\n return new Response(null, { status: hubRes.status });\n }\n\n // Build the response header set — only the allowlisted ones. This\n // strips anything the hub might leak (Set-Cookie, X-Hub-*, etc.).\n const outHeaders = new Headers();\n for (const key of HEADER_PASSTHROUGH) {\n const value = hubRes.headers.get(key);\n if (value !== null) outHeaders.set(key, value);\n }\n // Defense-in-depth: always stamp nosniff on downloads even if the\n // hub didn't (it does today per #221, but pinning here means a hub\n // regression can't retroactively make the browser sniff-execute).\n outHeaders.set('x-content-type-options', 'nosniff');\n\n return new Response(hubRes.body, {\n status: 200,\n headers: outHeaders,\n });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/hub/files/[fileId]/route\",\n pathname: \"/api/hub/files/[fileId]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/[fileId]/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/hub/files/[fileId]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["HUB_URL","process","env","COMMHUB_URL","FILE_ID_REGEX","HEADER_PASSTHROUGH","GET","_req","params","authFailure","json","e","fileId","test","Response","error","status","userToken","ct","url","encodeURIComponent","hubRes","fetch","method","headers","Authorization","cache","key","detail","Error","message","String","ok","get","includes","errBody","outHeaders","Headers","value","set","body"],"mappings":"wjCCAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,ODhBA,EAAA,EAAA,CAAA,CAAA,OAEA,IAAMA,EAAUC,QAAQC,GAAG,CAACC,WAAW,EAAI,wBAOrCC,EAAgB,wBAQhBC,EAAqB,CACzB,eACA,iBACA,sBACA,yBACD,CAiCM,eAAeC,EACpBC,CAAa,CACb,QAAEC,CAAM,CAA2C,EAEnD,IAcIa,EAdEZ,EAAc,MAAM,CAAA,EAAA,EAAA,oBAAA,AAAoB,IAC9C,GAAIA,EAAa,OAAOA,EAExB,GAAM,QAAEG,CAAM,CAAE,CAAG,MAAMJ,EACzB,GAAI,CAACI,GAAU,CAACR,EAAcS,IAAI,CAACD,GACjC,MAD0C,CACnCE,SAASJ,IAAI,CAAC,CAAEK,MAAO,iBAAkB,EAAG,CA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AAA,EAAA,EAAA,UAAW,AAAX,EAAY,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
1
+ {"version":3,"sources":["../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/%5BfileId%5D/route.ts","../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { requireDashboardAuth, getV3UserToken } from '@/app/lib/dashboard-auth';\n\nconst HUB_URL = process.env.COMMHUB_URL || 'http://127.0.0.1:9200';\n\n/**\n * File ID shape: mirrors server/src/uploads.ts FILE_ID_REGEX exactly.\n * Token-exact check before any URL composition — refuse\n * `../../etc/passwd` before it can reach the hub.\n */\nconst FILE_ID_REGEX = /^[A-Za-z0-9_-]{8,64}$/;\n\n/**\n * Header allowlist for the pass-through. We deliberately do NOT forward\n * everything from the hub response — the browser must NOT see anything\n * that could leak the internal request path or the Bearer token.\n *\n * `content-disposition` and `x-content-type-options` are intentionally\n * NOT in this list — they're stamped explicitly below (see JSDoc on\n * the response builder). Passing them through the allowlist would\n * silently defer to hub for the security-critical values, which is\n * exactly the regression path 通信龙 flagged in the #47 review.\n */\nconst HEADER_PASSTHROUGH = [\n 'content-type',\n 'content-length',\n] as const;\n\n// ── #492 preview half: safe-inline-type detection ──────────────\n//\n// 🔴 STRUCTURAL SAFETY (通信龙 #46 review of the inline design):\n// This proxy NEVER returns an inline response, regardless of the\n// file's real type. `Content-Disposition: attachment` + `nosniff`\n// stay stamped on every download, so no dashboard-origin URL can\n// ever serve user-uploaded content as a rendered page — that entire\n// XSS class is structurally impossible, not defended-by-whitelist.\n//\n// What we DO expose: a `X-Verified-Type` header carrying the true MIME\n// as detected by magic bytes. The client uses this header to decide:\n// 1. Fetch the bytes (browser downloads — no navigation)\n// 2. `new Blob([bytes], {type: xVerifiedType})`\n// 3. `URL.createObjectURL(blob)` → `<img>` / `<video>` src\n//\n// The blob URL is same-origin *to the browser's blob: scheme*, isolated\n// from the dashboard origin — a bug in whitelist can degrade UX (image\n// won't render) but can never become a cross-origin script vector.\n//\n// Detection rule: EXACT MIME match by per-format magic bytes at each\n// format's actual offset. No prefix matching (`image/*` would let SVG\n// in). No trust of upload-time mime/filename (both untrusted).\ntype SafeMime =\n | 'image/png'\n | 'image/jpeg'\n | 'image/gif'\n | 'image/webp'\n | 'video/mp4'\n | 'video/webm';\n\n/**\n * Peek magic bytes and return the safe MIME if the file matches one\n * of our whitelisted formats.\n *\n * Per-format offset rules (not naive first-N compare — 通信龙 review):\n * - PNG: offset 0, `89 50 4E 47 0D 0A 1A 0A`\n * - JPEG: offset 0, `FF D8 FF`\n * - GIF: offset 0, `47 49 46 38 (37|39) 61` (\"GIF87a\" / \"GIF89a\")\n * - WebP: offset 0 `52 49 46 46` (\"RIFF\") + offset 8 `57 45 42 50` (\"WEBP\")\n * - MP4: offset 4 `66 74 79 70` (\"ftyp\") — MP4/M4V/QT ISO BMFF box\n * - WebM: offset 0 `1A 45 DF A3` (EBML)\n *\n * Returns null for anything else (SVG, HTML, empty, corrupted, unknown).\n */\nfunction detectSafeMime(head: Uint8Array): SafeMime | null {\n const b = head;\n if (b.length < 4) return null;\n\n // PNG\n if (\n b.length >= 8 &&\n b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4E && b[3] === 0x47 &&\n b[4] === 0x0D && b[5] === 0x0A && b[6] === 0x1A && b[7] === 0x0A\n ) return 'image/png';\n\n // JPEG (FF D8 FF — final byte is FF E0 / FF E1 / FF DB variants; the FF prefix\n // is enough to distinguish. Reject if not exactly the three-byte JPEG marker.)\n if (b[0] === 0xFF && b[1] === 0xD8 && b[2] === 0xFF) return 'image/jpeg';\n\n // GIF — \"GIF87a\" or \"GIF89a\"\n if (\n b.length >= 6 &&\n b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x38 &&\n (b[4] === 0x37 || b[4] === 0x39) && b[5] === 0x61\n ) return 'image/gif';\n\n // WebP — \"RIFF????WEBP\"\n if (\n b.length >= 12 &&\n b[0] === 0x52 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x46 &&\n b[8] === 0x57 && b[9] === 0x45 && b[10] === 0x42 && b[11] === 0x50\n ) return 'image/webp';\n\n // WebM (EBML header) — 1A 45 DF A3\n if (b[0] === 0x1A && b[1] === 0x45 && b[2] === 0xDF && b[3] === 0xA3) {\n return 'video/webm';\n }\n\n // MP4 (ISO BMFF `ftyp` box at offset 4) — the first 4 bytes are a\n // big-endian box size we don't need to validate; the \"ftyp\" marker\n // is what we key on.\n if (\n b.length >= 8 &&\n b[4] === 0x66 && b[5] === 0x74 && b[6] === 0x79 && b[7] === 0x70\n ) return 'video/mp4';\n\n return null;\n}\n\n/**\n * #492 — file download proxy: browser fetches `/api/hub/files/<file_id>`,\n * this proxy attaches the browser session's V3 user token as\n * `Authorization: Bearer <utok>` and forwards the response.\n *\n * Why proxy vs direct-browser-fetch to `/api/files/<id>`:\n *\n * - Hub `/api/files/<id>` requires `Authorization: Bearer <token>`.\n * If the client tried to fetch it directly, the browser would need\n * the token in-page. Putting the token in a URL query string\n * leaks it into browser history + server access logs + Referer\n * headers on any follow-up navigation. Attaching it as an\n * `Authorization` header from the client requires the client to\n * hold the token, which we already refused to do (dashboard V3\n * tokens are HttpOnly-cookie-only per `dashboard-auth.ts`).\n * - By proxying, the token stays server-side. The client sends\n * nothing but its own session cookie; the server adds the Bearer.\n *\n * Buffering vs streaming: this half of the proxy USED to stream (O(1)\n * memory). The preview half needs to detect magic bytes before\n * headers can be sent, so we now buffer the full body. Acceptable\n * because hub caps uploads at 12 MiB; worst case is 12 MiB *\n * concurrent-preview-requests per node process. If that becomes\n * memory pressure the fix is to tee the ReadableStream and inspect\n * the first chunk without buffering the rest — deferred until\n * evidence shows it's worth the complexity.\n *\n * Content-Disposition + X-Content-Type-Options come from the hub\n * response and are passed through verbatim — the hub already stamps\n * `attachment` disposition + `nosniff` on downloads (issue #221),\n * meaning the browser will download-not-render even if the file\n * happens to be text/html. Do not add or alter those headers here.\n *\n * The response ALWAYS carries `attachment` disposition — the client\n * reads `X-Verified-Type` and constructs a blob URL if it wants to\n * inline the content. See `detectSafeMime` above for the security\n * reasoning.\n */\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ fileId: string }> },\n) {\n const authFailure = await requireDashboardAuth();\n if (authFailure) return authFailure;\n\n const { fileId } = await params;\n if (!fileId || !FILE_ID_REGEX.test(fileId)) {\n return Response.json({ error: 'invalid file_id' }, { status: 400 });\n }\n\n const userToken = await getV3UserToken();\n if (!userToken) {\n return Response.json({ error: 'no session token' }, { status: 401 });\n }\n\n const url = `${HUB_URL}/api/files/${encodeURIComponent(fileId)}`;\n let hubRes: Response;\n try {\n hubRes = await fetch(url, {\n method: 'GET',\n headers: { Authorization: `Bearer ${userToken}` },\n cache: 'no-store',\n });\n } catch (e: unknown) {\n return Response.json(\n { error: 'hub unreachable', detail: e instanceof Error ? e.message : String(e) },\n { status: 502 },\n );\n }\n\n // Forward hub's status verbatim so a 404 (unknown file_id) surfaces\n // as a 404 the client can distinguish from a proxy error.\n if (!hubRes.ok) {\n const ct = hubRes.headers.get('content-type') || '';\n if (ct.includes('json')) {\n try {\n const errBody = await hubRes.json();\n return Response.json(errBody, { status: hubRes.status });\n } catch {\n // fall through to generic\n }\n }\n return new Response(null, { status: hubRes.status });\n }\n\n // Buffer full body — see JSDoc for the memory rationale.\n const bytes = new Uint8Array(await hubRes.arrayBuffer());\n const verifiedType = detectSafeMime(bytes.subarray(0, 32));\n\n // Build the response header set — only the allowlisted ones. This\n // strips anything the hub might leak (Set-Cookie, X-Hub-*, etc.).\n const outHeaders = new Headers();\n for (const key of HEADER_PASSTHROUGH) {\n const value = hubRes.headers.get(key);\n if (value !== null) outHeaders.set(key, value);\n }\n // Content-Length may not survive if we re-emit the body; set from\n // our own buffer length to be authoritative.\n outHeaders.set('content-length', String(bytes.length));\n\n // Defense-in-depth: always stamp nosniff on downloads even if the\n // hub didn't (it does today per #221, but pinning here means a hub\n // regression can't retroactively make the browser sniff-execute).\n // The polyglot-PNG-HTML adversarial sample in verify.sh depends on\n // this exact header being present.\n outHeaders.set('x-content-type-options', 'nosniff');\n\n // 🔴 SYMMETRIC PIN with nosniff (通信龙 review of PR #47):\n // \"永不 inline\" is the single load-bearing invariant of this\n // whole design. It CANNOT depend on hub always sending\n // `Content-Disposition: attachment`, because a hub regression =\n // proxy regression = XSS. Pin it here explicitly.\n //\n // Filename preservation: if hub sent `attachment; filename=\"...\"`\n // we keep the whole thing (users see the friendly name in their\n // download folder). If hub returns anything else (`inline; ...`,\n // or missing) we override to bare `attachment` with a\n // safe file_id-based filename fallback.\n const hubDisposition = hubRes.headers.get('content-disposition') || '';\n if (/^\\s*attachment\\b/i.test(hubDisposition)) {\n outHeaders.set('content-disposition', hubDisposition);\n } else {\n outHeaders.set('content-disposition', `attachment; filename=\"${fileId}\"`);\n }\n\n // Structural invariant: `X-Verified-Type` is INFORMATIONAL only.\n // Adding it does not change the response's disposition or\n // Content-Type. The client uses it to decide whether to construct\n // a blob URL for inline rendering (browser-owned blob: scheme,\n // isolated from the dashboard origin).\n if (verifiedType) {\n outHeaders.set('x-verified-type', verifiedType);\n }\n\n return new Response(bytes, {\n status: 200,\n headers: outHeaders,\n });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/hub/files/[fileId]/route\",\n pathname: \"/api/hub/files/[fileId]\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/api/hub/files/[fileId]/route.ts\",\n nextConfigOutput,\n // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/hub/files/[fileId]/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["HUB_URL","process","env","COMMHUB_URL","FILE_ID_REGEX","HEADER_PASSTHROUGH","b","detectSafeMime","head","length","_req","fileId","url","hubRes","Error","ok","get","GET","verifiedType","params","authFailure","test","Response","json","error","status","userToken","set","encodeURIComponent","fetch","method","headers","Authorization","cache","e","detail","message","String","ct","includes","errBody","bytes","Uint8Array","arrayBuffer","subarray","outHeaders","Headers","key","value","hubDisposition"],"mappings":"wjCCAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,ODhBA,EAAA,EAAA,CAAA,CAAA,OAEA,IAAMA,EAAUC,QAAQC,GAAG,CAACC,WAAW,EAAI,wBAOrCC,EAAgB,wBAahBC,EAAqB,CACz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AAa,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,GAAyB,EACzB,MAAM,EAAe,EADgB,EAGrC,EAAa,EAAO,kBAAkB,GACtC,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GATmB,AAShB,EAAY,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
@@ -0,0 +1,3 @@
1
+ module.exports=[74936,a=>{"use strict";var b=a.i(70844),c=a.i(17422);let d=async a=>{let b=await fetch(a);if(401===b.status)throw window.location.assign("/login"),Error("unauthorized");return b.json()},e={refreshInterval:5e3,dedupingInterval:3e3};function f(a,b){if(!b)return a;let c=a.includes("?")?"&":"?";return`${a}${c}network_id=${encodeURIComponent(b)}`}a.s(["useAnetConfig",0,function(){let{data:a}=(0,b.default)("/api/anet/config",d,{refreshInterval:3e4});return{config:a||null}},"useHealth",0,function(){let{data:a,error:c}=(0,b.default)("/api/hub/health",d,e);return{health:a||null,error:c}},"useMessages",0,function(a=100){let{networkId:g}=(0,c.useNetworkId)(),{data:h,error:i,isLoading:j}=(0,b.default)(f(`/api/hub/messages?limit=${a}`,g),d,{...e,keepPreviousData:!0});return{messages:h?.messages||[],error:i,isLoading:j}},"useNodeLifecycle",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h}=(0,b.default)(f("/api/hub/nodes",a),d,e),i={},j={};for(let a of g?.nodes??[])a.alias&&"string"==typeof a.lifecycle_state&&(i[a.alias]=a.lifecycle_state),a.alias&&"string"==typeof a.node_id&&(j[a.alias]=a.node_id);return{lifecycleByAlias:i,nodeIdByAlias:j,error:h}},"useSessions",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h,isLoading:i}=(0,b.default)(f("/api/hub/status",a),d,e);return{sessions:g?.sessions||[],hint:g?._hint,error:h,isLoading:i}},"useStats",0,function(){let{networkId:a}=(0,c.useNetworkId)(),{data:g,error:h}=(0,b.default)(f("/api/hub/stats",a),d,e);return{stats:g?.ok?g:null,error:h}},"useTasks",0,function(a){let{networkId:g}=(0,c.useNetworkId)(),h=new URLSearchParams({limit:"100",...a}).toString(),{data:i,error:j,isLoading:k}=(0,b.default)(f(`/api/hub/tasks?${h}`,g),d,e);return{tasks:i?.tasks||[],count:i?.count??0,source:i?.source,error:j,isLoading:k}}])},91978,74993,a=>{"use strict";var b=a.i(26600);let c=new Set;function d(a){return c.add(a),()=>void c.delete(a)}a.s(["pinyinMatch",0,function(a,b){let c=b.trim().toLowerCase();return!!(!c||a.toLowerCase().includes(c))||!1},"usePinyinReady",0,function(){return(0,b.useSyncExternalStore)(d,()=>!1,()=>!1)}],91978),a.s(["t",0,function(a,b){return"u">typeof navigator&&(navigator.language||"").toLowerCase().startsWith("zh")?a:b}],74993)},81795,a=>{"use strict";var b=a.i(79913),c=a.i(26600);let d=new Set(["png","jpg","jpeg","gif","webp","mp4","webm","mov"]),e=new Set(["image/png","image/jpeg","image/gif","image/webp"]),f=new Set(["video/mp4","video/webm"]),g=/^[A-Za-z0-9_-]{8,64}$/;async function h(a){let b=await fetch(`/api/hub/files/${encodeURIComponent(a)}`,{credentials:"include"});if(!b.ok)throw Error(`HTTP ${b.status}`);let c=b.headers.get("x-verified-type"),d=c&&(e.has(c)||f.has(c))?c:null,g=await b.blob(),h=d?new Blob([g],{type:d}):g;return{blobUrl:URL.createObjectURL(h),verifiedType:d,blob:h}}function i(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b+1).toLowerCase():""}function j({fileId:a,name:d,size:f,onNotInlineable:g}){let i="number"==typeof f&&f<=5242880,[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(!1),q=(0,c.useRef)(g);q.current=g;let r=(0,c.useCallback)(async()=>{if(!m&&!k){n(!0);try{let{blobUrl:b,verifiedType:c}=await h(a);if(!c||!e.has(c)){URL.revokeObjectURL(b),q.current();return}l(b)}catch{p(!0)}finally{n(!1)}}},[a,m,k]);return((0,c.useEffect)(()=>{i&&r()},[i,r]),(0,c.useEffect)(()=>{if(k)return()=>URL.revokeObjectURL(k)},[k]),o)?(0,b.jsx)("div",{className:"mt-2 rounded-lg border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-sm text-amber-200",children:"图片加载失败 · 请点击下方下载按钮查看"}):k?(0,b.jsx)("div",{className:"mt-2 overflow-hidden rounded-lg border border-white/10 bg-black/20",children:(0,b.jsx)("img",{src:k,alt:d,className:"block max-h-[50vh] w-auto max-w-full cursor-zoom-in object-contain",onClick:()=>window.open(k,"_blank","noopener")})}):(0,b.jsxs)("button",{type:"button",onClick:r,disabled:m,className:"mt-2 flex w-full items-center gap-2 rounded-lg border border-cyan-500/20 bg-cyan-500/5 px-3 py-2 text-left text-sm text-cyan-100 transition hover:border-cyan-400/40 hover:bg-cyan-500/10 disabled:cursor-wait disabled:opacity-60",children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"text-lg",children:"🖼️"}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:d}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-cyan-300",children:m?"加载中…":"点击查看"})]})}function k({fileId:a,name:d,onNotInlineable:e}){let[g,i]=(0,c.useState)(null),[j,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)(!1),o=(0,c.useRef)(e);o.current=e;let p=(0,c.useCallback)(async()=>{if(!j&&!g){l(!0);try{let{blobUrl:b,verifiedType:c}=await h(a);if(!c||!f.has(c)){URL.revokeObjectURL(b),o.current();return}i(b)}catch{n(!0)}finally{l(!1)}}},[a,j,g]);return((0,c.useEffect)(()=>{if(g)return()=>URL.revokeObjectURL(g)},[g]),m)?(0,b.jsx)("div",{className:"mt-2 rounded-lg border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-sm text-amber-200",children:"视频加载失败 · 请点击下方下载按钮查看"}):g?(0,b.jsx)("div",{className:"mt-2 overflow-hidden rounded-lg border border-white/10 bg-black/20",children:(0,b.jsx)("video",{src:g,controls:!0,autoPlay:!0,className:"block max-h-[50vh] w-full",children:"您的浏览器不支持内联视频播放,请下载后查看。"})}):(0,b.jsxs)("button",{type:"button",onClick:p,disabled:j,className:"mt-2 flex w-full items-center gap-2 rounded-lg border border-cyan-500/20 bg-cyan-500/5 px-3 py-2 text-left text-sm text-cyan-100 transition hover:border-cyan-400/40 hover:bg-cyan-500/10 disabled:cursor-wait disabled:opacity-60",children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"text-lg",children:"🎬"}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:d}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-cyan-300",children:j?"加载中…":"▶ 播放"})]})}a.s(["AttachmentBlock",0,function({attachment:a}){var h,l;let m,n,[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),u=function(a){if("string"!=typeof a||0===a.length)return"file";let b=a.replace(/[/\\]/g,"_").replace(/[\r\n\t\0]/g,"_");for(;b.startsWith(".");)b=b.slice(1);return b.length>200&&(b=b.slice(0,200)),b||"file"}(a.name),v="string"!=typeof(h=a.mime)?"":h.replace(/[^a-zA-Z0-9./+-]/g,"").slice(0,100),w="number"!=typeof(l=a.size)||!Number.isFinite(l)||l<0?"":l<1024?`${l} B`:l<1048576?`${(l/1024).toFixed(1)} KB`:l<0x40000000?`${(l/1024/1024).toFixed(1)} MB`:`${(l/1024/1024/1024).toFixed(2)} GB`,x=(m=(v||"").toLowerCase(),n=(u.split(".").pop()||"").toLowerCase(),m.startsWith("image/")?"🖼️":m.startsWith("video/")?"🎬":m.startsWith("audio/")?"🎵":m.includes("pdf")||"pdf"===n?"📄":["ppt","pptx"].includes(n)?"📊":["doc","docx"].includes(n)?"📝":["xls","xlsx","csv"].includes(n)?"📈":["zip","tar","gz","rar","7z"].includes(n)?"📦":"📎"),y="string"==typeof a.file_id&&g.test(a.file_id),z=y&&!s&&function(a,b){if(e.has(b)||f.has(b))return!0;let c=i(a);return""!==c&&d.has(c)}(u,v),A=i(u),B=z?f.has(v)||["mp4","webm","mov"].includes(A)?"video":"image":null;async function C(){if(!y||!a.file_id)return;r(null),p(!0);let b=null;try{let c=await fetch(`/api/hub/files/${encodeURIComponent(a.file_id)}`,{credentials:"include"});if(!c.ok)throw Error(`HTTP ${c.status}`);let d=await c.blob();b=URL.createObjectURL(d);let e=document.createElement("a");e.href=b,e.download=u,e.rel="noopener",document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(a){r(a instanceof Error?a.message:String(a))}finally{b&&URL.revokeObjectURL(b),p(!1)}}return y?(0,b.jsxs)("div",{className:"mt-2 flex flex-col",children:["image"===B&&a.file_id&&(0,b.jsx)(j,{fileId:a.file_id,name:u,size:"number"==typeof a.size?a.size:void 0,onNotInlineable:()=>t(!0)}),"video"===B&&a.file_id&&(0,b.jsx)(k,{fileId:a.file_id,name:u,onNotInlineable:()=>t(!0)}),(0,b.jsxs)("button",{type:"button",onClick:C,disabled:o,className:"flex w-full items-center gap-2 rounded-lg border border-cyan-500/20 bg-cyan-500/5 px-3 py-2 text-left text-sm text-cyan-100 transition hover:border-cyan-400/40 hover:bg-cyan-500/10 disabled:cursor-wait disabled:opacity-60 mt-2 first:mt-0",title:`Download ${u}`,children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"text-lg",children:x}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:u}),w&&(0,b.jsx)("span",{className:"shrink-0 text-xs text-neutral-400",children:w}),v&&(0,b.jsx)("span",{className:"shrink-0 rounded bg-white/5 px-1.5 py-0.5 text-[10px] text-neutral-400",children:v}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-cyan-300",children:o?"下载中…":q?`⚠ ${q}`:"↓ 下载"})]})]}):(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-2 rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-neutral-300",children:[(0,b.jsx)("span",{"aria-hidden":!0,children:x}),(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate",children:u}),w&&(0,b.jsx)("span",{className:"shrink-0 text-xs text-neutral-500",children:w}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-neutral-500",title:"Attachment has no file_id — single-host path only. Ask the sender to re-upload.",children:"(host-local)"})]})},"extractAttachments",0,function(a){if(!a||"object"!=typeof a)return[];let b=a.meta;if(!b&&"string"==typeof a.meta_json&&a.meta_json.length>0)try{b=JSON.parse(a.meta_json)}catch{return[]}if(!b||"object"!=typeof b)return[];let c=b.attachments;return Array.isArray(c)?c.filter(a=>!!a&&"object"==typeof a).map(a=>({file_id:"string"==typeof a.file_id?a.file_id:void 0,path:"string"==typeof a.path?a.path:void 0,name:"string"==typeof a.name?a.name:void 0,mime:"string"==typeof a.mime?a.mime:void 0,size:"number"==typeof a.size?a.size:void 0,type:"string"==typeof a.type?a.type:void 0})):[]}])}];
2
+
3
+ //# sourceMappingURL=0s9s_fef0eb55-b39c-4abc-b7ff-48440b9ad805_scratchpad_dashrel_app_01~-ebd._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/lib/hooks.ts","../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/lib/pinyin-match.ts","../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/lib/ui-lang.ts","../../../../../../../../../claude-1000/-home-vansin-agent-orchestra/fef0eb55-b39c-4abc-b7ff-48440b9ad805/scratchpad/dashrel/app/components/AttachmentBlock.tsx"],"sourcesContent":["import useSWR from 'swr';\nimport { Session, Health, AnetConfig } from '../components/types';\nimport { useNetworkId } from './network-context';\n\nconst fetcher = async (url: string) => {\n const res = await fetch(url);\n if (res.status === 401) {\n window.location.assign('/login');\n throw new Error('unauthorized');\n }\n return res.json();\n};\n\nconst SWR_OPTIONS = { refreshInterval: 5000, dedupingInterval: 3000 };\n\n/** Append network_id to URL if set */\nfunction withNetwork(url: string, networkId: string): string {\n if (!networkId) return url;\n const sep = url.includes('?') ? '&' : '?';\n return `${url}${sep}network_id=${encodeURIComponent(networkId)}`;\n}\n\nexport function useSessions() {\n const { networkId } = useNetworkId();\n const { data, error, isLoading } = useSWR<{ sessions: Session[]; _hint?: { global_count?: number; filtered_network?: string } }>(\n withNetwork('/api/hub/status', networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return { sessions: data?.sessions || [], hint: data?._hint, error, isLoading };\n}\n\n// RFC-027 PR2 — alias → lifecycle_state map sourced from /api/nodes\n// (commhub-server preview.12+). /api/status reads from `sessions` which\n// doesn't carry lifecycle_state; /api/nodes does. Cheap secondary\n// fetch, same SWR cadence as useSessions; merged client-side by alias.\n// Absent alias → caller defaults to 'active'.\ninterface NodesResp { nodes?: Array<{ alias?: string; node_id?: string; lifecycle_state?: string | null }>; }\nexport function useNodeLifecycle() {\n const { networkId } = useNetworkId();\n const { data, error } = useSWR<NodesResp>(\n withNetwork('/api/hub/nodes', networkId),\n fetcher,\n SWR_OPTIONS,\n );\n const lifecycleByAlias: Record<string, string> = {};\n const nodeIdByAlias: Record<string, string> = {};\n for (const n of data?.nodes ?? []) {\n if (n.alias && typeof n.lifecycle_state === 'string') lifecycleByAlias[n.alias] = n.lifecycle_state;\n if (n.alias && typeof n.node_id === 'string') nodeIdByAlias[n.alias] = n.node_id;\n }\n return { lifecycleByAlias, nodeIdByAlias, error };\n}\n\nexport function useHealth() {\n const { data, error } = useSWR<Health>('/api/hub/health', fetcher, SWR_OPTIONS);\n return { health: data || null, error };\n}\n\nexport function useAnetConfig() {\n const { data } = useSWR<AnetConfig>('/api/anet/config', fetcher, { refreshInterval: 30000 });\n return { config: data || null };\n}\n\nexport function useTasks(params?: Record<string, string>) {\n const { networkId } = useNetworkId();\n const query = new URLSearchParams({ limit: '100', ...params }).toString();\n const { data, error, isLoading } = useSWR(\n withNetwork(`/api/hub/tasks?${query}`, networkId),\n fetcher,\n SWR_OPTIONS,\n );\n return {\n tasks: data?.tasks || [],\n count: data?.count ?? 0,\n source: data?.source,\n error,\n isLoading,\n };\n}\n\nexport function useStats() {\n const { networkId } = useNetworkId();\n const { data, error } = useSWR(withNetwork('/api/hub/stats', networkId), fetcher, SWR_OPTIONS);\n return { stats: data?.ok ? data : null, error };\n}\n\nexport function useMessages(limit = 100) {\n const { networkId } = useNetworkId();\n // keepPreviousData: /messages grows `limit` when the user asks for older\n // history (#217 M5) — without it the key change would blank the list and\n // flash the skeleton while the bigger page is in flight.\n const { data, error, isLoading } = useSWR(\n withNetwork(`/api/hub/messages?limit=${limit}`, networkId),\n fetcher,\n { ...SWR_OPTIONS, keepPreviousData: true },\n );\n return { messages: data?.messages || [], error, isLoading };\n}\n","'use client';\n\nimport { useSyncExternalStore } from 'react';\n\n/* Loop R25: one pinyin matcher for every search surface (chat @-mentions,\n * /nodes, /messages). pinyin-pro stays a LAZY chunk — the dict loads on the\n * first non-empty filter, never on page load. Matching = substring OR full\n * pinyin OR initials, cached per string. Callers pair pinyinMatch() with\n * usePinyinReady() so results upgrade in place once the dict arrives. */\n\ntype PinyinFn = (text: string) => [string, string];\n\nlet py: PinyinFn | null = null;\nlet loadStarted = false;\nconst listeners = new Set<() => void>();\nconst cache = new Map<string, [string, string]>();\n\nfunction ensureLoaded() {\n if (py || loadStarted || typeof window === 'undefined') return;\n loadStarted = true;\n import('pinyin-pro')\n .then((m) => {\n py = (text: string) => [\n m.pinyin(text, { toneType: 'none', type: 'array' }).join('').toLowerCase(),\n m.pinyin(text, { pattern: 'first', toneType: 'none', type: 'array' }).join('').toLowerCase(),\n ];\n listeners.forEach((l) => l());\n })\n .catch(() => { loadStarted = false; });\n}\n\nexport function pinyinMatch(text: string, filter: string): boolean {\n const f = filter.trim().toLowerCase();\n if (!f) return true;\n if (text.toLowerCase().includes(f)) return true;\n ensureLoaded();\n if (!py) return false;\n let entry = cache.get(text);\n if (!entry) { entry = py(text); cache.set(text, entry); }\n return entry[0].includes(f) || entry[1].includes(f);\n}\n\nfunction subscribeReady(callback: () => void) {\n listeners.add(callback);\n return () => void listeners.delete(callback);\n}\n\n/** True once the pinyin dict is loaded — subscribe so the component\n * re-filters when lazy loading completes mid-typing. */\nexport function usePinyinReady(): boolean {\n return useSyncExternalStore(subscribeReady, () => Boolean(py), () => false);\n}\n","'use client';\n\n// Loop R18 (R3 i18n 还债, scoped): the WeChat-loop rounds introduced\n// user-visible Chinese strings (pill, drafts, search, lightbox, retry).\n// English-locale users saw mixed-language chrome. All call sites render\n// only after client interaction/data (never in SSR HTML), so a plain\n// navigator.language check is hydration-safe here.\nexport function isZh(): boolean {\n return typeof navigator !== 'undefined' && (navigator.language || '').toLowerCase().startsWith('zh');\n}\n\nexport function t(zh: string, en: string): string {\n return isZh() ? zh : en;\n}\n","'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\n// ── #492 preview half — inline image/video display ───────────────\n//\n// See docs/design-492-inline-preview.md for the full design rationale\n// (通信龙 v2 review approved the \"never inline\" structure).\n//\n// The proxy at /api/hub/files/[fileId] ALWAYS returns bytes with\n// `Content-Disposition: attachment` + `nosniff`. It also stamps a\n// `X-Verified-Type` header when the file matches a magic-bytes-verified\n// safe-media type. Client:\n// 1. Fetches via the download proxy (browser downloads bytes to memory)\n// 2. Reads `X-Verified-Type` — if absent, falls back to download card\n// 3. Constructs `new Blob([bytes], {type: X-Verified-Type})`\n// 4. `URL.createObjectURL(blob)` → `<img>` / `<video>` src\n//\n// The blob URL is a browser-owned handle, isolated from the dashboard\n// origin. A whitelist bug can degrade rendering (image won't load) but\n// can NEVER become an XSS on the dashboard origin.\n\n/** Client-side ext hint — used ONLY to decide whether it's worth\n * fetching the file to try the preview. The SERVER decides\n * authoritatively whether to expose `X-Verified-Type` via magic\n * bytes; this list just avoids fetching a PDF just to learn it\n * isn't inline-able. Under-selection here = missed preview\n * opportunity (only a UX cost). Over-selection = wasted fetch that\n * falls back to card (only a bandwidth cost). Nothing security. */\nconst PREVIEW_HINT_EXTS = new Set([\n 'png', 'jpg', 'jpeg', 'gif', 'webp',\n 'mp4', 'webm', 'mov', // .mov may or may not verify as mp4; server decides\n]);\n\nconst IMAGE_MIMES = new Set(['image/png', 'image/jpeg', 'image/gif', 'image/webp']);\nconst VIDEO_MIMES = new Set(['video/mp4', 'video/webm']);\n\n/** Auto-load images below this size. Larger images render as a\n * click-to-load card to protect mobile bandwidth. Vincent uses this\n * on his phone; a full 12 MiB image auto-loading over a random\n * cellular connection is not the right default. */\nconst IMAGE_AUTOLOAD_MAX_BYTES = 5 * 1024 * 1024;\n\n/**\n * #492 attachment descriptor as it appears in `meta.attachments[]` on\n * inbound tasks/messages. All fields are UNTRUSTED — the upload side\n * chose the name / mime, so treat every string as arbitrary bytes.\n * We render them as plain text, sanitize before use, and never let\n * them influence a URL beyond the strictly-regexed `file_id`.\n */\nexport interface Attachment {\n file_id?: string;\n path?: string;\n name?: string;\n mime?: string;\n size?: number;\n type?: string;\n}\n\n/** Same regex the download proxy uses. Duplicated intentionally — we\n * don't want to bundle a server import into the client. Any change\n * must be made in both places.\n * Mirrors `app/api/hub/files/[fileId]/route.ts:FILE_ID_REGEX`.\n */\nconst FILE_ID_REGEX = /^[A-Za-z0-9_-]{8,64}$/;\n\n/**\n * Sanitize a filename for display AND for the download-attribute on\n * the synthesized anchor. The upload side controls this bytes — we\n * strip anything that would break shell / display / disposition\n * headers. Also clamp length so a 4 KB path can't wall-of-text the\n * bubble.\n *\n * Kept intentionally narrow:\n * - `/` and `\\` → `_` (defeat path traversal in `<a download>`)\n * - control chars (CR/LF/TAB/NUL) → `_`\n * - leading `.` stripped (avoid hidden-file leak on download)\n * - clamp to 200 chars\n * - if empty after all that → `\"file\"` fallback\n */\nfunction sanitizeName(raw: unknown): string {\n if (typeof raw !== 'string' || raw.length === 0) return 'file';\n let s = raw\n .replace(/[/\\\\]/g, '_')\n .replace(/[\\r\\n\\t\\0]/g, '_');\n while (s.startsWith('.')) s = s.slice(1);\n if (s.length > 200) s = s.slice(0, 200);\n return s || 'file';\n}\n\n/**\n * Whitelist the mime for display. Everything outside a conservative\n * set of characters is stripped. Empty → falsy render (block hides\n * the mime chip rather than showing junk).\n */\nfunction sanitizeMime(raw: unknown): string {\n if (typeof raw !== 'string') return '';\n return raw.replace(/[^a-zA-Z0-9./+-]/g, '').slice(0, 100);\n}\n\n/**\n * Format a byte count as `\"12.4 KB\"`. Defensive on non-numeric input.\n * Empty string when the size is missing / negative — the block just\n * omits the size chip in that case.\n */\nfunction formatBytes(bytes: unknown): string {\n if (typeof bytes !== 'number' || !Number.isFinite(bytes) || bytes < 0) return '';\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n if (bytes < 1024 * 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n return `${(bytes / 1024 / 1024 / 1024).toFixed(2)} GB`;\n}\n\n/** Emoji icon by MIME family — informational only, not load-bearing. */\nfunction iconFor(mime: string, name: string): string {\n const lc = (mime || '').toLowerCase();\n const ext = (name.split('.').pop() || '').toLowerCase();\n if (lc.startsWith('image/')) return '🖼️';\n if (lc.startsWith('video/')) return '🎬';\n if (lc.startsWith('audio/')) return '🎵';\n if (lc.includes('pdf') || ext === 'pdf') return '📄';\n if (['ppt', 'pptx'].includes(ext)) return '📊';\n if (['doc', 'docx'].includes(ext)) return '📝';\n if (['xls', 'xlsx', 'csv'].includes(ext)) return '📈';\n if (['zip', 'tar', 'gz', 'rar', '7z'].includes(ext)) return '📦';\n return '📎';\n}\n\n/**\n * Render one attachment as a clickable download block.\n *\n * Click path (#492 hard gate — must produce a byte-identical file):\n * 1. `fetch('/api/hub/files/<file_id>', {credentials:'include'})`\n * — same-origin, session cookie carries auth; the server-side\n * proxy attaches the Bearer token so nothing sensitive is on\n * the client wire OR in browser history / logs.\n * 2. Response body → `blob()` (byte-preserving).\n * 3. `URL.createObjectURL(blob)` → transient blob: URL.\n * 4. Synthetic `<a href=\"blob:\" download=\"<sanitized-name>\">` +\n * programmatic click → browser starts the download using the\n * sanitized filename.\n * 5. `URL.revokeObjectURL()` in a `finally` so the blob is GC'd\n * even if the click flow throws mid-way.\n *\n * If the attachment has no `file_id` (a legacy path-only attachment\n * from a single-host feishu adapter that predates cross-host upload),\n * we render an informational block with the path visible but no\n * download button — the block honestly signals \"can't fetch this\n * cross-host, needs re-upload\".\n *\n * Errors surface via a small inline error string, not `alert()`, so\n * the chat scroll position isn't lost. Two seconds of visible\n * feedback is enough for the user to see + retry.\n */\n/** Shared blob-URL fetcher — returns {blobUrl, verifiedType} or\n * throws. Used by both InlineImage/InlineVideo (for preview) and\n * the download button (for the save-to-disk flow). Caller owns the\n * returned blobUrl lifecycle (must revoke). */\nasync function fetchVerified(fileId: string): Promise<{ blobUrl: string; verifiedType: string | null; blob: Blob }> {\n const res = await fetch(`/api/hub/files/${encodeURIComponent(fileId)}`, {\n credentials: 'include',\n });\n if (!res.ok) throw new Error(`HTTP ${res.status}`);\n // Header lookup is case-insensitive; Next's Response uses this pattern.\n const verifiedType = res.headers.get('x-verified-type');\n // Only trust the whitelist values — anything else is dropped so a\n // future server bug can't smuggle an arbitrary type in.\n const trusted =\n verifiedType && (IMAGE_MIMES.has(verifiedType) || VIDEO_MIMES.has(verifiedType))\n ? verifiedType\n : null;\n const rawBlob = await res.blob();\n const blob = trusted ? new Blob([rawBlob], { type: trusted }) : rawBlob;\n return { blobUrl: URL.createObjectURL(blob), verifiedType: trusted, blob };\n}\n\n/** Filename extension helper — lowercase, no dot, empty for extensionless. */\nfunction extOf(name: string): string {\n const i = name.lastIndexOf('.');\n return i >= 0 ? name.slice(i + 1).toLowerCase() : '';\n}\n\n/** True when it's worth trying an inline preview (client-side hint\n * only — server decides authoritatively). */\nfunction shouldTryPreview(name: string, mime: string): boolean {\n if (IMAGE_MIMES.has(mime) || VIDEO_MIMES.has(mime)) return true;\n const ext = extOf(name);\n return ext !== '' && PREVIEW_HINT_EXTS.has(ext);\n}\n\n/**\n * Inline image preview. Auto-loads for images below\n * IMAGE_AUTOLOAD_MAX_BYTES; renders a click-to-load card for larger\n * images (mobile bandwidth protection). If the server doesn't return\n * `X-Verified-Type` in the whitelist, or if the fetch fails, calls\n * `onNotInlineable` so the parent falls back to the download card.\n */\nfunction InlineImage({\n fileId,\n name,\n size,\n onNotInlineable,\n}: {\n fileId: string;\n name: string;\n size: number | undefined;\n onNotInlineable: () => void;\n}) {\n const autoLoad = typeof size === 'number' && size <= IMAGE_AUTOLOAD_MAX_BYTES;\n const [blobUrl, setBlobUrl] = useState<string | null>(null);\n const [loading, setLoading] = useState(false);\n const [failed, setFailed] = useState(false);\n const notInlineableRef = useRef(onNotInlineable);\n notInlineableRef.current = onNotInlineable;\n\n const load = useCallback(async () => {\n if (loading || blobUrl) return;\n setLoading(true);\n try {\n const { blobUrl: url, verifiedType } = await fetchVerified(fileId);\n if (!verifiedType || !IMAGE_MIMES.has(verifiedType)) {\n // Server declined — the file's real type isn't a safe image.\n // Release the URL immediately and hand off to the download card.\n URL.revokeObjectURL(url);\n notInlineableRef.current();\n return;\n }\n setBlobUrl(url);\n } catch {\n setFailed(true);\n } finally {\n setLoading(false);\n }\n }, [fileId, loading, blobUrl]);\n\n useEffect(() => {\n if (autoLoad) void load();\n }, [autoLoad, load]);\n\n // Revoke on unmount OR when blobUrl replaced.\n useEffect(() => {\n if (!blobUrl) return;\n return () => URL.revokeObjectURL(blobUrl);\n }, [blobUrl]);\n\n if (failed) {\n return (\n <div className=\"mt-2 rounded-lg border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-sm text-amber-200\">\n 图片加载失败 · 请点击下方下载按钮查看\n </div>\n );\n }\n\n if (blobUrl) {\n return (\n <div className=\"mt-2 overflow-hidden rounded-lg border border-white/10 bg-black/20\">\n {/* eslint-disable-next-line @next/next/no-img-element -- blob: URL, next/image can't handle */}\n <img\n src={blobUrl}\n alt={name}\n className=\"block max-h-[50vh] w-auto max-w-full cursor-zoom-in object-contain\"\n // \"Open in new tab\" satisfies the \"点开大图\" acceptance gate\n // without threading blob URLs through the multi-image\n // TaskChatPanel lightbox (that integration is a follow-up).\n onClick={() => window.open(blobUrl, '_blank', 'noopener')}\n />\n </div>\n );\n }\n\n // Not loaded yet — either loading spinner or click-to-load card.\n return (\n <button\n type=\"button\"\n onClick={load}\n disabled={loading}\n className=\"mt-2 flex w-full items-center gap-2 rounded-lg border border-cyan-500/20 bg-cyan-500/5 px-3 py-2 text-left text-sm text-cyan-100 transition hover:border-cyan-400/40 hover:bg-cyan-500/10 disabled:cursor-wait disabled:opacity-60\"\n >\n <span aria-hidden className=\"text-lg\">🖼️</span>\n <span className=\"min-w-0 flex-1 truncate\">{name}</span>\n <span className=\"shrink-0 text-xs text-cyan-300\">\n {loading ? '加载中…' : '点击查看'}\n </span>\n </button>\n );\n}\n\n/**\n * Inline video preview. NEVER auto-loads — 5 videos on-screen at\n * 12 MiB each = 60 MiB memory spike. Renders a poster card that\n * fetches + creates the blob only on click, then swaps to\n * `<video controls autoplay>`.\n *\n * Trade-off (per design doc §5.2): blob URL means full file\n * downloaded before first byte plays; there's no range/seek. Fine\n * under the current 12 MiB hub cap; if the cap ever rises, this\n * component needs a real streaming source (server-side signed URL\n * with byte-range support), not a blob.\n */\nfunction InlineVideo({\n fileId,\n name,\n onNotInlineable,\n}: {\n fileId: string;\n name: string;\n onNotInlineable: () => void;\n}) {\n const [blobUrl, setBlobUrl] = useState<string | null>(null);\n const [loading, setLoading] = useState(false);\n const [failed, setFailed] = useState(false);\n const notInlineableRef = useRef(onNotInlineable);\n notInlineableRef.current = onNotInlineable;\n\n const load = useCallback(async () => {\n if (loading || blobUrl) return;\n setLoading(true);\n try {\n const { blobUrl: url, verifiedType } = await fetchVerified(fileId);\n if (!verifiedType || !VIDEO_MIMES.has(verifiedType)) {\n URL.revokeObjectURL(url);\n notInlineableRef.current();\n return;\n }\n setBlobUrl(url);\n } catch {\n setFailed(true);\n } finally {\n setLoading(false);\n }\n }, [fileId, loading, blobUrl]);\n\n useEffect(() => {\n if (!blobUrl) return;\n return () => URL.revokeObjectURL(blobUrl);\n }, [blobUrl]);\n\n if (failed) {\n return (\n <div className=\"mt-2 rounded-lg border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-sm text-amber-200\">\n 视频加载失败 · 请点击下方下载按钮查看\n </div>\n );\n }\n\n if (blobUrl) {\n return (\n <div className=\"mt-2 overflow-hidden rounded-lg border border-white/10 bg-black/20\">\n <video\n src={blobUrl}\n controls\n autoPlay\n className=\"block max-h-[50vh] w-full\"\n >\n 您的浏览器不支持内联视频播放,请下载后查看。\n </video>\n </div>\n );\n }\n\n return (\n <button\n type=\"button\"\n onClick={load}\n disabled={loading}\n className=\"mt-2 flex w-full items-center gap-2 rounded-lg border border-cyan-500/20 bg-cyan-500/5 px-3 py-2 text-left text-sm text-cyan-100 transition hover:border-cyan-400/40 hover:bg-cyan-500/10 disabled:cursor-wait disabled:opacity-60\"\n >\n <span aria-hidden className=\"text-lg\">🎬</span>\n <span className=\"min-w-0 flex-1 truncate\">{name}</span>\n <span className=\"shrink-0 text-xs text-cyan-300\">\n {loading ? '加载中…' : '▶ 播放'}\n </span>\n </button>\n );\n}\n\nexport function AttachmentBlock({ attachment }: { attachment: Attachment }) {\n const [downloading, setDownloading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n // Ext-based hint says \"try preview\" — set to false after the\n // server declines (no X-Verified-Type) or after a hard fetch\n // failure. Once false, only the download card renders.\n const [previewGivenUp, setPreviewGivenUp] = useState(false);\n\n const safeName = sanitizeName(attachment.name);\n const safeMime = sanitizeMime(attachment.mime);\n const safeSize = formatBytes(attachment.size);\n const icon = iconFor(safeMime, safeName);\n\n const hasValidFileId =\n typeof attachment.file_id === 'string' && FILE_ID_REGEX.test(attachment.file_id);\n\n const tryPreview = hasValidFileId && !previewGivenUp && shouldTryPreview(safeName, safeMime);\n const ext = extOf(safeName);\n // Client hint only — server verifies. We just pick which preview\n // component to try first. If the ext is ambiguous (e.g. missing),\n // default to image since image detection is cheap and safe.\n const previewKind: 'image' | 'video' | null = tryPreview\n ? (VIDEO_MIMES.has(safeMime) || ['mp4', 'webm', 'mov'].includes(ext) ? 'video' : 'image')\n : null;\n\n async function handleDownload() {\n if (!hasValidFileId || !attachment.file_id) return;\n setError(null);\n setDownloading(true);\n let objectUrl: string | null = null;\n try {\n const res = await fetch(\n `/api/hub/files/${encodeURIComponent(attachment.file_id)}`,\n { credentials: 'include' },\n );\n if (!res.ok) {\n throw new Error(`HTTP ${res.status}`);\n }\n const blob = await res.blob();\n objectUrl = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = objectUrl;\n a.download = safeName;\n // rel=\"noopener\" — belt on the synthetic click.\n a.rel = 'noopener';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : String(e));\n } finally {\n if (objectUrl) URL.revokeObjectURL(objectUrl);\n setDownloading(false);\n }\n }\n\n // path-only attachment (legacy) — no download button, just an\n // informational tile so the user knows what was sent even if we\n // can't fetch it.\n if (!hasValidFileId) {\n return (\n <div className=\"mt-2 flex items-center gap-2 rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-neutral-300\">\n <span aria-hidden>{icon}</span>\n <span className=\"min-w-0 flex-1 truncate\">{safeName}</span>\n {safeSize && <span className=\"shrink-0 text-xs text-neutral-500\">{safeSize}</span>}\n <span\n className=\"shrink-0 text-xs text-neutral-500\"\n title=\"Attachment has no file_id — single-host path only. Ask the sender to re-upload.\"\n >\n (host-local)\n </span>\n </div>\n );\n }\n\n return (\n <div className=\"mt-2 flex flex-col\">\n {/* Inline preview: rendered when ext hint suggests media and the\n server hasn't declined yet. On decline (`onNotInlineable`) or\n hard failure, we drop back to just the download card below. */}\n {previewKind === 'image' && attachment.file_id && (\n <InlineImage\n fileId={attachment.file_id}\n name={safeName}\n size={typeof attachment.size === 'number' ? attachment.size : undefined}\n onNotInlineable={() => setPreviewGivenUp(true)}\n />\n )}\n {previewKind === 'video' && attachment.file_id && (\n <InlineVideo\n fileId={attachment.file_id}\n name={safeName}\n onNotInlineable={() => setPreviewGivenUp(true)}\n />\n )}\n {/* Download card — always available for save-to-disk, even when\n the preview is shown. Users still need a way to save a copy\n off the ephemeral blob URL. */}\n <button\n type=\"button\"\n onClick={handleDownload}\n disabled={downloading}\n className=\"flex w-full items-center gap-2 rounded-lg border border-cyan-500/20 bg-cyan-500/5 px-3 py-2 text-left text-sm text-cyan-100 transition hover:border-cyan-400/40 hover:bg-cyan-500/10 disabled:cursor-wait disabled:opacity-60 mt-2 first:mt-0\"\n title={`Download ${safeName}`}\n >\n <span aria-hidden className=\"text-lg\">{icon}</span>\n <span className=\"min-w-0 flex-1 truncate\">{safeName}</span>\n {safeSize && <span className=\"shrink-0 text-xs text-neutral-400\">{safeSize}</span>}\n {safeMime && (\n <span className=\"shrink-0 rounded bg-white/5 px-1.5 py-0.5 text-[10px] text-neutral-400\">\n {safeMime}\n </span>\n )}\n <span className=\"shrink-0 text-xs text-cyan-300\">\n {downloading ? '下载中…' : error ? `⚠ ${error}` : '↓ 下载'}\n </span>\n </button>\n </div>\n );\n}\n\n/**\n * Parse `attachments[]` from a message-like row. Accepts both the\n * pre-parsed `meta.attachments` shape and the raw `meta_json` string\n * shape (hub returns the latter from `SELECT *` on the tasks table\n * because SQLite stores meta_json as TEXT).\n *\n * Returns `[]` for anything that isn't a shape-valid array of objects\n * — never throws. Callers can render freely without try/catch.\n */\nexport function extractAttachments(row: unknown): Attachment[] {\n if (!row || typeof row !== 'object') return [];\n const record = row as Record<string, unknown>;\n\n // Try pre-parsed `meta` first.\n let meta: unknown = record.meta;\n\n // Fall back to `meta_json` (raw TEXT column).\n if (!meta && typeof record.meta_json === 'string' && record.meta_json.length > 0) {\n try {\n meta = JSON.parse(record.meta_json);\n } catch {\n return [];\n }\n }\n\n if (!meta || typeof meta !== 'object') return [];\n const metaObj = meta as Record<string, unknown>;\n const raw = metaObj.attachments;\n if (!Array.isArray(raw)) return [];\n\n return raw\n .filter((a): a is Record<string, unknown> => !!a && typeof a === 'object')\n .map((a) => ({\n file_id: typeof a.file_id === 'string' ? a.file_id : undefined,\n path: typeof a.path === 'string' ? a.path : undefined,\n name: typeof a.name === 'string' ? a.name : undefined,\n mime: typeof a.mime === 'string' ? a.mime : undefined,\n size: typeof a.size === 'number' ? a.size : undefined,\n type: typeof a.type === 'string' ? a.type : undefined,\n }));\n}\n"],"names":["fetcher","url","res","fetch","status","window","location","assign","Error","json","SWR_OPTIONS","refreshInterval","dedupingInterval","withNetwork","networkId","sep","includes","encodeURIComponent","useSessions","data","error","isLoading","sessions","hint","_hint","useNodeLifecycle","lifecycleByAlias","nodeIdByAlias","n","nodes","alias","lifecycle_state","node_id","useHealth","health","useAnetConfig","config","useTasks","params","query","URLSearchParams","limit","toString","tasks","count","source","useStats","stats","ok","useMessages","keepPreviousData","messages","py","loadStarted","listeners","Set","cache","Map","ensureLoaded","pinyinMatch","text","filter","f","trim","toLowerCase","entry","get","set","subscribeReady","callback","add","delete","usePinyinReady","Boolean","PREVIEW_HINT_EXTS","IMAGE_MIMES","VIDEO_MIMES","IMAGE_AUTOLOAD_MAX_BYTES","FILE_ID_REGEX","sanitizeName","raw","length","s","replace","startsWith","slice","sanitizeMime","formatBytes","bytes","Number","isFinite","toFixed","iconFor","mime","name","lc","ext","split","pop","fetchVerified","fileId","credentials","verifiedType","headers","trusted","has","rawBlob","blob","Blob","type","blobUrl","URL","createObjectURL","extOf","i","lastIndexOf","shouldTryPreview","InlineImage","size","onNotInlineable","autoLoad","setBlobUrl","loading","setLoading","failed","setFailed","notInlineableRef","current","load","revokeObjectURL","className","src","alt","onClick","open","disabled","InlineVideo","controls","autoPlay","AttachmentBlock","attachment","downloading","setDownloading","setError","previewGivenUp","setPreviewGivenUp","safeName","safeMime","safeSize","icon","hasValidFileId","file_id","test","tryPreview","previewKind","handleDownload","objectUrl","a","document","createElement","href","download","rel","body","appendChild","click","removeChild","e","message","String","title","undefined","extractAttachments","row","record","meta","meta_json","JSON","parse","metaObj","attachments","Array","isArray","map","path"],"mappings":"uCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OAEA,IAAMA,EAAU,MAAOC,IACrB,IAAMC,EAAM,MAAMC,MAAMF,GACxB,GAAmB,KAAK,CAApBC,EAAIE,MAAM,CAEZ,MADAC,OAAOC,QAAQ,CAACC,MAAM,CAAC,UACjB,AAAIC,MAAM,gBAElB,OAAON,EAAIO,IAAI,EACjB,EAEMC,EAAc,CAAEC,gBAAiB,IAAMC,iBAAkB,GAAK,EAGpE,SAASC,EAAYZ,CAAW,CAAEa,CAAiB,EACjD,GAAI,CAACA,EAAW,OAAOb,EACvB,IAAMc,EAAMd,EAAIe,QAAQ,CAAC,KA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