@yxp934/prompt-tree 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +8 -6
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/react-loadable-manifest.json +9 -1
  5. package/.next/standalone/.next/routes-manifest.json +12 -0
  6. package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  9. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  21. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  22. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  24. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/standalone/.next/server/app/api/agent/route.js +2 -2
  28. package/.next/standalone/.next/server/app/api/agent/route_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/api/agent-step/route.js +5 -0
  30. package/.next/standalone/.next/server/app/api/agent-step/route.js.nft.json +1 -0
  31. package/.next/standalone/.next/server/app/api/agent-step/route_client-reference-manifest.js +1 -0
  32. package/.next/standalone/.next/server/app/api/chat/route.js +1 -1
  33. package/.next/standalone/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/api/embeddings/route.js +1 -0
  35. package/.next/standalone/.next/server/app/api/embeddings/route.js.nft.json +1 -0
  36. package/.next/standalone/.next/server/app/api/embeddings/route_client-reference-manifest.js +1 -0
  37. package/.next/standalone/.next/server/app/api/providers/health/route_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/api/providers/models/route_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/api/providers/test/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/api/tools/mcp/call-tool/route_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/api/tools/mcp/list-tools/route_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/api/tools/mcp/test/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/api/tools/python/route_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/api/tools/search/route_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/index.html +2 -2
  46. package/.next/standalone/.next/server/app/index.rsc +4 -4
  47. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  48. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  49. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  50. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
  51. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  52. package/.next/standalone/.next/server/app/page.js +7 -3
  53. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/settings/page.js +5 -2
  56. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/settings.html +1 -1
  59. package/.next/standalone/.next/server/app/settings.rsc +4 -4
  60. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +4 -4
  61. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  62. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +3 -3
  63. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  64. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  65. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  66. package/.next/standalone/.next/server/app-paths-manifest.json +8 -6
  67. package/.next/standalone/.next/server/chunks/270.js +2 -0
  68. package/.next/standalone/.next/server/chunks/471.js +4 -4
  69. package/.next/standalone/.next/server/chunks/732.js +4 -4
  70. package/.next/standalone/.next/server/chunks/734.js +1 -1
  71. package/.next/standalone/.next/server/chunks/815.js +1 -0
  72. package/.next/standalone/.next/server/functions-config-manifest.json +2 -0
  73. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  74. package/.next/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  75. package/.next/standalone/.next/server/pages/404.html +1 -1
  76. package/.next/standalone/.next/server/pages/500.html +2 -2
  77. package/.next/standalone/.next/static/chunks/379-4a9ebb3f3e23a072.js +1 -0
  78. package/.next/standalone/.next/static/chunks/618-fe65295d23f513e9.js +30 -0
  79. package/.next/standalone/.next/static/chunks/619.cfe242be4c0b83c0.js +1 -0
  80. package/.next/standalone/.next/static/chunks/991-3901e4f7973e3bc4.js +4 -0
  81. package/.next/standalone/.next/static/chunks/9b0008ae.ebbbe0264e8b748d.js +2 -0
  82. package/.next/standalone/.next/static/chunks/app/_global-error/page-0eb119f31700800c.js +1 -0
  83. package/.next/standalone/.next/static/chunks/app/api/agent/route-0eb119f31700800c.js +1 -0
  84. package/.next/standalone/.next/static/chunks/app/api/agent-step/route-0eb119f31700800c.js +1 -0
  85. package/.next/standalone/.next/static/chunks/app/api/chat/route-0eb119f31700800c.js +1 -0
  86. package/.next/standalone/.next/static/chunks/app/api/embeddings/route-0eb119f31700800c.js +1 -0
  87. package/.next/standalone/.next/static/chunks/app/api/providers/health/route-0eb119f31700800c.js +1 -0
  88. package/.next/standalone/.next/static/chunks/app/api/providers/models/route-0eb119f31700800c.js +1 -0
  89. package/.next/standalone/.next/static/chunks/app/api/providers/test/route-0eb119f31700800c.js +1 -0
  90. package/.next/standalone/.next/static/chunks/app/api/tools/mcp/call-tool/route-0eb119f31700800c.js +1 -0
  91. package/.next/standalone/.next/static/chunks/app/api/tools/mcp/list-tools/route-0eb119f31700800c.js +1 -0
  92. package/.next/standalone/.next/static/chunks/app/api/tools/mcp/test/route-0eb119f31700800c.js +1 -0
  93. package/.next/standalone/.next/static/chunks/app/api/tools/python/route-0eb119f31700800c.js +1 -0
  94. package/.next/standalone/.next/static/chunks/app/api/tools/search/route-0eb119f31700800c.js +1 -0
  95. package/.next/standalone/.next/static/chunks/app/{layout-7950581b06dcfcd2.js → layout-a6642f336c41f8a8.js} +1 -1
  96. package/.next/standalone/.next/static/chunks/app/page-86696f7cf6c50ff2.js +3 -0
  97. package/.next/standalone/.next/static/chunks/app/settings/page-4b5b4a44edd184b3.js +4 -0
  98. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-0eb119f31700800c.js +1 -0
  99. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-0eb119f31700800c.js +1 -0
  100. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-0eb119f31700800c.js +1 -0
  101. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-0eb119f31700800c.js +1 -0
  102. package/.next/standalone/.next/static/chunks/webpack-d7f56a24ad86f880.js +1 -0
  103. package/.next/standalone/.next/static/css/06344f8f74fa92db.css +1 -0
  104. package/.next/standalone/.next/static/x3zkptkvP5NCSRahifp2M/_buildManifest.js +1 -0
  105. package/.next/standalone/package.json +2 -1
  106. package/README.md +27 -6
  107. package/README.zh-CN.md +27 -6
  108. package/package.json +2 -1
  109. package/.next/standalone/.next/server/chunks/689.js +0 -1
  110. package/.next/standalone/.next/static/chunks/308-9aca2a7bf1797568.js +0 -2
  111. package/.next/standalone/.next/static/chunks/394-dc41566095beafcf.js +0 -30
  112. package/.next/standalone/.next/static/chunks/787-12058ee9986bdbfc.js +0 -1
  113. package/.next/standalone/.next/static/chunks/app/_global-error/page-f941084711d16ad3.js +0 -1
  114. package/.next/standalone/.next/static/chunks/app/api/agent/route-f941084711d16ad3.js +0 -1
  115. package/.next/standalone/.next/static/chunks/app/api/chat/route-f941084711d16ad3.js +0 -1
  116. package/.next/standalone/.next/static/chunks/app/api/providers/health/route-f941084711d16ad3.js +0 -1
  117. package/.next/standalone/.next/static/chunks/app/api/providers/models/route-f941084711d16ad3.js +0 -1
  118. package/.next/standalone/.next/static/chunks/app/api/providers/test/route-f941084711d16ad3.js +0 -1
  119. package/.next/standalone/.next/static/chunks/app/api/tools/mcp/call-tool/route-f941084711d16ad3.js +0 -1
  120. package/.next/standalone/.next/static/chunks/app/api/tools/mcp/list-tools/route-f941084711d16ad3.js +0 -1
  121. package/.next/standalone/.next/static/chunks/app/api/tools/mcp/test/route-f941084711d16ad3.js +0 -1
  122. package/.next/standalone/.next/static/chunks/app/api/tools/python/route-f941084711d16ad3.js +0 -1
  123. package/.next/standalone/.next/static/chunks/app/api/tools/search/route-f941084711d16ad3.js +0 -1
  124. package/.next/standalone/.next/static/chunks/app/page-c273f2f3b7ce1609.js +0 -1
  125. package/.next/standalone/.next/static/chunks/app/settings/page-76e3d482410f0adc.js +0 -1
  126. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-f941084711d16ad3.js +0 -1
  127. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-f941084711d16ad3.js +0 -1
  128. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-f941084711d16ad3.js +0 -1
  129. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f941084711d16ad3.js +0 -1
  130. package/.next/standalone/.next/static/chunks/webpack-03a911206b5adca4.js +0 -1
  131. package/.next/standalone/.next/static/css/100bba9d1b2ebade.css +0 -1
  132. package/.next/standalone/.next/static/i6P3teUAVQJ-hEG3Y6KV0/_buildManifest.js +0 -1
  133. /package/.next/standalone/.next/static/{i6P3teUAVQJ-hEG3Y6KV0 → x3zkptkvP5NCSRahifp2M}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><!--i6P3teUAVQJ_hEG3Y6KV0--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/100bba9d1b2ebade.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-03a911206b5adca4.js"/><script src="/_next/static/chunks/4bd1b696-096d35a2bd1da3af.js" async=""></script><script src="/_next/static/chunks/794-11669f2ffddff399.js" async=""></script><script src="/_next/static/chunks/main-app-bcf27a314679cd6c.js" async=""></script><script src="/_next/static/chunks/394-dc41566095beafcf.js" async=""></script><script src="/_next/static/chunks/app/layout-7950581b06dcfcd2.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Prompt Tree - AI Dialogue Topology</title><meta name="description" content="A visual dialogue tree interface for AI conversations with context management and token optimization."/><meta name="author" content="Prompt Tree Team"/><meta name="keywords" content="AI,dialogue,chat,context,topology,tree"/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/icon.svg"/><link rel="apple-touch-icon" href="/icon.svg"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-03a911206b5adca4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[4151,[\"394\",\"static/chunks/394-dc41566095beafcf.js\",\"177\",\"static/chunks/app/layout-7950581b06dcfcd2.js\"],\"default\"]\n3:I[7121,[],\"\"]\n4:I[4581,[],\"\"]\n5:I[484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[484,[],\"ViewportBoundary\"]\na:I[484,[],\"MetadataBoundary\"]\nc:I[7123,[],\"\"]\n:HL[\"/_next/static/css/100bba9d1b2ebade.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"i6P3teUAVQJ-hEG3Y6KV0\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/100bba9d1b2ebade.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"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.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[6869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Prompt Tree - AI Dialogue Topology\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"A visual dialogue tree interface for AI conversations with context management and token optimization.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"author\",\"content\":\"Prompt Tree Team\"}],[\"$\",\"meta\",\"3\",{\"name\":\"keywords\",\"content\":\"AI,dialogue,chat,context,topology,tree\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?603d046c9a6fdfbb\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"/icon.svg\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icon.svg\"}],[\"$\",\"$Ld\",\"7\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--x3zkptkvP5NCSRahifp2M--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/06344f8f74fa92db.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d7f56a24ad86f880.js"/><script src="/_next/static/chunks/4bd1b696-096d35a2bd1da3af.js" async=""></script><script src="/_next/static/chunks/794-11669f2ffddff399.js" async=""></script><script src="/_next/static/chunks/main-app-bcf27a314679cd6c.js" async=""></script><script src="/_next/static/chunks/618-fe65295d23f513e9.js" async=""></script><script src="/_next/static/chunks/app/layout-a6642f336c41f8a8.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Prompt Tree - AI Dialogue Topology</title><meta name="description" content="A visual dialogue tree interface for AI conversations with context management and token optimization."/><meta name="author" content="Prompt Tree Team"/><meta name="keywords" content="AI,dialogue,chat,context,topology,tree"/><link rel="icon" href="/favicon.ico?603d046c9a6fdfbb" type="image/x-icon" sizes="16x16"/><link rel="icon" href="/icon.svg"/><link rel="apple-touch-icon" href="/icon.svg"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-d7f56a24ad86f880.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[4151,[\"618\",\"static/chunks/618-fe65295d23f513e9.js\",\"177\",\"static/chunks/app/layout-a6642f336c41f8a8.js\"],\"default\"]\n3:I[7121,[],\"\"]\n4:I[4581,[],\"\"]\n5:I[484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[484,[],\"ViewportBoundary\"]\na:I[484,[],\"MetadataBoundary\"]\nc:I[7123,[],\"\"]\n:HL[\"/_next/static/css/06344f8f74fa92db.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"x3zkptkvP5NCSRahifp2M\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/06344f8f74fa92db.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"antialiased\",\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"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.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[6869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Prompt Tree - AI Dialogue Topology\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"A visual dialogue tree interface for AI conversations with context management and token optimization.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"author\",\"content\":\"Prompt Tree Team\"}],[\"$\",\"meta\",\"3\",{\"name\":\"keywords\",\"content\":\"AI,dialogue,chat,context,topology,tree\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?603d046c9a6fdfbb\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"/icon.svg\"}],[\"$\",\"link\",\"6\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icon.svg\"}],[\"$\",\"$Ld\",\"7\",{}]]\n"])</script></body></html>
@@ -1,5 +1,5 @@
1
1
  1:"$Sreact.fragment"
2
- 2:I[4151,["394","static/chunks/394-dc41566095beafcf.js","177","static/chunks/app/layout-7950581b06dcfcd2.js"],"default"]
2
+ 2:I[4151,["618","static/chunks/618-fe65295d23f513e9.js","177","static/chunks/app/layout-a6642f336c41f8a8.js"],"default"]
3
3
  3:I[7121,[],""]
4
4
  4:I[4581,[],""]
5
5
  5:I[484,[],"OutletBoundary"]
@@ -7,8 +7,8 @@
7
7
  8:I[484,[],"ViewportBoundary"]
8
8
  a:I[484,[],"MetadataBoundary"]
9
9
  c:I[7123,[],""]
10
- :HL["/_next/static/css/100bba9d1b2ebade.css","style"]
11
- 0:{"P":null,"b":"i6P3teUAVQJ-hEG3Y6KV0","c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/100bba9d1b2ebade.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased","children":[["$","$L2",null,{}],["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[]],"S":true}
10
+ :HL["/_next/static/css/06344f8f74fa92db.css","style"]
11
+ 0:{"P":null,"b":"x3zkptkvP5NCSRahifp2M","c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/06344f8f74fa92db.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased","children":[["$","$L2",null,{}],["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[]],"S":true}
12
12
  9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
13
13
  d:I[6869,[],"IconMark"]
14
14
  7:null
@@ -1,5 +1,5 @@
1
1
  1:"$Sreact.fragment"
2
- 2:I[4151,["394","static/chunks/394-dc41566095beafcf.js","177","static/chunks/app/layout-7950581b06dcfcd2.js"],"default"]
2
+ 2:I[4151,["618","static/chunks/618-fe65295d23f513e9.js","177","static/chunks/app/layout-a6642f336c41f8a8.js"],"default"]
3
3
  3:I[7121,[],""]
4
4
  4:I[4581,[],""]
5
5
  5:I[484,[],"OutletBoundary"]
@@ -7,8 +7,8 @@
7
7
  8:I[484,[],"ViewportBoundary"]
8
8
  a:I[484,[],"MetadataBoundary"]
9
9
  c:I[7123,[],""]
10
- :HL["/_next/static/css/100bba9d1b2ebade.css","style"]
11
- 0:{"P":null,"b":"i6P3teUAVQJ-hEG3Y6KV0","c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/100bba9d1b2ebade.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased","children":[["$","$L2",null,{}],["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[]],"S":true}
10
+ :HL["/_next/static/css/06344f8f74fa92db.css","style"]
11
+ 0:{"P":null,"b":"x3zkptkvP5NCSRahifp2M","c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/06344f8f74fa92db.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased","children":[["$","$L2",null,{}],["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c",[]],"S":true}
12
12
  9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
13
13
  d:I[6869,[],"IconMark"]
14
14
  7:null
@@ -3,4 +3,4 @@
3
3
  3:I[484,[],"MetadataBoundary"]
4
4
  4:"$Sreact.suspense"
5
5
  5:I[6869,[],"IconMark"]
6
- 0:{"buildId":"i6P3teUAVQJ-hEG3Y6KV0","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Prompt Tree - AI Dialogue Topology"}],["$","meta","1",{"name":"description","content":"A visual dialogue tree interface for AI conversations with context management and token optimization."}],["$","meta","2",{"name":"author","content":"Prompt Tree Team"}],["$","meta","3",{"name":"keywords","content":"AI,dialogue,chat,context,topology,tree"}],["$","link","4",{"rel":"icon","href":"/favicon.ico?603d046c9a6fdfbb","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"/icon.svg"}],["$","link","6",{"rel":"apple-touch-icon","href":"/icon.svg"}],["$","$L5","7",{}]]}]}]}],null]}],"loading":null,"isPartial":false}
6
+ 0:{"buildId":"x3zkptkvP5NCSRahifp2M","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Prompt Tree - AI Dialogue Topology"}],["$","meta","1",{"name":"description","content":"A visual dialogue tree interface for AI conversations with context management and token optimization."}],["$","meta","2",{"name":"author","content":"Prompt Tree Team"}],["$","meta","3",{"name":"keywords","content":"AI,dialogue,chat,context,topology,tree"}],["$","link","4",{"rel":"icon","href":"/favicon.ico?603d046c9a6fdfbb","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"/icon.svg"}],["$","link","6",{"rel":"apple-touch-icon","href":"/icon.svg"}],["$","$L5","7",{}]]}]}]}],null]}],"loading":null,"isPartial":false}
@@ -1,6 +1,6 @@
1
1
  1:"$Sreact.fragment"
2
- 2:I[4151,["394","static/chunks/394-dc41566095beafcf.js","177","static/chunks/app/layout-7950581b06dcfcd2.js"],"default"]
2
+ 2:I[4151,["618","static/chunks/618-fe65295d23f513e9.js","177","static/chunks/app/layout-a6642f336c41f8a8.js"],"default"]
3
3
  3:I[7121,[],""]
4
4
  4:I[4581,[],""]
5
- :HL["/_next/static/css/100bba9d1b2ebade.css","style"]
6
- 0:{"buildId":"i6P3teUAVQJ-hEG3Y6KV0","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/100bba9d1b2ebade.css","precedence":"next"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased","children":[["$","$L2",null,{}],["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}]}]]}]}]]}],"loading":null,"isPartial":false}
5
+ :HL["/_next/static/css/06344f8f74fa92db.css","style"]
6
+ 0:{"buildId":"x3zkptkvP5NCSRahifp2M","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/06344f8f74fa92db.css","precedence":"next"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"antialiased","children":[["$","$L2",null,{}],["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}]}]]}]}]]}],"loading":null,"isPartial":false}
@@ -1,5 +1,5 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[484,[],"OutletBoundary"]
3
3
  3:"$Sreact.suspense"
4
- 0:{"buildId":"i6P3teUAVQJ-hEG3Y6KV0","rsc":["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false}
4
+ 0:{"buildId":"x3zkptkvP5NCSRahifp2M","rsc":["$","$1","c",{"children":[[["$","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."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false}
5
5
  4:null
@@ -1,4 +1,4 @@
1
1
  1:"$Sreact.fragment"
2
2
  2:I[7121,[],""]
3
3
  3:I[4581,[],""]
4
- 0:{"buildId":"i6P3teUAVQJ-hEG3Y6KV0","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false}
4
+ 0:{"buildId":"x3zkptkvP5NCSRahifp2M","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false}
@@ -1,2 +1,2 @@
1
- :HL["/_next/static/css/100bba9d1b2ebade.css","style"]
2
- 0:{"buildId":"i6P3teUAVQJ-hEG3Y6KV0","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"_not-found","paramType":null,"paramKey":"_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
1
+ :HL["/_next/static/css/06344f8f74fa92db.css","style"]
2
+ 0:{"buildId":"x3zkptkvP5NCSRahifp2M","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"_not-found","paramType":null,"paramKey":"_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
@@ -1,5 +1,5 @@
1
- "use strict";(()=>{var a={};a.id=429,a.ids=[429],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},530:(a,b,c)=>{c.d(b,{m:()=>f});var d=c(1421);function e(a,b,c){return Number.isFinite(a)?Math.min(c,Math.max(b,Math.round(a))):b}async function f(a){let b=a.code;if(!b.trim())throw Error("Python code is empty.");let c=a.pythonCommand.trim()||"python3",f=e(a.timeoutMs,1e3,12e4),g=e(a.maxOutputChars,1e3,2e5),h=Date.now(),i=!1,j=!1,k=!1,l=(0,d.spawn)(c,["-u","-c",b],{stdio:["ignore","pipe","pipe"],env:process.env}),m={stdout:"",stderr:""},n=(a,b)=>{if(j)return;let c=g-(m.stdout.length+m.stderr.length);if(c<=0){if(j=!0,!k){k=!0;try{l.kill("SIGKILL")}catch{}}return}if(b.length<=c){m[a]+=b;return}if(m[a]+=b.slice(0,c),j=!0,!k){k=!0;try{l.kill("SIGKILL")}catch{}}};l.stdout?.setEncoding("utf8"),l.stderr?.setEncoding("utf8"),l.stdout?.on("data",a=>n("stdout",a)),l.stderr?.on("data",a=>n("stderr",a));let o=setTimeout(()=>{i=!0;try{l.kill("SIGKILL")}catch{}},f),p=await new Promise(a=>{l.on("close",b=>a(b)),l.on("error",()=>a(null))}).finally(()=>clearTimeout(o)),q=Date.now()-h;return{stdout:m.stdout,stderr:m.stderr,exitCode:p,durationMs:q,truncated:j,timedOut:i}}},535:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>N,patchFetch:()=>M,routeModule:()=>I,serverHooks:()=>L,workAsyncStorage:()=>J,workUnitAsyncStorage:()=>K});var d={};c.r(d),c.d(d,{POST:()=>H,runtime:()=>z});var e=c(9225),f=c(4006),g=c(8317),h=c(9373),i=c(4775),j=c(4235),k=c(261),l=c(4365),m=c(771),n=c(3461),o=c(7798),p=c(2280),q=c(2018),r=c(5696),s=c(7929),t=c(6439),u=c(7527),v=c(5592),w=c(1189),x=c(530),y=c(4619);let z="nodejs";function A(a){return"object"==typeof a&&null!==a}function B(a){return"string"==typeof a?a:""}function C(a){try{return JSON.stringify(a)}catch{return JSON.stringify({error:"Unserializable tool result."})}}async function D(a){let b,c=(b=a.baseUrl.trim().replace(/\/+$/,""))?b.endsWith("/chat/completions")?b:`${b}/chat/completions`:"https://api.openai.com/v1/chat/completions",d=new AbortController,e=setTimeout(()=>d.abort(),a.timeoutMs),f={...a.headers,"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},g={model:a.model,messages:a.messages,temperature:a.temperature,max_tokens:a.maxTokens,tools:a.tools.length?a.tools:void 0,tool_choice:a.tools.length?"auto":void 0,stream:a.stream};try{let b=await fetch(c,{method:"POST",headers:f,body:JSON.stringify(g),signal:d.signal});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(`LLM error (${b.status}): ${a||b.statusText}`)}if(!a.stream){let a=await b.json().catch(()=>null),c=a?.choices?.[0]?.message,d=c?.content??"",e=Array.isArray(c?.tool_calls)?c.tool_calls:[];return{content:d,toolCalls:e}}if(!b.body)throw Error("LLM returned empty stream.");let e=b.body.getReader(),h=new TextDecoder("utf-8"),i="",j="",k=new Map,l=!1;for(;;){let{value:b,done:c}=await e.read();if(c)break;let d=(i+=h.decode(b,{stream:!0})).split(/\r?\n\r?\n/);for(let b of(i=d.pop()??"",d)){for(let c of b.split(/\r?\n/)){if(!c.startsWith("data:"))continue;let b=c.replace(/^data:\s*/,"").trim();if(b){if("[DONE]"===b){l=!0;break}try{let c=JSON.parse(b),d=c.choices?.[0]?.delta,e=d?.content??"";for(let b of(e&&(j+=e,a.onDelta?.(e)),d?.tool_calls??[])){let a="number"==typeof b.index?b.index:0,c=k.get(a)??{id:"",name:"",args:""},d={id:b.id??c.id,name:b.function?.name??c.name,args:`${c.args}${b.function?.arguments??""}`};k.set(a,d)}}catch{}}}if(l)break}if(l)break}let m=Array.from(k.entries()).sort(([a],[b])=>a-b).map(([,a])=>({id:a.id,type:"function",function:{name:a.name,arguments:a.args}})).filter(a=>a.id&&a.function.name);return{content:j,toolCalls:m}}finally{clearTimeout(e)}}function E(a,b){let c=b.trim();return c?a.mcp.servers.find(a=>a.id===c)??null:null}function F(a,b){let c=b.mcp.servers.map(a=>a.id).filter(Boolean),d=new Set(c);if(a.includes("mcp"))return c;let e=a.filter(a=>a.startsWith("mcp:")).map(a=>a.slice(4).trim()).filter(a=>a&&d.has(a)),f=new Set,g=[];for(let a of e)f.has(a)||(f.add(a),g.push(a));return g}async function G(a){let{name:b,args:c,toolSettings:d,enabledMcpServerIds:e}=a;if("web_search"===b){let a=A(c)?B(c.query):"",b=A(c)&&"exa"===c.provider?"exa":A(c)&&"tavily"===c.provider?"tavily":d.search.provider,e=A(c)&&"number"==typeof c.maxResults?c.maxResults:d.search.maxResults,f=A(c)&&"advanced"===c.searchDepth?"advanced":A(c)&&"basic"===c.searchDepth?"basic":d.search.searchDepth,g="exa"===b?d.search.exaApiKey:d.search.tavilyApiKey;return(0,y.t)({provider:b,apiKey:g,query:a,maxResults:e,searchDepth:f})}if("exec_python"===b){let a=A(c)?B(c.code):"";return(0,x.m)({code:a,timeoutMs:d.python.timeoutMs,maxOutputChars:d.python.maxOutputChars,pythonCommand:d.python.pythonCommand})}if("mcp_list_tools"===b){let a=A(c)?B(c.serverId):"";if(!e.includes(a))throw Error(`MCP server not enabled: ${a}`);let b=E(d,a);if(!b)throw Error(`MCP server not found: ${a}`);return(0,w.Sp)(b)}if("mcp_call"===b){let a=A(c)?B(c.serverId):"",b=A(c)?B(c.name):"",f=A(c)?c.arguments:void 0;if(!e.includes(a))throw Error(`MCP server not enabled: ${a}`);let g=E(d,a);if(!g)throw Error(`MCP server not found: ${a}`);if(!b.trim())throw Error("Missing MCP tool name.");return(0,w.Tp)(g,b,f)}throw Error(`Unknown tool: ${b}`)}async function H(a){let b,c,d,e=await a.json().catch(()=>null);if(!A(e))return v.NextResponse.json({error:"Invalid JSON body."},{status:400});let f=B(e.apiKey).trim(),g=function(a){let b=B(a).trim();if(!b)return null;try{let a=new URL(b);if("http:"!==a.protocol&&"https:"!==a.protocol)return null;return a.toString()}catch{return null}}(e.baseUrl)??B(e.baseUrl).trim(),h=B(e.model).trim(),i=function(a){if(!Array.isArray(a))return null;let b=[];for(let c of a){if(!A(c))return null;let a=B(c.role),d=B(c.content);if("system"===a||"user"===a||"assistant"===a){b.push({role:a,content:d});continue}return null}return b}(e.messages);if(!f||!g||!h||!i)return v.NextResponse.json({error:"Missing required fields (apiKey/baseUrl/model/messages)."},{status:400});let j="number"==typeof e.temperature?e.temperature:.7,k="number"==typeof e.maxTokens?e.maxTokens:2e3,l="number"==typeof e.timeout?e.timeout:3e4,m=function(a){if(!A(a))return{};let b={};for(let[c,d]of Object.entries(a))"string"==typeof d&&d.trim()&&(b[c]=d);return b}(e.headers),n="boolean"!=typeof e.stream||e.stream,o=function(a){if(!Array.isArray(a))return[];let b=[],c=new Set;for(let d of a){if("string"!=typeof d)continue;let a=d.trim();if(!a)continue;let e="web_search"===a||"python"===a||"mcp"===a?a:a.startsWith("mcp:")&&a.slice(4).trim()?`mcp:${a.slice(4).trim()}`:null;e&&(c.has(e)||(c.add(e),b.push(e)))}return b.includes("mcp")?b.filter(a=>"web_search"===a||"python"===a||"mcp"===a):b}(e.toolUses),p=function(a){if(!A(a)||!A(a.search)||!A(a.mcp)||!A(a.python))return null;let b=a.search,c=a.mcp,d=a.python,e=(Array.isArray(c.servers)?c.servers:[]).map(a=>{if(!A(a))return null;let b=B(a.id),c=B(a.name),d="stdio"===a.transport||"sse"===a.transport?a.transport:"http",e=B(a.token),f=B(a.configJson),g="number"==typeof a.createdAt?a.createdAt:Date.now(),h="number"==typeof a.updatedAt?a.updatedAt:Date.now();return b.trim()&&c.trim()?{id:b,name:c,transport:d,token:e,configJson:f,createdAt:g,updatedAt:h}:null}).filter(a=>!!a);return{search:{provider:"exa"===b.provider?"exa":"tavily",exaApiKey:B(b.exaApiKey),tavilyApiKey:B(b.tavilyApiKey),maxResults:"number"==typeof b.maxResults?b.maxResults:5,searchDepth:"advanced"===b.searchDepth?"advanced":"basic"},mcp:{servers:e},python:{timeoutMs:"number"==typeof d.timeoutMs?d.timeoutMs:15e3,maxOutputChars:"number"==typeof d.maxOutputChars?d.maxOutputChars:2e4,pythonCommand:B(d.pythonCommand)||"python3"}}}(e.toolSettings);if(!p)return v.NextResponse.json({error:"Invalid toolSettings."},{status:400});let q=F(o,p),r=(b=new Set(o),c=[],b.has("web_search")&&c.push({type:"function",function:{name:"web_search",description:"Search the web for up-to-date information and sources.",parameters:{type:"object",properties:{query:{type:"string",description:"Search query."},provider:{type:"string",enum:["tavily","exa"]},maxResults:{type:"number",minimum:1,maximum:20},searchDepth:{type:"string",enum:["basic","advanced"]}},required:["query"],additionalProperties:!0}}}),(d=F(o,p)).length>0&&(c.push({type:"function",function:{name:"mcp_list_tools",description:"List tools available on an MCP server.",parameters:{type:"object",properties:{serverId:{type:"string",enum:d}},required:["serverId"],additionalProperties:!1}}}),c.push({type:"function",function:{name:"mcp_call",description:"Call a tool on an MCP server.",parameters:{type:"object",properties:{serverId:{type:"string",enum:d},name:{type:"string",description:"Tool name."},arguments:{type:"object",description:"Tool arguments."}},required:["serverId","name","arguments"],additionalProperties:!1}}})),b.has("python")&&c.push({type:"function",function:{name:"exec_python",description:"Execute Python code and return stdout/stderr/result metadata.",parameters:{type:"object",properties:{code:{type:"string",description:"Python code to execute."}},required:["code"],additionalProperties:!1}}}),c),s=new TextEncoder,t=new ReadableStream({start(a){let b=b=>{a.enqueue(s.encode(`data: ${C(b)}
1
+ "use strict";(()=>{var a={};a.id=429,a.ids=[429],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},530:(a,b,c)=>{c.d(b,{m:()=>f});var d=c(1421);function e(a,b,c){return Number.isFinite(a)?Math.min(c,Math.max(b,Math.round(a))):b}async function f(a){let b=a.code;if(!b.trim())throw Error("Python code is empty.");let c=a.pythonCommand.trim()||"python3",f=e(a.timeoutMs,1e3,12e4),g=e(a.maxOutputChars,1e3,2e5),h=Date.now(),i=!1,j=!1,k=!1,l=(0,d.spawn)(c,["-u","-c",b],{stdio:["ignore","pipe","pipe"],env:process.env}),m={stdout:"",stderr:""},n=(a,b)=>{if(j)return;let c=g-(m.stdout.length+m.stderr.length);if(c<=0){if(j=!0,!k){k=!0;try{l.kill("SIGKILL")}catch{}}return}if(b.length<=c){m[a]+=b;return}if(m[a]+=b.slice(0,c),j=!0,!k){k=!0;try{l.kill("SIGKILL")}catch{}}};l.stdout?.setEncoding("utf8"),l.stderr?.setEncoding("utf8"),l.stdout?.on("data",a=>n("stdout",a)),l.stderr?.on("data",a=>n("stderr",a));let o=setTimeout(()=>{i=!0;try{l.kill("SIGKILL")}catch{}},f),p=await new Promise(a=>{l.on("close",b=>a(b)),l.on("error",()=>a(null))}).finally(()=>clearTimeout(o)),q=Date.now()-h;return{stdout:m.stdout,stderr:m.stderr,exitCode:p,durationMs:q,truncated:j,timedOut:i}}},535:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>O,patchFetch:()=>N,routeModule:()=>J,serverHooks:()=>M,workAsyncStorage:()=>K,workUnitAsyncStorage:()=>L});var d={};c.r(d),c.d(d,{POST:()=>I,runtime:()=>z});var e=c(9225),f=c(4006),g=c(8317),h=c(9373),i=c(4775),j=c(4235),k=c(261),l=c(4365),m=c(771),n=c(3461),o=c(7798),p=c(2280),q=c(2018),r=c(5696),s=c(7929),t=c(6439),u=c(7527),v=c(5592),w=c(1189),x=c(530),y=c(4619);let z="nodejs";function A(a){return"object"==typeof a&&null!==a}function B(a){return"string"==typeof a?a:""}function C(a){return!!A(a)&&("text"===a.type?"string"==typeof a.text:"image_url"===a.type&&!!A(a.image_url)&&"string"==typeof a.image_url.url&&a.image_url.url.length>0)}function D(a){try{return JSON.stringify(a)}catch{return JSON.stringify({error:"Unserializable tool result."})}}async function E(a){let b,c=(b=a.baseUrl.trim().replace(/\/+$/,""))?b.endsWith("/chat/completions")?b:`${b}/chat/completions`:"https://api.openai.com/v1/chat/completions",d=new AbortController,e=setTimeout(()=>d.abort(),a.timeoutMs),f={...a.headers,"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},g={model:a.model,messages:a.messages,temperature:a.temperature,max_tokens:a.maxTokens,tools:a.tools.length?a.tools:void 0,tool_choice:a.tools.length?"auto":void 0,stream:a.stream};try{let b=await fetch(c,{method:"POST",headers:f,body:JSON.stringify(g),signal:d.signal});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(`LLM error (${b.status}): ${a||b.statusText}`)}if(!a.stream){let a=await b.json().catch(()=>null),c=a?.choices?.[0]?.message,d=c?.content??"",e=Array.isArray(c?.tool_calls)?c.tool_calls:[];return{content:d,toolCalls:e}}if(!b.body)throw Error("LLM returned empty stream.");let e=b.body.getReader(),h=new TextDecoder("utf-8"),i="",j="",k=new Map,l=!1;for(;;){let{value:b,done:c}=await e.read();if(c)break;let d=(i+=h.decode(b,{stream:!0})).split(/\r?\n\r?\n/);for(let b of(i=d.pop()??"",d)){for(let c of b.split(/\r?\n/)){if(!c.startsWith("data:"))continue;let b=c.replace(/^data:\s*/,"").trim();if(b){if("[DONE]"===b){l=!0;break}try{let c=JSON.parse(b),d=c.choices?.[0]?.delta,e=d?.content??"";for(let b of(e&&(j+=e,a.onDelta?.(e)),d?.tool_calls??[])){let a="number"==typeof b.index?b.index:0,c=k.get(a)??{id:"",name:"",args:""},d={id:b.id??c.id,name:b.function?.name??c.name,args:`${c.args}${b.function?.arguments??""}`};k.set(a,d)}}catch{}}}if(l)break}if(l)break}let m=Array.from(k.entries()).sort(([a],[b])=>a-b).map(([,a])=>({id:a.id,type:"function",function:{name:a.name,arguments:a.args}})).filter(a=>a.id&&a.function.name);return{content:j,toolCalls:m}}finally{clearTimeout(e)}}function F(a,b){let c=b.trim();return c?a.mcp.servers.find(a=>a.id===c)??null:null}function G(a,b){let c=b.mcp.servers.map(a=>a.id).filter(Boolean),d=new Set(c);if(a.includes("mcp"))return c;let e=a.filter(a=>a.startsWith("mcp:")).map(a=>a.slice(4).trim()).filter(a=>a&&d.has(a)),f=new Set,g=[];for(let a of e)f.has(a)||(f.add(a),g.push(a));return g}async function H(a){let{name:b,args:c,toolSettings:d,enabledMcpServerIds:e}=a;if("web_search"===b){let a=A(c)?B(c.query):"",b=A(c)&&"exa"===c.provider?"exa":A(c)&&"tavily"===c.provider?"tavily":d.search.provider,e=A(c)&&"number"==typeof c.maxResults?c.maxResults:d.search.maxResults,f=A(c)&&"advanced"===c.searchDepth?"advanced":A(c)&&"basic"===c.searchDepth?"basic":d.search.searchDepth,g="exa"===b?d.search.exaApiKey:d.search.tavilyApiKey;return(0,y.t)({provider:b,apiKey:g,query:a,maxResults:e,searchDepth:f})}if("exec_python"===b){let a=A(c)?B(c.code):"";return(0,x.m)({code:a,timeoutMs:d.python.timeoutMs,maxOutputChars:d.python.maxOutputChars,pythonCommand:d.python.pythonCommand})}if("mcp_list_tools"===b){let a=A(c)?B(c.serverId):"";if(!e.includes(a))throw Error(`MCP server not enabled: ${a}`);let b=F(d,a);if(!b)throw Error(`MCP server not found: ${a}`);return(0,w.Sp)(b)}if("mcp_call"===b){let a=A(c)?B(c.serverId):"",b=A(c)?B(c.name):"",f=A(c)?c.arguments:void 0;if(!e.includes(a))throw Error(`MCP server not enabled: ${a}`);let g=F(d,a);if(!g)throw Error(`MCP server not found: ${a}`);if(!b.trim())throw Error("Missing MCP tool name.");return(0,w.Tp)(g,b,f)}throw Error(`Unknown tool: ${b}`)}async function I(a){let b,c,d,e=await a.json().catch(()=>null);if(!A(e))return v.NextResponse.json({error:"Invalid JSON body."},{status:400});let f=B(e.apiKey).trim(),g=function(a){let b=B(a).trim();if(!b)return null;try{let a=new URL(b);if("http:"!==a.protocol&&"https:"!==a.protocol)return null;return a.toString()}catch{return null}}(e.baseUrl)??B(e.baseUrl).trim(),h=B(e.model).trim(),i=function(a){if(!Array.isArray(a))return null;let b=[];for(let c of a){if(!A(c))return null;let a=B(c.role);if("system"===a||"assistant"===a){if("string"!=typeof c.content)return null;b.push({role:a,content:c.content});continue}if("user"===a&&("string"==typeof c.content||Array.isArray(c.content)&&c.content.every(C))){b.push({role:a,content:c.content});continue}return null}return b}(e.messages);if(!f||!g||!h||!i)return v.NextResponse.json({error:"Missing required fields (apiKey/baseUrl/model/messages)."},{status:400});let j="number"==typeof e.temperature?e.temperature:.7,k="number"==typeof e.maxTokens?e.maxTokens:2e3,l="number"==typeof e.timeout?e.timeout:3e4,m=function(a){if(!A(a))return{};let b={};for(let[c,d]of Object.entries(a))"string"==typeof d&&d.trim()&&(b[c]=d);return b}(e.headers),n="boolean"!=typeof e.stream||e.stream,o=function(a){if(!Array.isArray(a))return[];let b=[],c=new Set;for(let d of a){if("string"!=typeof d)continue;let a=d.trim();if(!a)continue;let e="web_search"===a||"python"===a||"mcp"===a?a:a.startsWith("mcp:")&&a.slice(4).trim()?`mcp:${a.slice(4).trim()}`:null;e&&(c.has(e)||(c.add(e),b.push(e)))}return b.includes("mcp")?b.filter(a=>"web_search"===a||"python"===a||"mcp"===a):b}(e.toolUses),p=function(a){if(!A(a)||!A(a.search)||!A(a.mcp)||!A(a.python))return null;let b=a.search,c=a.mcp,d=a.python,e=(Array.isArray(c.servers)?c.servers:[]).map(a=>{if(!A(a))return null;let b=B(a.id),c=B(a.name),d="stdio"===a.transport||"sse"===a.transport?a.transport:"http",e=B(a.token),f=B(a.configJson),g="number"==typeof a.createdAt?a.createdAt:Date.now(),h="number"==typeof a.updatedAt?a.updatedAt:Date.now();return b.trim()&&c.trim()?{id:b,name:c,transport:d,token:e,configJson:f,createdAt:g,updatedAt:h}:null}).filter(a=>!!a);return{search:{provider:"exa"===b.provider?"exa":"tavily",exaApiKey:B(b.exaApiKey),tavilyApiKey:B(b.tavilyApiKey),maxResults:"number"==typeof b.maxResults?b.maxResults:5,searchDepth:"advanced"===b.searchDepth?"advanced":"basic"},mcp:{servers:e},python:{timeoutMs:"number"==typeof d.timeoutMs?d.timeoutMs:15e3,maxOutputChars:"number"==typeof d.maxOutputChars?d.maxOutputChars:2e4,pythonCommand:B(d.pythonCommand)||"python3"}}}(e.toolSettings);if(!p)return v.NextResponse.json({error:"Invalid toolSettings."},{status:400});let q=G(o,p),r=(b=new Set(o),c=[],b.has("web_search")&&c.push({type:"function",function:{name:"web_search",description:"Search the web for up-to-date information and sources.",parameters:{type:"object",properties:{query:{type:"string",description:"Search query."},provider:{type:"string",enum:["tavily","exa"]},maxResults:{type:"number",minimum:1,maximum:20},searchDepth:{type:"string",enum:["basic","advanced"]}},required:["query"],additionalProperties:!0}}}),(d=G(o,p)).length>0&&(c.push({type:"function",function:{name:"mcp_list_tools",description:"List tools available on an MCP server.",parameters:{type:"object",properties:{serverId:{type:"string",enum:d}},required:["serverId"],additionalProperties:!1}}}),c.push({type:"function",function:{name:"mcp_call",description:"Call a tool on an MCP server.",parameters:{type:"object",properties:{serverId:{type:"string",enum:d},name:{type:"string",description:"Tool name."},arguments:{type:"object",description:"Tool arguments."}},required:["serverId","name","arguments"],additionalProperties:!1}}})),b.has("python")&&c.push({type:"function",function:{name:"exec_python",description:"Execute Python code and return stdout/stderr/result metadata.",parameters:{type:"object",properties:{code:{type:"string",description:"Python code to execute."}},required:["code"],additionalProperties:!1}}}),c),s=new TextEncoder,t=new ReadableStream({start(a){let b=b=>{a.enqueue(s.encode(`data: ${D(b)}
2
2
 
3
3
  `))},c=()=>a.enqueue(new TextEncoder().encode(`data: [DONE]
4
4
 
5
- `));(async()=>{let d=i.slice(),e=r.length>0;try{for(let i=0;i<8;i+=1){b({type:"debug",message:`agent_step:${i+1}`});let o="",s=await D({apiKey:f,baseUrl:g,headers:m,timeoutMs:l,model:h,temperature:j,maxTokens:k,messages:d,tools:r,stream:n,onDelta:a=>{o+=a,b({type:"assistant_delta",delta:a})}}),t=s.toolCalls??[],u=s.content??o;if(e&&t.length>0){for(let a of(d.push({role:"assistant",content:u||null,tool_calls:t}),t)){let c=function(a){let b=a.trim();if(!b)return{};try{return JSON.parse(b)}catch{return{_raw:a}}}(a.function.arguments);b({type:"tool_call",call:{id:a.id,name:a.function.name,arguments:c}});try{let e=await G({name:a.function.name,args:c,toolSettings:p,enabledMcpServerIds:q});b({type:"tool_result",callId:a.id,name:a.function.name,result:e}),d.push({role:"tool",tool_call_id:a.id,content:C(e)})}catch(e){let c=e instanceof Error?e.message:"Tool failed";b({type:"tool_error",callId:a.id,name:a.function.name,error:c}),d.push({role:"tool",tool_call_id:a.id,content:C({error:c})})}}continue}b({type:"assistant_final",content:u}),c(),a.close();return}b({type:"error",message:"Agent exceeded max steps."}),c(),a.close()}catch(d){b({type:"error",message:d instanceof Error?d.message:"Agent failed"}),c(),a.close()}})()}});return new Response(t,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}})}let I=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/route",pathname:"/api/agent",filename:"route",bundlePath:"app/api/agent/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/agent/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:J,workUnitAsyncStorage:K,serverHooks:L}=I;function M(){return(0,g.patchFetch)({workAsyncStorage:J,workUnitAsyncStorage:K})}async function N(a,b,c){I.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/route";"/index"===d&&(d="/");let e=await I.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:F}=e,G=(0,k.normalizeAppPath)(d),H=!!(z.dynamicRoutes[G]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(H&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[G];if(b&&!1===b.fallback&&!a){if(w.experimental.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!H||I.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===I.isDev||!H,M=H&&!L;F&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:F});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q={params:v,prerenderManifest:z,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>I.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},R=new l.NodeNextRequest(a),S=new l.NodeNextResponse(b),T=m.NextRequestAdapter.fromNodeNextRequest(R,(0,m.signalFromNodeResponse)(b));try{let e=async a=>I.handle(T,Q).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route");if(e){let b=`${N} ${e}`;a.setAttributes({"next.route":e,"http.route":e,"next.span_name":b}),a.updateName(b)}else a.updateName(`${N} ${d}`)}),g=!!(0,h.getRequestMeta)(a,"minimalMode"),j=async h=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!g&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await e(h);a.fetchMetrics=Q.renderOpts.fetchMetrics;let i=Q.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=Q.renderOpts.collectedTags;if(!H)return await (0,p.I)(R,S,d,Q.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);j&&(b[s.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==Q.renderOpts.collectedRevalidate&&!(Q.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&Q.renderOpts.collectedRevalidate,e=void 0===Q.renderOpts.collectedExpire||Q.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:Q.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await I.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},l=await I.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil,isMinimalMode:g});if(!H)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});g||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,q.fromNodeOutgoingHttpHeaders)(l.value.headers);return g&&H||m.delete(s.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,r.getCacheControlHeader)(l.cacheControl)),await (0,p.I)(R,S,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};P?await j(P):await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},j))}catch(b){if(b instanceof t.NoFallbackError||await I.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),H)throw b;return await (0,p.I)(R,S,new Response(null,{status:500})),null}}},846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1421:a=>{a.exports=require("node:child_process")},3033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4619:(a,b,c)=>{function d(a,b,c){return Number.isFinite(a)?Math.min(c,Math.max(b,Math.round(a))):b}function e(a){return"string"==typeof a?a:""}function f(a){let b=e(a).trim();if(!b)return"";try{let a=new URL(b);if("http:"!==a.protocol&&"https:"!==a.protocol)return"";return a.toString()}catch{return""}}function g(a){return a.map((a,b)=>({id:b+1,title:a.title,url:a.url,snippet:a.snippet}))}async function h(a){let b=a.query.trim(),c=d(a.maxResults,1,20),h="advanced"===a.searchDepth?"advanced":"basic",i=await fetch("https://api.tavily.com/search",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({query:b,search_depth:h,max_results:c,include_answer:!1,include_images:!1})});if(!i.ok){let a=await i.text().catch(()=>"");throw Error(`Tavily error (${i.status}): ${a||i.statusText}`)}let j=await i.json().catch(()=>null),k=g((Array.isArray(j?.results)?j.results:[]).map(a=>({title:e(a.title).trim(),url:f(a.url),snippet:e(a.content).trim()})).filter(a=>a.title&&a.url));return{provider:"tavily",query:b,results:k,sources:k.map(a=>({id:a.id,title:a.title,url:a.url}))}}async function i(a){let b=a.query.trim(),c=d(a.maxResults,1,20),h=await fetch("https://api.exa.ai/search",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":a.apiKey},body:JSON.stringify({query:b,numResults:c,contents:{text:!1,highlights:{numSentences:3,query:b}}})});if(!h.ok){let a=await h.text().catch(()=>"");throw Error(`Exa error (${h.status}): ${a||h.statusText}`)}let i=await h.json().catch(()=>null),j=g((Array.isArray(i?.results)?i.results:[]).map(a=>{let b=a.highlights,c=Array.isArray(b)?b.filter(a=>"string"==typeof a).join("\n"):e(b),d=e(a.text),g=(c||d).trim();return{title:e(a.title).trim(),url:f(a.url),snippet:g}}).filter(a=>a.title&&a.url));return{provider:"exa",query:b,results:j,sources:j.map(a=>({id:a.id,title:a.title,url:a.url}))}}async function j(a){if(!a.apiKey.trim())throw Error("Missing search API key.");if(!a.query.trim())throw Error("Missing search query.");return"exa"===a.provider?i(a):h(a)}c.d(b,{t:()=>j})},4870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},9294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[445,813,913],()=>b(b.s=535));module.exports=c})();
5
+ `));(async()=>{let d=i.slice(),e=r.length>0;try{for(let i=0;i<8;i+=1){b({type:"debug",message:`agent_step:${i+1}`});let o="",s=await E({apiKey:f,baseUrl:g,headers:m,timeoutMs:l,model:h,temperature:j,maxTokens:k,messages:d,tools:r,stream:n,onDelta:a=>{o+=a,b({type:"assistant_delta",delta:a})}}),t=s.toolCalls??[],u=s.content??o;if(e&&t.length>0){for(let a of(d.push({role:"assistant",content:u||null,tool_calls:t}),t)){let c=function(a){let b=a.trim();if(!b)return{};try{return JSON.parse(b)}catch{return{_raw:a}}}(a.function.arguments);b({type:"tool_call",call:{id:a.id,name:a.function.name,arguments:c}});try{let e=await H({name:a.function.name,args:c,toolSettings:p,enabledMcpServerIds:q});b({type:"tool_result",callId:a.id,name:a.function.name,result:e}),d.push({role:"tool",tool_call_id:a.id,content:D(e)})}catch(e){let c=e instanceof Error?e.message:"Tool failed";b({type:"tool_error",callId:a.id,name:a.function.name,error:c}),d.push({role:"tool",tool_call_id:a.id,content:D({error:c})})}}continue}b({type:"assistant_final",content:u}),c(),a.close();return}b({type:"error",message:"Agent exceeded max steps."}),c(),a.close()}catch(d){b({type:"error",message:d instanceof Error?d.message:"Agent failed"}),c(),a.close()}})()}});return new Response(t,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}})}let J=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent/route",pathname:"/api/agent",filename:"route",bundlePath:"app/api/agent/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/agent/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:K,workUnitAsyncStorage:L,serverHooks:M}=J;function N(){return(0,g.patchFetch)({workAsyncStorage:K,workUnitAsyncStorage:L})}async function O(a,b,c){J.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent/route";"/index"===d&&(d="/");let e=await J.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:F}=e,G=(0,k.normalizeAppPath)(d),H=!!(z.dynamicRoutes[G]||z.routes[D]),I=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(H&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[G];if(b&&!1===b.fallback&&!a){if(w.experimental.adapterPath)return await I();throw new t.NoFallbackError}}let K=null;!H||J.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===J.isDev||!H,M=H&&!L;F&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:F});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q={params:v,prerenderManifest:z,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>J.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},R=new l.NodeNextRequest(a),S=new l.NodeNextResponse(b),T=m.NextRequestAdapter.fromNodeNextRequest(R,(0,m.signalFromNodeResponse)(b));try{let e=async a=>J.handle(T,Q).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route");if(e){let b=`${N} ${e}`;a.setAttributes({"next.route":e,"http.route":e,"next.span_name":b}),a.updateName(b)}else a.updateName(`${N} ${d}`)}),g=!!(0,h.getRequestMeta)(a,"minimalMode"),j=async h=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!g&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await e(h);a.fetchMetrics=Q.renderOpts.fetchMetrics;let i=Q.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=Q.renderOpts.collectedTags;if(!H)return await (0,p.I)(R,S,d,Q.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);j&&(b[s.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==Q.renderOpts.collectedRevalidate&&!(Q.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&Q.renderOpts.collectedRevalidate,e=void 0===Q.renderOpts.collectedExpire||Q.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:Q.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await J.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},l=await J.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil,isMinimalMode:g});if(!H)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});g||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,q.fromNodeOutgoingHttpHeaders)(l.value.headers);return g&&H||m.delete(s.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,r.getCacheControlHeader)(l.cacheControl)),await (0,p.I)(R,S,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};P?await j(P):await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},j))}catch(b){if(b instanceof t.NoFallbackError||await J.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),H)throw b;return await (0,p.I)(R,S,new Response(null,{status:500})),null}}},846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1421:a=>{a.exports=require("node:child_process")},3033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4619:(a,b,c)=>{function d(a,b,c){return Number.isFinite(a)?Math.min(c,Math.max(b,Math.round(a))):b}function e(a){return"string"==typeof a?a:""}function f(a){let b=e(a).trim();if(!b)return"";try{let a=new URL(b);if("http:"!==a.protocol&&"https:"!==a.protocol)return"";return a.toString()}catch{return""}}function g(a){return a.map((a,b)=>({id:b+1,title:a.title,url:a.url,snippet:a.snippet}))}async function h(a){let b=a.query.trim(),c=d(a.maxResults,1,20),h="advanced"===a.searchDepth?"advanced":"basic",i=await fetch("https://api.tavily.com/search",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({query:b,search_depth:h,max_results:c,include_answer:!1,include_images:!1})});if(!i.ok){let a=await i.text().catch(()=>"");throw Error(`Tavily error (${i.status}): ${a||i.statusText}`)}let j=await i.json().catch(()=>null),k=g((Array.isArray(j?.results)?j.results:[]).map(a=>({title:e(a.title).trim(),url:f(a.url),snippet:e(a.content).trim()})).filter(a=>a.title&&a.url));return{provider:"tavily",query:b,results:k,sources:k.map(a=>({id:a.id,title:a.title,url:a.url}))}}async function i(a){let b=a.query.trim(),c=d(a.maxResults,1,20),h=await fetch("https://api.exa.ai/search",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":a.apiKey},body:JSON.stringify({query:b,numResults:c,contents:{text:!1,highlights:{numSentences:3,query:b}}})});if(!h.ok){let a=await h.text().catch(()=>"");throw Error(`Exa error (${h.status}): ${a||h.statusText}`)}let i=await h.json().catch(()=>null),j=g((Array.isArray(i?.results)?i.results:[]).map(a=>{let b=a.highlights,c=Array.isArray(b)?b.filter(a=>"string"==typeof a).join("\n"):e(b),d=e(a.text),g=(c||d).trim();return{title:e(a.title).trim(),url:f(a.url),snippet:g}}).filter(a=>a.title&&a.url));return{provider:"exa",query:b,results:j,sources:j.map(a=>({id:a.id,title:a.title,url:a.url}))}}async function j(a){if(!a.apiKey.trim())throw Error("Missing search API key.");if(!a.query.trim())throw Error("Missing search query.");return"exa"===a.provider?i(a):h(a)}c.d(b,{t:()=>j})},4870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},9294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[445,813,913],()=>b(b.s=535));module.exports=c})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/agent/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"92":{"*":{"id":"100","name":"*","chunks":[],"async":false}},"484":{"*":{"id":"664","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"440","name":"*","chunks":[],"async":false}},"4151":{"*":{"id":"5723","name":"*","chunks":[],"async":false}},"4333":{"*":{"id":"1479","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"1335","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"2265","name":"*","chunks":[],"async":false}},"5499":{"*":{"id":"9827","name":"*","chunks":[],"async":false}},"6531":{"*":{"id":"813","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"4661","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"5421","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"1921","name":"*","chunks":[],"async":false}},"7977":{"*":{"id":"1569","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"4342","name":"*","chunks":[],"async":false}},"9362":{"*":{"id":"5032","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/globals.css":{"id":1743,"name":"*","chunks":["394","static/chunks/394-dc41566095beafcf.js","177","static/chunks/app/layout-7950581b06dcfcd2.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/layout/ClientGlobals.tsx":{"id":4151,"name":"*","chunks":["394","static/chunks/394-dc41566095beafcf.js","177","static/chunks/app/layout-7950581b06dcfcd2.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/layout/MainLayout.tsx":{"id":5499,"name":"*","chunks":["702","static/chunks/c37d3baf-7063ae69d30af537.js","307","static/chunks/307-62db1aea3e7e7f58.js","308","static/chunks/308-9aca2a7bf1797568.js","394","static/chunks/394-dc41566095beafcf.js","787","static/chunks/787-12058ee9986bdbfc.js","974","static/chunks/app/page-c273f2f3b7ce1609.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ModelSelector.tsx":{"id":92,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ProviderConfig.tsx":{"id":9362,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ProviderList.tsx":{"id":6531,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/SettingsPage.tsx":{"id":4333,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/SettingsSidebar.tsx":{"id":7977,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/yxp/Documents/new-chat/ai-chat-client/src/":[],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/layout":[{"inlined":false,"path":"static/css/100bba9d1b2ebade.css"}],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/page":[{"inlined":false,"path":"static/css/886f7af331f6427c.css"}],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/agent/route":[]},"rscModuleMapping":{"92":{"*":{"id":"3154","name":"*","chunks":[],"async":false}},"484":{"*":{"id":"8562","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"5098","name":"*","chunks":[],"async":false}},"1743":{"*":{"id":"1135","name":"*","chunks":[],"async":false}},"4151":{"*":{"id":"768","name":"*","chunks":[],"async":false}},"4333":{"*":{"id":"1190","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"6237","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"3859","name":"*","chunks":[],"async":false}},"5499":{"*":{"id":"3114","name":"*","chunks":[],"async":false}},"6531":{"*":{"id":"7287","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"6675","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"8099","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"5547","name":"*","chunks":[],"async":false}},"7977":{"*":{"id":"2479","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"7644","name":"*","chunks":[],"async":false}},"9362":{"*":{"id":"6325","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/agent/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"92":{"*":{"id":"100","name":"*","chunks":[],"async":false}},"484":{"*":{"id":"664","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"8059","name":"*","chunks":[],"async":false}},"4151":{"*":{"id":"5723","name":"*","chunks":[],"async":false}},"4333":{"*":{"id":"1479","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"1335","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"2265","name":"*","chunks":[],"async":false}},"6531":{"*":{"id":"813","name":"*","chunks":[],"async":false}},"6794":{"*":{"id":"7578","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"4661","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"5421","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"1921","name":"*","chunks":[],"async":false}},"7977":{"*":{"id":"1569","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"4342","name":"*","chunks":[],"async":false}},"9362":{"*":{"id":"5032","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/globals.css":{"id":1743,"name":"*","chunks":["618","static/chunks/618-fe65295d23f513e9.js","177","static/chunks/app/layout-a6642f336c41f8a8.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/layout/ClientGlobals.tsx":{"id":4151,"name":"*","chunks":["618","static/chunks/618-fe65295d23f513e9.js","177","static/chunks/app/layout-a6642f336c41f8a8.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/layout/MainLayout.tsx":{"id":6794,"name":"*","chunks":["702","static/chunks/c37d3baf-7063ae69d30af537.js","307","static/chunks/307-62db1aea3e7e7f58.js","991","static/chunks/991-3901e4f7973e3bc4.js","618","static/chunks/618-fe65295d23f513e9.js","379","static/chunks/379-4a9ebb3f3e23a072.js","974","static/chunks/app/page-86696f7cf6c50ff2.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ModelSelector.tsx":{"id":92,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ProviderConfig.tsx":{"id":9362,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ProviderList.tsx":{"id":6531,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/SettingsPage.tsx":{"id":4333,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/SettingsSidebar.tsx":{"id":7977,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/yxp/Documents/new-chat/ai-chat-client/src/":[],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/layout":[{"inlined":false,"path":"static/css/06344f8f74fa92db.css"}],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/page":[{"inlined":false,"path":"static/css/886f7af331f6427c.css"}],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/agent/route":[]},"rscModuleMapping":{"92":{"*":{"id":"3154","name":"*","chunks":[],"async":false}},"484":{"*":{"id":"8562","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"5098","name":"*","chunks":[],"async":false}},"1743":{"*":{"id":"1135","name":"*","chunks":[],"async":false}},"4151":{"*":{"id":"768","name":"*","chunks":[],"async":false}},"4333":{"*":{"id":"1190","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"6237","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"3859","name":"*","chunks":[],"async":false}},"6531":{"*":{"id":"7287","name":"*","chunks":[],"async":false}},"6794":{"*":{"id":"3114","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"6675","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"8099","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"5547","name":"*","chunks":[],"async":false}},"7977":{"*":{"id":"2479","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"7644","name":"*","chunks":[],"async":false}},"9362":{"*":{"id":"6325","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
@@ -0,0 +1,5 @@
1
+ (()=>{var a={};a.id=348,a.ids=[348],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4066:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{POST:()=>B,runtime:()=>w});var e=c(9225),f=c(4006),g=c(8317),h=c(9373),i=c(4775),j=c(4235),k=c(261),l=c(4365),m=c(771),n=c(3461),o=c(7798),p=c(2280),q=c(2018),r=c(5696),s=c(7929),t=c(6439),u=c(7527),v=c(5592);let w="nodejs";function x(a){return"object"==typeof a&&null!==a}function y(a){return"string"==typeof a?a:""}function z(a){return!!x(a)&&("text"===a.type?"string"==typeof a.text:"image_url"===a.type&&!!x(a.image_url)&&"string"==typeof a.image_url.url&&a.image_url.url.length>0)}async function A(a){let b,c=(b=a.baseUrl.trim().replace(/\/+$/,""))?b.endsWith("/chat/completions")?b:`${b}/chat/completions`:"https://api.openai.com/v1/chat/completions",d=new AbortController,e=setTimeout(()=>d.abort(),a.timeoutMs),f={...a.headers,"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},g={model:a.model,messages:a.messages,temperature:a.temperature,max_tokens:a.maxTokens,tools:a.tools.length?a.tools:void 0,tool_choice:a.tools.length?"auto":void 0,stream:a.stream};try{let b=await fetch(c,{method:"POST",headers:f,body:JSON.stringify(g),signal:d.signal});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(`LLM error (${b.status}): ${a||b.statusText}`)}if(!a.stream){let a=await b.json().catch(()=>null),c=a?.choices?.[0]?.message,d=c?.content??"",e=Array.isArray(c?.tool_calls)?c.tool_calls:[];return{content:d,toolCalls:e}}if(!b.body)throw Error("LLM returned empty stream.");let e=b.body.getReader(),h=new TextDecoder("utf-8"),i="",j="",k=new Map,l=!1;for(;;){let{value:b,done:c}=await e.read();if(c)break;let d=(i+=h.decode(b,{stream:!0})).split(/\r?\n\r?\n/);for(let b of(i=d.pop()??"",d)){for(let c of b.split(/\r?\n/)){if(!c.startsWith("data:"))continue;let b=c.replace(/^data:\s*/,"").trim();if(b){if("[DONE]"===b){l=!0;break}try{let c=JSON.parse(b),d=c.choices?.[0]?.delta,e=d?.content??"";for(let b of(e&&(j+=e,a.onDelta?.(e)),d?.tool_calls??[])){let a="number"==typeof b.index?b.index:0,c=k.get(a)??{id:"",name:"",args:""},d={id:b.id??c.id,name:b.function?.name??c.name,args:`${c.args}${b.function?.arguments??""}`};k.set(a,d)}}catch{}}}if(l)break}if(l)break}let m=Array.from(k.entries()).sort(([a],[b])=>a-b).map(([,a])=>({id:a.id,type:"function",function:{name:a.name,arguments:a.args}})).filter(a=>a.id&&a.function.name);return{content:j,toolCalls:m}}finally{clearTimeout(e)}}async function B(a){var b;let c,d,e=await a.json().catch(()=>null);if(!x(e))return v.NextResponse.json({error:"Invalid JSON body."},{status:400});let f=y(e.apiKey).trim(),g=function(a){let b=y(a).trim();if(!b)return null;try{let a=new URL(b);if("http:"!==a.protocol&&"https:"!==a.protocol)return null;return a.toString()}catch{return null}}(e.baseUrl)??y(e.baseUrl).trim(),h=y(e.model).trim(),i=function(a){if(!Array.isArray(a))return null;let b=[];for(let c of a){if(!x(c))return null;let a=y(c.role);if("system"===a){if("string"!=typeof c.content)return null;b.push({role:"system",content:c.content});continue}if("assistant"===a){let a=null==c.content?null:"string"==typeof c.content?c.content:null,d=Array.isArray(c.tool_calls)?c.tool_calls.filter(a=>x(a)):void 0;b.push({role:"assistant",content:a,...d?{tool_calls:d}:{}});continue}if("user"===a){if("string"==typeof c.content||Array.isArray(c.content)&&c.content.every(z)){b.push({role:"user",content:c.content});continue}return null}if("tool"===a){let a=y(c.tool_call_id).trim(),d=y(c.content);if(!a)return null;b.push({role:"tool",tool_call_id:a,content:d});continue}return null}return b}(e.messages);if(!f||!g||!h||!i)return v.NextResponse.json({error:"Missing required fields (apiKey/baseUrl/model/messages)."},{status:400});let j="number"==typeof e.temperature?e.temperature:.7,k="number"==typeof e.maxTokens?e.maxTokens:2e3,l="number"==typeof e.timeout?e.timeout:3e4,m=function(a){if(!x(a))return{};let b={};for(let[c,d]of Object.entries(a))"string"==typeof d&&d.trim()&&(b[c]=d);return b}(e.headers),n="boolean"!=typeof e.stream||e.stream,o="boolean"==typeof e.enableMemoryTool&&e.enableMemoryTool,p=function(a){if(!Array.isArray(a))return[];let b=[],c=new Set;for(let d of a){if("string"!=typeof d)continue;let a=d.trim();if(!a)continue;let e="web_search"===a||"python"===a||"mcp"===a?a:a.startsWith("mcp:")&&a.slice(4).trim()?`mcp:${a.slice(4).trim()}`:null;e&&(c.has(e)||(c.add(e),b.push(e)))}return b.includes("mcp")?b.filter(a=>"web_search"===a||"python"===a||"mcp"===a):b}(e.toolUses),q=function(a){if(!x(a))return null;let b=x(a.search)?a.search:{},c=x(a.python)?a.python:{},d=x(a.mcp)?a.mcp:{},e=(x(d)&&Array.isArray(d.servers)?d.servers:[]).map(a=>{if(!x(a))return null;let b=y(a.id),c=y(a.name),d="stdio"===a.transport||"sse"===a.transport?a.transport:"http",e=y(a.token),f=y(a.configJson),g="number"==typeof a.createdAt?a.createdAt:Date.now(),h="number"==typeof a.updatedAt?a.updatedAt:Date.now();return b.trim()&&c.trim()?{id:b,name:c,transport:d,token:e,configJson:f,createdAt:g,updatedAt:h}:null}).filter(a=>!!a);return{search:{provider:"exa"===b.provider?"exa":"tavily",exaApiKey:y(b.exaApiKey),tavilyApiKey:y(b.tavilyApiKey),maxResults:"number"==typeof b.maxResults?b.maxResults:5,searchDepth:"advanced"===b.searchDepth?"advanced":"basic"},mcp:{servers:e},python:{timeoutMs:"number"==typeof c.timeoutMs?c.timeoutMs:15e3,maxOutputChars:"number"==typeof c.maxOutputChars?c.maxOutputChars:2e4,pythonCommand:y(c.pythonCommand)||"python3"}}}(e.toolSettings);if(!q)return v.NextResponse.json({error:"Invalid toolSettings."},{status:400});let r=(c=new Set((b={toolUses:p,toolSettings:q,enableMemoryTool:o}).toolUses),d=[],b.enableMemoryTool&&d.push({type:"function",function:{name:"search_memory",description:"Search the user's long-term memory bank and return relevant memories.",parameters:{type:"object",properties:{query:{type:"string",description:"Search query."},topK:{type:"number",minimum:1,maximum:20},scope:{type:"string",enum:["user","folder","both"]},tagsAny:{type:"array",items:{type:"string"}},folderId:{type:"string",description:"Optional folder id when scope includes folder."}},required:["query"],additionalProperties:!0}}}),c.has("web_search")&&d.push({type:"function",function:{name:"web_search",description:"Search the web for up-to-date information and sources.",parameters:{type:"object",properties:{query:{type:"string",description:"Search query."},provider:{type:"string",enum:["tavily","exa"]},maxResults:{type:"number",minimum:1,maximum:20},searchDepth:{type:"string",enum:["basic","advanced"]}},required:["query"],additionalProperties:!0}}}),c.has("python")&&d.push({type:"function",function:{name:"exec_python",description:"Execute Python code and return stdout/stderr/result metadata.",parameters:{type:"object",properties:{code:{type:"string",description:"Python code to execute."}},required:["code"],additionalProperties:!1}}}),(()=>{let a=b.toolSettings.mcp.servers.slice();if(c.has("mcp"))return a;let d=new Map(a.map(a=>[a.id,a])),e=b.toolUses.filter(a=>a.startsWith("mcp:")).map(a=>a.slice(4).trim()).filter(Boolean),f=new Set,g=[];for(let a of e){if(f.has(a))continue;f.add(a);let b=d.get(a);b&&g.push(b)}return g})().length>0&&(d.push({type:"function",function:{name:"mcp_list_tools",description:"List tools for an enabled MCP server.",parameters:{type:"object",properties:{serverId:{type:"string",description:"MCP server id."}},required:["serverId"],additionalProperties:!1}}}),d.push({type:"function",function:{name:"mcp_call",description:"Call a tool on an enabled MCP server.",parameters:{type:"object",properties:{serverId:{type:"string",description:"MCP server id."},name:{type:"string",description:"Tool name."},arguments:{description:"Tool arguments."}},required:["serverId","name"],additionalProperties:!0}}})),d),s=new TextEncoder,t=new ReadableStream({start(a){let b=b=>{a.enqueue(s.encode(`data: ${function(a){try{return JSON.stringify(a)}catch{return JSON.stringify({error:"Unserializable payload."})}}(b)}
2
+
3
+ `))},c=()=>a.enqueue(new TextEncoder().encode(`data: [DONE]
4
+
5
+ `));(async()=>{try{let d="",e=await A({apiKey:f,baseUrl:g,headers:m,timeoutMs:l,model:h,temperature:j,maxTokens:k,messages:i,tools:r,stream:n,onDelta:a=>{d+=a,b({type:"assistant_delta",delta:a})}}),o=e.toolCalls??[],p=e.content??d;for(let a of(b({type:"assistant_final",content:p}),o))b({type:"tool_call",call:{id:a.id,name:a.function.name,arguments:function(a){let b=a.trim();if(!b)return{};try{return JSON.parse(b)}catch{return{_raw:a}}}(a.function.arguments)}});c(),a.close()}catch(d){b({type:"error",message:d instanceof Error?d.message:"Agent step failed"}),c(),a.close()}})()}});return new Response(t,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}})}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/agent-step/route",pathname:"/api/agent-step",filename:"route",bundlePath:"app/api/agent-step/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/agent-step/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/agent-step/route";"/index"===d&&(d="/");let e=await C.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.experimental.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||C.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===C.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q={params:v,prerenderManifest:z,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},R=new l.NodeNextRequest(a),S=new l.NodeNextResponse(b),T=m.NextRequestAdapter.fromNodeNextRequest(R,(0,m.signalFromNodeResponse)(b));try{let e=async a=>C.handle(T,Q).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route");if(e){let b=`${N} ${e}`;a.setAttributes({"next.route":e,"http.route":e,"next.span_name":b}),a.updateName(b)}else a.updateName(`${N} ${d}`)}),g=!!(0,h.getRequestMeta)(a,"minimalMode"),j=async h=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!g&&B&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await e(h);a.fetchMetrics=Q.renderOpts.fetchMetrics;let i=Q.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=Q.renderOpts.collectedTags;if(!I)return await (0,p.I)(R,S,d,Q.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);j&&(b[s.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==Q.renderOpts.collectedRevalidate&&!(Q.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&Q.renderOpts.collectedRevalidate,e=void 0===Q.renderOpts.collectedExpire||Q.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:Q.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},l=await C.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:D,responseGenerator:k,waitUntil:c.waitUntil,isMinimalMode:g});if(!I)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});g||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,q.fromNodeOutgoingHttpHeaders)(l.value.headers);return g&&I||m.delete(s.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,r.getCacheControlHeader)(l.cacheControl)),await (0,p.I)(R,S,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};P?await j(P):await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},j))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(R,S,new Response(null,{status:500})),null}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},8335:()=>{},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[445,813],()=>b(b.s=4066));module.exports=c})();
@@ -0,0 +1 @@
1
+ {"version":1,"files":["../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../node_modules/next/dist/lib/constants.js","../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../node_modules/next/dist/lib/is-error.js","../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/445.js","../../../chunks/813.js","../../../webpack-runtime.js","route_client-reference-manifest.js"]}
@@ -0,0 +1 @@
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/agent-step/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"92":{"*":{"id":"100","name":"*","chunks":[],"async":false}},"484":{"*":{"id":"664","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"8059","name":"*","chunks":[],"async":false}},"4151":{"*":{"id":"5723","name":"*","chunks":[],"async":false}},"4333":{"*":{"id":"1479","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"1335","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"2265","name":"*","chunks":[],"async":false}},"6531":{"*":{"id":"813","name":"*","chunks":[],"async":false}},"6794":{"*":{"id":"7578","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"4661","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"5421","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"1921","name":"*","chunks":[],"async":false}},"7977":{"*":{"id":"1569","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"4342","name":"*","chunks":[],"async":false}},"9362":{"*":{"id":"5032","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/globals.css":{"id":1743,"name":"*","chunks":["618","static/chunks/618-fe65295d23f513e9.js","177","static/chunks/app/layout-a6642f336c41f8a8.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/layout/ClientGlobals.tsx":{"id":4151,"name":"*","chunks":["618","static/chunks/618-fe65295d23f513e9.js","177","static/chunks/app/layout-a6642f336c41f8a8.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/layout/MainLayout.tsx":{"id":6794,"name":"*","chunks":["702","static/chunks/c37d3baf-7063ae69d30af537.js","307","static/chunks/307-62db1aea3e7e7f58.js","991","static/chunks/991-3901e4f7973e3bc4.js","618","static/chunks/618-fe65295d23f513e9.js","379","static/chunks/379-4a9ebb3f3e23a072.js","974","static/chunks/app/page-86696f7cf6c50ff2.js"],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ModelSelector.tsx":{"id":92,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ProviderConfig.tsx":{"id":9362,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/ProviderList.tsx":{"id":6531,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/SettingsPage.tsx":{"id":4333,"name":"*","chunks":[],"async":false},"/Users/yxp/Documents/new-chat/ai-chat-client/src/components/settings/SettingsSidebar.tsx":{"id":7977,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/yxp/Documents/new-chat/ai-chat-client/src/":[],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/layout":[{"inlined":false,"path":"static/css/06344f8f74fa92db.css"}],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/page":[{"inlined":false,"path":"static/css/886f7af331f6427c.css"}],"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/agent-step/route":[]},"rscModuleMapping":{"92":{"*":{"id":"3154","name":"*","chunks":[],"async":false}},"484":{"*":{"id":"8562","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"5098","name":"*","chunks":[],"async":false}},"1743":{"*":{"id":"1135","name":"*","chunks":[],"async":false}},"4151":{"*":{"id":"768","name":"*","chunks":[],"async":false}},"4333":{"*":{"id":"1190","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"6237","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"3859","name":"*","chunks":[],"async":false}},"6531":{"*":{"id":"7287","name":"*","chunks":[],"async":false}},"6794":{"*":{"id":"3114","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"6675","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"8099","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"5547","name":"*","chunks":[],"async":false}},"7977":{"*":{"id":"2479","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"7644","name":"*","chunks":[],"async":false}},"9362":{"*":{"id":"6325","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
@@ -1 +1 @@
1
- (()=>{var a={};a.id=276,a.ids=[276],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},641:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>I,patchFetch:()=>H,routeModule:()=>D,serverHooks:()=>G,workAsyncStorage:()=>E,workUnitAsyncStorage:()=>F});var d={};c.r(d),c.d(d,{POST:()=>C});var e=c(9225),f=c(4006),g=c(8317),h=c(9373),i=c(4775),j=c(4235),k=c(261),l=c(4365),m=c(771),n=c(3461),o=c(7798),p=c(2280),q=c(2018),r=c(5696),s=c(7929),t=c(6439),u=c(7527),v=c(5592),w=c(6798);function x(a){let b=a.trim().replace(/\/+$/,"");return b?b.endsWith("/chat/completions")?b:`${b}/chat/completions`:`${w.rd}/chat/completions`}async function y(a){let b=await fetch(x(a.baseUrl??w.rd),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:a.model??"gpt-4o-mini",messages:a.messages,temperature:a.temperature??.7,max_tokens:a.maxTokens,response_format:a.responseFormat,stream:a.stream??!1})});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(`OpenAI API error (${b.status} ${b.statusText}): ${a}`)}let c=await b.json(),d=c.choices?.[0]?.message?.content??"";if(!d)throw Error("OpenAI returned empty content.");return d}async function z(a){let b=await fetch(x(a.baseUrl??w.rd),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:a.model??"gpt-4o-mini",messages:a.messages,temperature:a.temperature??.7,max_tokens:a.maxTokens,response_format:a.responseFormat,stream:!0})});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(`OpenAI API error (${b.status} ${b.statusText}): ${a}`)}if(!b.body)throw Error("OpenAI API returned empty stream.");return b}function A(a){var b;return"object"==typeof a&&null!==a&&("system"===(b=a.role)||"user"===b||"assistant"===b)&&"string"==typeof a.content}function B(a){if("string"!=typeof a)return null;let b=(0,w.GG)(a);if(!b)return null;try{let a=new URL(b);if("http:"!==a.protocol&&"https:"!==a.protocol)return null}catch{return null}return b}async function C(a){try{let b=await a.json();if("object"!=typeof b||null===b)return v.NextResponse.json({error:"Invalid JSON body."},{status:400});let c="string"==typeof b.apiKey&&b.apiKey.trim()?b.apiKey.trim():process.env.OPENAI_API_KEY;if(!c)return v.NextResponse.json({error:"Missing OpenAI API key."},{status:400});let d=B(b.baseUrl)??B(process.env.OPENAI_BASE_URL)??w.rd;if(!Array.isArray(b.messages)||!b.messages.every(A))return v.NextResponse.json({error:"Invalid messages payload."},{status:400});if("boolean"==typeof b.stream&&b.stream){let a=await z({apiKey:c,baseUrl:d,messages:b.messages,model:"string"==typeof b.model?b.model:void 0,temperature:"number"==typeof b.temperature?b.temperature:void 0,maxTokens:"number"==typeof b.maxTokens?b.maxTokens:void 0,responseFormat:b.responseFormat});return new Response(a.body,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}})}let e=await y({apiKey:c,baseUrl:d,messages:b.messages,model:"string"==typeof b.model?b.model:void 0,temperature:"number"==typeof b.temperature?b.temperature:void 0,maxTokens:"number"==typeof b.maxTokens?b.maxTokens:void 0,responseFormat:b.responseFormat});return v.NextResponse.json({content:e})}catch(b){let a=b instanceof Error?b.message:"Unknown error";return v.NextResponse.json({error:a},{status:500})}}let D=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/chat/route",pathname:"/api/chat",filename:"route",bundlePath:"app/api/chat/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/chat/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:E,workUnitAsyncStorage:F,serverHooks:G}=D;function H(){return(0,g.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:F})}async function I(a,b,c){D.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/chat/route";"/index"===d&&(d="/");let e=await D.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.experimental.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||D.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===D.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q={params:v,prerenderManifest:z,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>D.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},R=new l.NodeNextRequest(a),S=new l.NodeNextResponse(b),T=m.NextRequestAdapter.fromNodeNextRequest(R,(0,m.signalFromNodeResponse)(b));try{let e=async a=>D.handle(T,Q).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route");if(e){let b=`${N} ${e}`;a.setAttributes({"next.route":e,"http.route":e,"next.span_name":b}),a.updateName(b)}else a.updateName(`${N} ${d}`)}),g=!!(0,h.getRequestMeta)(a,"minimalMode"),j=async h=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!g&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await e(h);a.fetchMetrics=Q.renderOpts.fetchMetrics;let i=Q.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=Q.renderOpts.collectedTags;if(!I)return await (0,p.I)(R,S,d,Q.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);j&&(b[s.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==Q.renderOpts.collectedRevalidate&&!(Q.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&Q.renderOpts.collectedRevalidate,e=void 0===Q.renderOpts.collectedExpire||Q.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:Q.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await D.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},l=await D.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil,isMinimalMode:g});if(!I)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});g||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,q.fromNodeOutgoingHttpHeaders)(l.value.headers);return g&&I||m.delete(s.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,r.getCacheControlHeader)(l.cacheControl)),await (0,p.I)(R,S,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};P?await j(P):await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},j))}catch(b){if(b instanceof t.NoFallbackError||await D.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(R,S,new Response(null,{status:500})),null}}},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6798:(a,b,c)=>{"use strict";c.d(b,{GG:()=>e,rd:()=>d});let d="https://api.openai.com/v1";function e(a){return a.trim().replace(/\/+$/,"")}},8335:()=>{},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[445,813],()=>b(b.s=641));module.exports=c})();
1
+ (()=>{var a={};a.id=276,a.ids=[276],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},641:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>J,patchFetch:()=>I,routeModule:()=>E,serverHooks:()=>H,workAsyncStorage:()=>F,workUnitAsyncStorage:()=>G});var d={};c.r(d),c.d(d,{POST:()=>D});var e=c(9225),f=c(4006),g=c(8317),h=c(9373),i=c(4775),j=c(4235),k=c(261),l=c(4365),m=c(771),n=c(3461),o=c(7798),p=c(2280),q=c(2018),r=c(5696),s=c(7929),t=c(6439),u=c(7527),v=c(5592),w=c(6798);function x(a){let b=a.trim().replace(/\/+$/,"");return b?b.endsWith("/chat/completions")?b:`${b}/chat/completions`:`${w.rd}/chat/completions`}async function y(a){let b=await fetch(x(a.baseUrl??w.rd),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:a.model??"gpt-4o-mini",messages:a.messages,temperature:a.temperature??.7,max_tokens:a.maxTokens,response_format:a.responseFormat,stream:a.stream??!1})});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(`OpenAI API error (${b.status} ${b.statusText}): ${a}`)}let c=await b.json(),d=c.choices?.[0]?.message?.content??"";if(!d)throw Error("OpenAI returned empty content.");return d}async function z(a){let b=await fetch(x(a.baseUrl??w.rd),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:a.model??"gpt-4o-mini",messages:a.messages,temperature:a.temperature??.7,max_tokens:a.maxTokens,response_format:a.responseFormat,stream:!0})});if(!b.ok){let a=await b.text().catch(()=>"");throw Error(`OpenAI API error (${b.status} ${b.statusText}): ${a}`)}if(!b.body)throw Error("OpenAI API returned empty stream.");return b}function A(a){if("object"!=typeof a||null===a)return!1;if("text"===a.type)return"string"==typeof a.text;if("image_url"===a.type){if("object"!=typeof a.image_url||null===a.image_url)return!1;let b=a.image_url.url;return"string"==typeof b&&b.length>0}return!1}function B(a){var b;return"object"==typeof a&&null!==a&&("system"===(b=a.role)||"user"===b||"assistant"===b)&&!!("string"==typeof a.content||Array.isArray(a.content)&&a.content.every(A))}function C(a){if("string"!=typeof a)return null;let b=(0,w.GG)(a);if(!b)return null;try{let a=new URL(b);if("http:"!==a.protocol&&"https:"!==a.protocol)return null}catch{return null}return b}async function D(a){try{let b=await a.json();if("object"!=typeof b||null===b)return v.NextResponse.json({error:"Invalid JSON body."},{status:400});let c="string"==typeof b.apiKey&&b.apiKey.trim()?b.apiKey.trim():process.env.OPENAI_API_KEY;if(!c)return v.NextResponse.json({error:"Missing OpenAI API key."},{status:400});let d=C(b.baseUrl)??C(process.env.OPENAI_BASE_URL)??w.rd;if(!Array.isArray(b.messages)||!b.messages.every(B))return v.NextResponse.json({error:"Invalid messages payload."},{status:400});if("boolean"==typeof b.stream&&b.stream){let a=await z({apiKey:c,baseUrl:d,messages:b.messages,model:"string"==typeof b.model?b.model:void 0,temperature:"number"==typeof b.temperature?b.temperature:void 0,maxTokens:"number"==typeof b.maxTokens?b.maxTokens:void 0,responseFormat:b.responseFormat});return new Response(a.body,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}})}let e=await y({apiKey:c,baseUrl:d,messages:b.messages,model:"string"==typeof b.model?b.model:void 0,temperature:"number"==typeof b.temperature?b.temperature:void 0,maxTokens:"number"==typeof b.maxTokens?b.maxTokens:void 0,responseFormat:b.responseFormat});return v.NextResponse.json({content:e})}catch(b){let a=b instanceof Error?b.message:"Unknown error";return v.NextResponse.json({error:a},{status:500})}}let E=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/chat/route",pathname:"/api/chat",filename:"route",bundlePath:"app/api/chat/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/yxp/Documents/new-chat/ai-chat-client/src/app/api/chat/route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:F,workUnitAsyncStorage:G,serverHooks:H}=E;function I(){return(0,g.patchFetch)({workAsyncStorage:F,workUnitAsyncStorage:G})}async function J(a,b,c){E.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/chat/route";"/index"===d&&(d="/");let e=await E.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.experimental.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||E.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===E.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q={params:v,prerenderManifest:z,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>E.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},R=new l.NodeNextRequest(a),S=new l.NodeNextResponse(b),T=m.NextRequestAdapter.fromNodeNextRequest(R,(0,m.signalFromNodeResponse)(b));try{let e=async a=>E.handle(T,Q).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route");if(e){let b=`${N} ${e}`;a.setAttributes({"next.route":e,"http.route":e,"next.span_name":b}),a.updateName(b)}else a.updateName(`${N} ${d}`)}),g=!!(0,h.getRequestMeta)(a,"minimalMode"),j=async h=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!g&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await e(h);a.fetchMetrics=Q.renderOpts.fetchMetrics;let i=Q.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=Q.renderOpts.collectedTags;if(!I)return await (0,p.I)(R,S,d,Q.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);j&&(b[s.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==Q.renderOpts.collectedRevalidate&&!(Q.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&Q.renderOpts.collectedRevalidate,e=void 0===Q.renderOpts.collectedExpire||Q.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:Q.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await E.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},l=await E.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil,isMinimalMode:g});if(!I)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});g||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,q.fromNodeOutgoingHttpHeaders)(l.value.headers);return g&&I||m.delete(s.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,r.getCacheControlHeader)(l.cacheControl)),await (0,p.I)(R,S,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};P?await j(P):await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},j))}catch(b){if(b instanceof t.NoFallbackError||await E.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(R,S,new Response(null,{status:500})),null}}},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6798:(a,b,c)=>{"use strict";c.d(b,{GG:()=>e,rd:()=>d});let d="https://api.openai.com/v1";function e(a){return a.trim().replace(/\/+$/,"")}},8335:()=>{},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[445,813],()=>b(b.s=641));module.exports=c})();