@circuitwall/jarela 0.9.3 → 0.10.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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -2
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +72 -5
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js.map +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +136 -26
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.map +1 -1
- package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
- package/.next/standalone/.next/server/app/index.html +2 -2
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page.js +266 -40
- package/.next/standalone/.next/server/app/page.js.map +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup.html +1 -1
- package/.next/standalone/.next/server/app/setup.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/setup.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -2
- package/.next/standalone/.next/server/chunks/210.js +1 -1
- package/.next/standalone/.next/server/chunks/2151.js +60 -2
- package/.next/standalone/.next/server/chunks/2151.js.map +1 -1
- package/.next/standalone/.next/server/chunks/614.js +336 -93
- package/.next/standalone/.next/server/chunks/614.js.map +1 -1
- package/.next/standalone/.next/server/chunks/6765.js +35 -0
- package/.next/standalone/.next/server/chunks/6765.js.map +1 -1
- package/.next/standalone/.next/server/chunks/8697.js +15246 -15002
- package/.next/standalone/.next/server/chunks/8697.js.map +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{3741-344e2bfc5028b9c8.js → 3741-2d64471ff763b8fa.js} +36 -1
- package/.next/standalone/.next/static/chunks/3741-2d64471ff763b8fa.js.map +1 -0
- package/.next/standalone/.next/static/chunks/app/{page-c77ab600642bbfc2.js → page-318743bf47fac345.js} +267 -41
- package/.next/standalone/.next/static/chunks/app/page-318743bf47fac345.js.map +1 -0
- package/.next/standalone/.next/static/css/b6b85b0f13bc0e98.css +5 -0
- package/.next/standalone/.next/static/css/b6b85b0f13bc0e98.css.map +1 -0
- package/.next/standalone/package.json +1 -1
- package/CHANGELOG.md +48 -0
- package/README.md +2 -0
- package/api/client.ts +37 -1
- package/api/types.ts +18 -0
- package/app/api/v1/threads/[thread_id]/run/route.ts +69 -22
- package/components/agents/AgentEditor.tsx +7 -4
- package/components/chat/MessageBubble.tsx +108 -1
- package/components/dashboard/DashboardPanel.tsx +79 -21
- package/hooks/useSSE.ts +22 -9
- package/lib/agents/prepare/system-prompt.ts +30 -0
- package/lib/agents/run-registry.test.ts +94 -0
- package/lib/agents/run-registry.ts +60 -1
- package/lib/stores/dashboard-metrics.test.ts +33 -0
- package/lib/stores/dashboard-metrics.ts +93 -1
- package/lib/tools/exec.ts +9 -5
- package/lib/tools/files.ts +6 -0
- package/lib/tools/safety.test.ts +95 -0
- package/lib/tools/safety.ts +147 -0
- package/package.json +1 -1
- package/.next/standalone/.next/static/chunks/3741-344e2bfc5028b9c8.js.map +0 -1
- package/.next/standalone/.next/static/chunks/app/page-c77ab600642bbfc2.js.map +0 -1
- package/.next/standalone/.next/static/css/53f85613a5500253.css +0 -5
- package/.next/standalone/.next/static/css/53f85613a5500253.css.map +0 -1
- /package/.next/standalone/.next/static/{6uLoytvvEtLKIblEB53e0 → 8qTBpUDFnSMYwe3Zc0bGV}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{6uLoytvvEtLKIblEB53e0 → 8qTBpUDFnSMYwe3Zc0bGV}/_ssgManifest.js +0 -0
|
@@ -4,8 +4,8 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
4
4
|
],
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"lowPriorityFiles": [
|
|
7
|
-
"static/
|
|
8
|
-
"static/
|
|
7
|
+
"static/8qTBpUDFnSMYwe3Zc0bGV/_buildManifest.js",
|
|
8
|
+
"static/8qTBpUDFnSMYwe3Zc0bGV/_ssgManifest.js"
|
|
9
9
|
],
|
|
10
10
|
"rootMainFiles": [
|
|
11
11
|
"static/chunks/webpack-ff5627013a5e3842.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" data-theme="system"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover"/><link rel="stylesheet" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html lang="en" data-theme="system"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover"/><link rel="stylesheet" href="/_next/static/css/b6b85b0f13bc0e98.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-ff5627013a5e3842.js"/><script src="/_next/static/chunks/4bd1b696-f4afdf0ad1d556a5.js" async=""></script><script src="/_next/static/chunks/3457-5218e06617c4db2a.js" async=""></script><script src="/_next/static/chunks/main-app-3f37bcefd1eaffaf.js" async=""></script><script src="/_next/static/chunks/app/layout-84c6f211a7a1ca36.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)"/><meta name="theme-color" content="#09090b" media="(prefers-color-scheme: dark)"/><title>Jarela</title><meta name="description" content="Jarela — local chat interface for LangGraph agents"/><link rel="manifest" href="/manifest.json"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Jarela"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/favicon.ico" sizes="any"/><link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192"/><link rel="icon" href="/icon-512.png" type="image/png" sizes="512x512"/><link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180"/><script>(() => {
|
|
2
2
|
var LIGHT = "#ffffff", DARK = "#09090b";
|
|
3
3
|
function resolve(t) {
|
|
4
4
|
if (t === "light") return LIGHT;
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
} catch (e) {
|
|
28
28
|
document.documentElement.setAttribute("data-theme", "system");
|
|
29
29
|
}
|
|
30
|
-
})();</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";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-ff5627013a5e3842.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n3:I[737,[\"7177\",\"static/chunks/app/layout-84c6f211a7a1ca36.js\"],\"ThemeProvider\"]\n4:I[3639,[\"7177\",\"static/chunks/app/layout-84c6f211a7a1ca36.js\"],\"AppProvider\"]\n5:I[7121,[],\"\"]\n6:I[4581,[],\"\"]\n7:I[722,[\"7177\",\"static/chunks/app/layout-84c6f211a7a1ca36.js\"],\"ServiceWorkerRegistration\"]\n8:I[484,[],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nc:I[484,[],\"ViewportBoundary\"]\ne:I[484,[],\"MetadataBoundary\"]\n10:I[7123,[],\"default\",1]\n:HL[\"/_next/static/css/
|
|
30
|
+
})();</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";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-ff5627013a5e3842.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n3:I[737,[\"7177\",\"static/chunks/app/layout-84c6f211a7a1ca36.js\"],\"ThemeProvider\"]\n4:I[3639,[\"7177\",\"static/chunks/app/layout-84c6f211a7a1ca36.js\"],\"AppProvider\"]\n5:I[7121,[],\"\"]\n6:I[4581,[],\"\"]\n7:I[722,[\"7177\",\"static/chunks/app/layout-84c6f211a7a1ca36.js\"],\"ServiceWorkerRegistration\"]\n8:I[484,[],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nc:I[484,[],\"ViewportBoundary\"]\ne:I[484,[],\"MetadataBoundary\"]\n10:I[7123,[],\"default\",1]\n:HL[\"/_next/static/css/b6b85b0f13bc0e98.css\",\"style\"]\n2:T4b9,(() =\u003e {\n var LIGHT = \"#ffffff\", DARK = \"#09090b\";\n function resolve(t) {\n if (t === \"light\") return LIGHT;\n if (t === \"dark\") return DARK;\n try {\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? DARK : LIGHT;\n } catch (e) { return DARK; }\n }\n try {\n var t = localStorage.getItem(\"jarela-theme\");\n if (t !== \"light\" \u0026\u0026 t !== \"dark\" \u0026\u0026 t !== \"system\") t = \"system\";\n document.documentElement.setAttribute(\"data-theme\", t);\n // Collapse any media-scoped theme-color metas Next emits to a single tag\n // so the PWA window chrome matches the user's explicit choice (not just\n // prefers-color-scheme). ThemeContext keeps this in sync on change.\n var metas = document.querySelectorAll('meta[name=\"theme-color\"]');\n for (var i = 1; i \u003c metas.length; i++) metas[i].parentNode.removeChild(metas[i]);\n var meta = metas[0];\n if (!meta) {\n meta = document.createElement(\"meta\");\n meta.setAttribute(\"name\", \"theme-color\");\n document.head.appendChild(meta);\n }\n meta.removeAttribute(\"media\");\n meta.setAttribute(\"content\", resolve(t));\n } catch (e) {\n document.documentElement.setAttribute(\"data-theme\", \"system\");\n }\n})();"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b6b85b0f13bc0e98.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"data-theme\":\"system\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"$2\"}}]}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L6\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}],[\"$\",\"$L7\",null,{}]]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L5\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L6\",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,[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@a\"}]}]]}],{},null,false,null]},null,false,\"$@b\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Lc\",null,{\"children\":\"$Ld\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Le\",null,{\"children\":[\"$\",\"$9\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"8qTBpUDFnSMYwe3Zc0bGV\"}\n"])</script><script>self.__next_f.push([1,"11:[]\nb:\"$W11\"\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#ffffff\",\"media\":\"(prefers-color-scheme: light)\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"content\":\"#09090b\",\"media\":\"(prefers-color-scheme: dark)\"}]]\n"])</script><script>self.__next_f.push([1,"12:I[6869,[],\"IconMark\"]\na:null\nf:[[\"$\",\"title\",\"0\",{\"children\":\"Jarela\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Jarela — local chat interface for LangGraph agents\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"3\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"4\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Jarela\"}],[\"$\",\"meta\",\"5\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"sizes\":\"any\"}],[\"$\",\"link\",\"7\",{\"rel\":\"icon\",\"href\":\"/icon-192.png\",\"type\":\"image/png\",\"sizes\":\"192x192\"}],[\"$\",\"link\",\"8\",{\"rel\":\"icon\",\"href\":\"/icon-512.png\",\"type\":\"image/png\",\"sizes\":\"512x512\"}],[\"$\",\"link\",\"9\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-touch-icon.png\",\"sizes\":\"180x180\"}],[\"$\",\"$L12\",\"10\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-ff5627013a5e3842.js"/><script src="/_next/static/chunks/4bd1b696-f4afdf0ad1d556a5.js" async=""></script><script src="/_next/static/chunks/3457-5218e06617c4db2a.js" async=""></script><script src="/_next/static/chunks/main-app-3f37bcefd1eaffaf.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-ff5627013a5e3842.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[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[484,[],\"ViewportBoundary\"]\na:I[484,[],\"MetadataBoundary\"]\nc:I[7123,[],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-ff5627013a5e3842.js"/><script src="/_next/static/chunks/4bd1b696-f4afdf0ad1d556a5.js" async=""></script><script src="/_next/static/chunks/3457-5218e06617c4db2a.js" async=""></script><script src="/_next/static/chunks/main-app-3f37bcefd1eaffaf.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-ff5627013a5e3842.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[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[484,[],\"ViewportBoundary\"]\na:I[484,[],\"MetadataBoundary\"]\nc:I[7123,[],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"8qTBpUDFnSMYwe3Zc0bGV\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\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,"6:null\nb:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"LumIuXlmYfK57pd1NKAxXAFfdFQj6OH2VytodS4jbGU="}
|
package/.next/standalone/.next/static/chunks/{3741-344e2bfc5028b9c8.js → 3741-2d64471ff763b8fa.js}
RENAMED
|
@@ -973,11 +973,25 @@ const api = {
|
|
|
973
973
|
// it as a hard error if the *first* connect attempt fails (no successful
|
|
974
974
|
// 'open' ever fired) — anything after that is a recoverable drop and
|
|
975
975
|
// the server's replay buffer will deliver missed chunks on reconnect.
|
|
976
|
+
// EXCEPT when the browser flips readyState to CLOSED — that's the spec's
|
|
977
|
+
// terminal state (e.g. the reconnect attempt got a 404 because the run
|
|
978
|
+
// finished + TTL-evicted), and no further events will ever arrive. If
|
|
979
|
+
// we ignored that case the consumer would hang on the waiter forever
|
|
980
|
+
// and the UI activity label ("Reconnecting…") would never clear.
|
|
976
981
|
let everOpened = false;
|
|
977
982
|
es.onopen = ()=>{
|
|
978
983
|
everOpened = true;
|
|
984
|
+
if (connectTimer !== null) {
|
|
985
|
+
clearTimeout(connectTimer);
|
|
986
|
+
connectTimer = null;
|
|
987
|
+
}
|
|
979
988
|
};
|
|
980
989
|
es.onerror = ()=>{
|
|
990
|
+
if (es.readyState === EventSource.CLOSED) {
|
|
991
|
+
done = true;
|
|
992
|
+
notify();
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
981
995
|
if (!everOpened) {
|
|
982
996
|
streamError = new Error("EventSource failed to open");
|
|
983
997
|
done = true;
|
|
@@ -985,8 +999,28 @@ const api = {
|
|
|
985
999
|
}
|
|
986
1000
|
// else: ignore — EventSource will try to reconnect.
|
|
987
1001
|
};
|
|
1002
|
+
// Connect-timeout safety net: if onopen hasn't fired within 8s the
|
|
1003
|
+
// server is unreachable (DNS, TLS handshake stuck, proxy black-holing
|
|
1004
|
+
// the GET, …). EventSource alone won't surface that — it stays in
|
|
1005
|
+
// CONNECTING forever, retrying silently. Force the iterator to fail so
|
|
1006
|
+
// the caller's catch/finally can release the UI gate.
|
|
1007
|
+
let connectTimer = setTimeout(()=>{
|
|
1008
|
+
connectTimer = null;
|
|
1009
|
+
if (!everOpened && !done) {
|
|
1010
|
+
streamError = new Error("EventSource connect timeout");
|
|
1011
|
+
done = true;
|
|
1012
|
+
try {
|
|
1013
|
+
es.close();
|
|
1014
|
+
} catch {}
|
|
1015
|
+
notify();
|
|
1016
|
+
}
|
|
1017
|
+
}, 8000);
|
|
988
1018
|
const onAbort = ()=>{
|
|
989
1019
|
done = true;
|
|
1020
|
+
if (connectTimer !== null) {
|
|
1021
|
+
clearTimeout(connectTimer);
|
|
1022
|
+
connectTimer = null;
|
|
1023
|
+
}
|
|
990
1024
|
try {
|
|
991
1025
|
es.close();
|
|
992
1026
|
} catch {}
|
|
@@ -1006,6 +1040,7 @@ const api = {
|
|
|
1006
1040
|
}
|
|
1007
1041
|
if (streamError) throw streamError;
|
|
1008
1042
|
} finally{
|
|
1043
|
+
if (connectTimer !== null) clearTimeout(connectTimer);
|
|
1009
1044
|
signal.removeEventListener("abort", onAbort);
|
|
1010
1045
|
try {
|
|
1011
1046
|
es.close();
|
|
@@ -2398,4 +2433,4 @@ function computeFeatureReadiness({ models, integrations, selectedProvider, selec
|
|
|
2398
2433
|
/***/ })
|
|
2399
2434
|
|
|
2400
2435
|
}]);
|
|
2401
|
-
//# sourceMappingURL=3741-
|
|
2436
|
+
//# sourceMappingURL=3741-2d64471ff763b8fa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/chunks/3741-2d64471ff763b8fa.js","mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;CAiBC,GAED,MAAMA,WAAqC;IACzC,iEAAiE;IACjE,mEAAmE;IACnEC,QAAQ;QACN;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IACD,kEAAkE;IAClEC,WAAW;QACT;QACA;QACA;QACA;QACA;KACD;IACD,wEAAwE;IACxE,gEAAgE;IAChEC,QAAQ;QAAC;QAAuB;KAAsB;IACtD,2EAA2E;IAC3E,wEAAwE;IACxE,wCAAwC;IACxC,kBAAkB;QAChB;QACA;QACA;QACA;QACA;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CAAiCG,MAAM3f,QAAQ,MAC5F,CAAC,CAACse,oBAAoBkB,iCAAiClB;IAE5D,OAAO;QACLE;QACAE;QACAgB;QACAE;QACAjB,YAAYD,wBAAwBgB;QACpCd,gBAAgBgB;IAClB;AACF","sources":["webpack://_N_E/./lib/providers/capabilities.ts","webpack://_N_E/./components/ui/MarkdownTextarea.tsx","webpack://_N_E/./api/client.ts","webpack://_N_E/./components/models/CapBadges.tsx","webpack://_N_E/./contexts/AppContext.tsx","webpack://_N_E/./components/setup/OnboardingWizard.tsx","webpack://_N_E/./components/models/ModelFeatureGuide.tsx","webpack://_N_E/./lib/env/app-config.ts","webpack://_N_E/./lib/ui/feature-readiness.ts"],"sourcesContent":["/**\n * Static per-provider classification of which model ids accept image inputs.\n *\n * Used purely to surface UI hints — \"this agent's model can read WhatsApp\n * images\" — so a user can pick a vision-capable model BEFORE pointing a\n * bridge route at an agent. The runtime never enforces this: the bridge\n * always forwards whatever payload it captured, and the provider returns\n * whatever ignore/error behaviour the upstream model chose if it isn't\n * actually multi-modal.\n *\n * Patterns intentionally err on the *generous* side. A false positive just\n * means the user sees no warning for a model that quietly ignores images;\n * a false negative would mean users see a scary warning on a model that\n * actually works fine. We update the patterns as new model families ship.\n *\n * NOTE: this module is intentionally free of server-only imports so the\n * BridgeEditor / AgentEditor UIs can import it directly.\n */\n\nconst PATTERNS: Record<string, RegExp[]> = {\n // OpenAI — every modern flagship is multi-modal; only the legacy\n // gpt-3.5-* / text-davinci-* / o3-mini-text family stay text-only.\n openai: [\n /^gpt-4o/i,\n /^gpt-4\\.1/i,\n /^gpt-4-turbo/i,\n /^gpt-4-vision/i,\n /^gpt-5/i,\n /^chatgpt-4o/i,\n /^o[134](?:-|$)/i, // o1, o3, o4-mini (vision-enabled reasoning models)\n ],\n // Anthropic — Claude 3 onwards is vision-native across all tiers.\n anthropic: [\n /^claude-3/i,\n /^claude-sonnet/i,\n /^claude-opus/i,\n /^claude-haiku-4/i,\n /^claude-[45](?:-|$)/i,\n ],\n // Google — Gemini 1.5+ are multi-modal; legacy gemini-pro is text-only,\n // but gemini-pro-vision was the explicit vision SKU before 1.5.\n gemini: [/^gemini-(1\\.5|2|3)/i, /^gemini-pro-vision/i],\n // GitHub Copilot — proxies vision-capable models from OpenAI / Anthropic /\n // Google. Mirror those families (the actual capability is gated server-\n // side by Copilot; we just don't warn).\n \"github-copilot\": [\n /^gpt-4o/i,\n /^gpt-4\\.1/i,\n /^gpt-5/i,\n /^o[134](?:-|$)/i,\n /^claude-3/i,\n /^claude-sonnet/i,\n /^claude-opus/i,\n /^claude-haiku-4/i,\n /^claude-[45](?:-|$)/i,\n /^gemini-(1\\.5|2|3)/i,\n ],\n // DeepSeek / Cohere — current public chat SKUs are text-only.\n deepseek: [],\n cohere: [],\n // LangChain pass-through could be anything; treat as unknown (handled\n // separately below) rather than yes/no.\n langchain: [],\n // Tests assume the mock accepts images.\n mock: [/.*/],\n};\n\n/**\n * Returns true when the given (provider, model_id) pair is known to accept\n * image inputs. Unknown providers / models return false — call\n * `isProviderClassified` if you want to distinguish \"definitely no\" from\n * \"we don't recognize this\".\n */\nexport function modelSupportsImages(provider: string, modelId: string): boolean {\n const pats = PATTERNS[provider.toLowerCase()] ?? [];\n return pats.some((re) => re.test(modelId));\n}\n\n/**\n * True when we have an explicit capability list for the provider. Used by\n * the UI to soften the warning copy (\"might not support images\") for\n * pass-through providers like `langchain` or unknown external ones.\n */\nexport function isProviderClassified(provider: string): boolean {\n return provider.toLowerCase() in PATTERNS;\n}\n\n// ── extended capabilities for badge rendering ────────────────────────────────\n// Mirrors CatalogModel[\"capabilities\"] so saved ModelConfigs can render the\n// same icon set the catalog browser uses. Heuristics err on the conservative\n// side for audio (vanilla gpt-4o is NOT audio-capable — only *-audio-preview /\n// *-realtime are) and generous side for files (PDF / document input).\n\nconst AUDIO_PATTERNS: Record<string, RegExp[]> = {\n openai: [/audio/i, /realtime/i],\n gemini: [/^gemini-(1\\.5|2|3)/i],\n anthropic: [],\n \"github-copilot\": [/audio/i, /realtime/i, /^gemini-(1\\.5|2|3)/i],\n deepseek: [],\n cohere: [],\n langchain: [],\n mock: [/.*/],\n};\n\nconst FILES_PATTERNS: Record<string, RegExp[]> = {\n // PDF / document upload support.\n openai: [/^gpt-4o/i, /^gpt-4\\.1/i, /^gpt-4-turbo/i, /^gpt-5/i, /^o[134](?:-|$)/i, /^chatgpt-4o/i],\n anthropic: [/^claude-3/i, /^claude-sonnet/i, /^claude-opus/i, /^claude-haiku-4/i, /^claude-[45](?:-|$)/i],\n gemini: [/^gemini-(1\\.5|2|3)/i],\n \"github-copilot\": [/^gpt-4o/i, /^gpt-4\\.1/i, /^gpt-5/i, /^o[134](?:-|$)/i, /^claude-3/i, /^claude-sonnet/i, /^claude-opus/i, /^claude-haiku-4/i, /^claude-[45](?:-|$)/i, /^gemini-(1\\.5|2|3)/i],\n deepseek: [],\n cohere: [],\n langchain: [],\n mock: [/.*/],\n};\n\nconst WEB_SEARCH_PATTERNS: Record<string, RegExp[]> = {\n // Built-in provider-side web tool.\n anthropic: [/^claude-3\\.5/i, /^claude-3\\.7/i, /^claude-sonnet/i, /^claude-opus/i, /^claude-haiku-4/i, /^claude-[45](?:-|$)/i],\n openai: [],\n gemini: [],\n \"github-copilot\": [],\n deepseek: [],\n cohere: [],\n langchain: [],\n mock: [],\n};\n\nconst JSON_MODE_PROVIDERS = new Set([\"openai\", \"gemini\", \"deepseek\", \"mock\"]);\n\nfunction matchesAny(map: Record<string, RegExp[]>, provider: string, modelId: string): boolean {\n const pats = map[provider.toLowerCase()] ?? [];\n return pats.some((re) => re.test(modelId));\n}\n\nexport interface ModelCapabilities {\n vision: boolean;\n tools: boolean;\n streaming: boolean;\n json_mode: boolean;\n web_search: boolean;\n audio: boolean;\n files: boolean;\n}\n\n/**\n * Best-effort capability inference for a saved (provider, model_id) pair —\n * used to render capability badges in surfaces that don't have a live\n * catalog fetch (ModelsPanel, AgentEditor dropdowns, etc.).\n */\nexport function modelCapabilities(provider: string, modelId: string): ModelCapabilities {\n const p = provider.toLowerCase();\n // Reasoner-style models that don't expose tool calling.\n const noTools = /^deepseek-reasoner/i.test(modelId);\n return {\n vision: modelSupportsImages(provider, modelId),\n tools: isProviderClassified(p) && !noTools,\n streaming: true,\n json_mode: JSON_MODE_PROVIDERS.has(p),\n web_search: matchesAny(WEB_SEARCH_PATTERNS, provider, modelId),\n audio: matchesAny(AUDIO_PATTERNS, provider, modelId),\n files: matchesAny(FILES_PATTERNS, provider, modelId),\n };\n}\n","\"use client\";\nimport { useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\n\ninterface Props {\n value: string;\n onChange: (value: string) => void;\n className?: string;\n placeholder?: string;\n rows?: number;\n maxLength?: number;\n monospace?: boolean;\n}\n\nconst MD_REMARK_PLUGINS = [remarkGfm];\n\nexport function MarkdownTextarea({\n value,\n onChange,\n className = \"\",\n placeholder,\n rows,\n maxLength,\n monospace,\n}: Props) {\n const [mode, setMode] = useState<\"edit\" | \"preview\">(\"edit\");\n const fontClass = monospace ? \"font-mono\" : \"\";\n return (\n <div className=\"space-y-1\">\n {/*\n Toolbar uses span+role=button rather than <button> so the surrounding\n <label> wrapper still implicitly associates with the <textarea> below\n (HTML labels bind to the first labelable descendant, and <button> is\n labelable; spans are not).\n */}\n <div role=\"toolbar\" className=\"flex items-center justify-end gap-1 text-[10px]\">\n <span\n role=\"button\"\n tabIndex={0}\n onClick={() => setMode(\"edit\")}\n onKeyDown={(e) => { if (e.key === \"Enter\" || e.key === \" \") { e.preventDefault(); setMode(\"edit\"); } }}\n className={`px-1.5 py-0.5 rounded transition-colors cursor-pointer select-none ${\n mode === \"edit\" ? \"bg-surface-3 text-fg\" : \"text-fg-subtle hover:text-fg\"\n }`}\n >\n Edit\n </span>\n <span\n role=\"button\"\n tabIndex={value.trim() ? 0 : -1}\n aria-disabled={!value.trim()}\n onClick={() => { if (value.trim()) setMode(\"preview\"); }}\n onKeyDown={(e) => { if ((e.key === \"Enter\" || e.key === \" \") && value.trim()) { e.preventDefault(); setMode(\"preview\"); } }}\n className={`px-1.5 py-0.5 rounded transition-colors select-none ${\n !value.trim() ? \"opacity-40 cursor-not-allowed\" : \"cursor-pointer\"\n } ${mode === \"preview\" ? \"bg-surface-3 text-fg\" : \"text-fg-subtle hover:text-fg\"}`}\n >\n Preview\n </span>\n </div>\n {mode === \"edit\" ? (\n <textarea\n className={`${className} ${fontClass}`.trim()}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={placeholder}\n rows={rows}\n maxLength={maxLength}\n />\n ) : (\n <div\n className={`${className} prose prose-invert prose-sm max-w-none jarela-rich overflow-auto`}\n style={{ minHeight: rows ? `${rows * 1.5}em` : undefined }}\n >\n {value.trim() ? (\n <ReactMarkdown remarkPlugins={MD_REMARK_PLUGINS}>{value}</ReactMarkdown>\n ) : (\n <span className=\"text-fg-faint italic\">Nothing to preview</span>\n )}\n </div>\n )}\n </div>\n );\n}\n","import type {\n AgentConfig,\n AgentConfigIn,\n AgentInfo,\n Bridge,\n BridgeChatsResponse,\n BridgeIn,\n BridgeLiveStatus,\n BridgePatch,\n BridgeRoute,\n BridgeRouteIn,\n BridgeRoutePatch,\n DashboardCurrencyInfo,\n DashboardMetrics,\n DashboardPricingRefreshResult,\n ContentPart,\n EnvAllowlistConfig,\n EnvSyncResult,\n ExtensionsListResponse,\n IntegrationsListResponse,\n IntegrationStatus,\n McpRegistryEntry,\n McpServer,\n McpServerIn,\n PendingAction,\n ScheduledTask,\n Watcher,\n DocumentSource,\n DocumentSourceIn,\n DocumentSourcePatch,\n DocumentSettings,\n DocumentHit,\n DocumentReindexResult,\n MemoryItem,\n ModelConfig,\n ModelConfigIn,\n StreamOptions,\n ToolInfo,\n ToolPolicy,\n ToolSecretSlotInfo,\n TaskAssignment,\n ThreadDetail,\n ThreadSummary,\n UserProfile,\n BuiltinToolCategoryInfo,\n Harness,\n HarnessIn,\n HarnessListResponse,\n HarnessPatch,\n} from \"./types\";\n\nconst BASE = \"/api/v1\";\n\nconst LIST_TTL_MS = 30_000;\n\ninterface ListCache<T> {\n data: T[] | null;\n fetchedAt: number;\n inflight: Promise<T[]> | null;\n}\n\nfunction emptyCache<T>(): ListCache<T> {\n return { data: null, fetchedAt: 0, inflight: null };\n}\n\nfunction cloneRows<T>(rows: T[]): T[] {\n return rows.map((row) => ({ ...row }));\n}\n\nconst agentListCache: ListCache<AgentConfig> = emptyCache();\nconst modelListCache: ListCache<ModelConfig> = emptyCache();\nconst taskListCache: ListCache<TaskAssignment> = emptyCache();\n\nfunction setAgentListCache(rows: AgentConfig[], notify = true): AgentConfig[] {\n const snap = cloneRows(rows);\n agentListCache.data = snap;\n agentListCache.fetchedAt = Date.now();\n agentListCache.inflight = null;\n if (notify && typeof window !== \"undefined\") {\n window.dispatchEvent(new CustomEvent(\"jarela:agents-changed\"));\n }\n return cloneRows(snap);\n}\n\nfunction setModelListCache(rows: ModelConfig[], notify = true): ModelConfig[] {\n const snap = cloneRows(rows);\n modelListCache.data = snap;\n modelListCache.fetchedAt = Date.now();\n modelListCache.inflight = null;\n if (notify && typeof window !== \"undefined\") {\n window.dispatchEvent(new CustomEvent(\"jarela:models-changed\"));\n }\n return cloneRows(snap);\n}\n\nfunction setTaskListCache(rows: TaskAssignment[], notify = true): TaskAssignment[] {\n const snap = cloneRows(rows);\n taskListCache.data = snap;\n taskListCache.fetchedAt = Date.now();\n taskListCache.inflight = null;\n if (notify && typeof window !== \"undefined\") {\n window.dispatchEvent(new CustomEvent(\"jarela:tasks-changed\"));\n }\n return cloneRows(snap);\n}\n\nfunction cachedList<T>(\n cache: ListCache<T>,\n fetchFn: () => Promise<T[]>,\n setCache: (rows: T[], notify?: boolean) => T[],\n force: boolean,\n): Promise<T[]> {\n const now = Date.now();\n if (!force && cache.data && now - cache.fetchedAt < LIST_TTL_MS) {\n return Promise.resolve(cloneRows(cache.data));\n }\n if (!force && cache.inflight) return cache.inflight;\n const req = fetchFn().then((rows) => setCache(rows, false));\n cache.inflight = req;\n return req;\n}\n\nasync function request<T>(path: string, init?: RequestInit): Promise<T> {\n const res = await fetch(`${BASE}${path}`, {\n headers: { \"Content-Type\": \"application/json\", ...init?.headers },\n ...init,\n });\n if (!res.ok) {\n const text = await res.text().catch(() => res.statusText);\n throw new Error(`${res.status} ${text}`);\n }\n return res.json() as Promise<T>;\n}\n\nexport const api = {\n agents: {\n list: (opts?: { force?: boolean }) =>\n cachedList(agentListCache, () => request<AgentConfig[]>(\"/agents\"), setAgentListCache, opts?.force === true),\n get: (id: string) => request<AgentConfig>(`/agents/${encodeURIComponent(id)}`),\n create: async (data: AgentConfigIn) => {\n const created = await request<AgentConfig>(\"/agents\", { method: \"POST\", body: JSON.stringify(data) });\n if (agentListCache.data) setAgentListCache([...agentListCache.data, created]);\n else if (typeof window !== \"undefined\") window.dispatchEvent(new CustomEvent(\"jarela:agents-changed\"));\n return created;\n },\n update: async (id: string, data: AgentConfigIn) => {\n const updated = await request<AgentConfig>(`/agents/${encodeURIComponent(id)}`, { method: \"PUT\", body: JSON.stringify(data) });\n if (agentListCache.data) setAgentListCache(agentListCache.data.map((a) => (a.id === id ? updated : a)));\n else if (typeof window !== \"undefined\") window.dispatchEvent(new CustomEvent(\"jarela:agents-changed\"));\n return updated;\n },\n delete: async (id: string) => {\n const res = await request<{ deleted: boolean }>(`/agents/${encodeURIComponent(id)}`, { method: \"DELETE\" });\n if (res.deleted) {\n if (agentListCache.data) setAgentListCache(agentListCache.data.filter((a) => a.id !== id));\n else if (typeof window !== \"undefined\") window.dispatchEvent(new CustomEvent(\"jarela:agents-changed\"));\n }\n return res;\n },\n getThread: (id: string) =>\n request<ThreadSummary>(`/agents/${encodeURIComponent(id)}/thread`),\n compact: (id: string) =>\n request<{ compacted: boolean; summary?: string; reason?: string; message_count?: number; context_chars?: number }>(\n `/agents/${encodeURIComponent(id)}/compact`,\n { method: \"POST\", body: \"{}\" },\n ),\n },\n\n tools: {\n list: () => request<ToolInfo[]>(\"/tools\"),\n },\n\n builtinTools: {\n list: () => request<BuiltinToolCategoryInfo[]>(\"/builtin-tools\"),\n setEnabled: (category: string, enabled: boolean) =>\n request<{ category: string; enabled: boolean }>(\"/builtin-tools\", {\n method: \"PATCH\",\n body: JSON.stringify({ category, enabled }),\n }),\n },\n\n extensions: {\n list: () => request<ExtensionsListResponse>(\"/extensions\"),\n getToolSecrets: (name: string) =>\n request<{ name: string; secrets: ToolSecretSlotInfo[] }>(\n `/extensions/tools/${encodeURIComponent(name)}/secrets`,\n ),\n saveToolSecrets: (name: string, values: Record<string, string>) =>\n request<{ name: string; secrets: ToolSecretSlotInfo[] }>(\n `/extensions/tools/${encodeURIComponent(name)}/secrets`,\n { method: \"PUT\", body: JSON.stringify({ values }) },\n ),\n },\n\n threads: {\n list: (limit = 50, offset = 0) => request<ThreadSummary[]>(`/threads?limit=${limit}&offset=${offset}`),\n create: (agent_id: string, title?: string) =>\n request<ThreadSummary>(\"/threads\", { method: \"POST\", body: JSON.stringify({ agent_id, title }) }),\n get: (thread_id: string, opts?: { limit?: number; before?: string; after?: string }) => {\n const p = new URLSearchParams();\n if (opts?.limit) p.set(\"limit\", String(opts.limit));\n if (opts?.before) p.set(\"before\", opts.before);\n // `after`: only return messages newer than this ISO timestamp. Used\n // by ChatView post-run to fetch the freshly-persisted user+assistant\n // pair instead of re-pulling the whole most-recent page.\n if (opts?.after) p.set(\"after\", opts.after);\n const qs = p.toString() ? `?${p}` : \"\";\n return request<ThreadDetail>(`/threads/${thread_id}${qs}`);\n },\n delete: (thread_id: string) =>\n request<{ deleted: boolean }>(`/threads/${thread_id}`, { method: \"DELETE\" }),\n // Abort the active agent run on this thread. The server's stream loop\n // catches the resulting AbortError and emits an `error` + `done` so\n // any UI queue-drain hook (e.g. ChatView) still fires.\n abortRun: (thread_id: string) =>\n request<{ aborted: boolean }>(`/threads/${thread_id}/run`, { method: \"DELETE\" }),\n // ADR-0042. Move the explicit hot/warm context boundary on this thread.\n // Pass `null` to clear the pin and let the agent's default window apply.\n // Fire-and-forget from the chat — UI updates optimistically and the\n // returned shape just confirms server-side state for resync if needed.\n setContextPin: (thread_id: string, hot_since: string | null) =>\n request<import(\"./types\").ThreadContextPin>(\n `/threads/${thread_id}/context-pin`,\n { method: \"PATCH\", body: JSON.stringify({ hot_since }) },\n ),\n },\n\n memory: {\n list: (namespace?: string, search?: string, limit = 50) => {\n const p = new URLSearchParams();\n if (namespace) p.set(\"namespace\", namespace);\n if (search) p.set(\"search\", search);\n p.set(\"limit\", String(limit));\n return request<MemoryItem[]>(`/memory?${p}`);\n },\n create: (namespace: string, key: string, value: unknown) =>\n request<MemoryItem>(\"/memory\", { method: \"POST\", body: JSON.stringify({ namespace, key, value }) }),\n update: (namespace: string, key: string, value: unknown) =>\n request<MemoryItem>(`/memory/${encodeURIComponent(namespace)}/${encodeURIComponent(key)}`, {\n method: \"PUT\", body: JSON.stringify({ value }),\n }),\n delete: (namespace: string, key: string) =>\n request<{ deleted: boolean }>(`/memory/${encodeURIComponent(namespace)}/${encodeURIComponent(key)}`, { method: \"DELETE\" }),\n },\n\n models: {\n list: (opts?: { force?: boolean }) =>\n cachedList(modelListCache, () => request<ModelConfig[]>(\"/models\"), setModelListCache, opts?.force === true),\n providers: () => request<string[]>(\"/providers\"),\n catalog: (provider: string) => request<import(\"./types\").CatalogModel[]>(`/providers/${encodeURIComponent(provider)}/models`),\n create: async (name: string, data: ModelConfigIn) => {\n const created = await request<ModelConfig>(\"/models\", { method: \"POST\", body: JSON.stringify({ name, ...data }) });\n if (modelListCache.data) setModelListCache([...modelListCache.data, created]);\n else if (typeof window !== \"undefined\") window.dispatchEvent(new CustomEvent(\"jarela:models-changed\"));\n return created;\n },\n update: async (name: string, data: ModelConfigIn) => {\n const updated = await request<ModelConfig>(`/models/${encodeURIComponent(name)}`, { method: \"PUT\", body: JSON.stringify(data) });\n if (modelListCache.data) setModelListCache(modelListCache.data.map((m) => (m.name === name ? updated : m)));\n else if (typeof window !== \"undefined\") window.dispatchEvent(new CustomEvent(\"jarela:models-changed\"));\n return updated;\n },\n delete: async (name: string) => {\n const res = await request<{ deleted: boolean }>(`/models/${encodeURIComponent(name)}`, { method: \"DELETE\" });\n if (res.deleted) {\n if (modelListCache.data) setModelListCache(modelListCache.data.filter((m) => m.name !== name));\n else if (typeof window !== \"undefined\") window.dispatchEvent(new CustomEvent(\"jarela:models-changed\"));\n // Deleting a model cascades to its assignments server-side; drop the\n // task list cache so the next read reflects the server.\n if (taskListCache.data) setTaskListCache(taskListCache.data.filter((t) => t.model_config_name !== name));\n }\n return res;\n },\n },\n\n profile: {\n get: () => request<UserProfile>(\"/profile\"),\n update: (data: Partial<Pick<UserProfile, \"name\" | \"icon\" | \"about\" | \"preset\">>) =>\n request<UserProfile>(\"/profile\", { method: \"PUT\", body: JSON.stringify(data) }),\n setLocationConsent: (consent: boolean) =>\n request<UserProfile>(\"/profile/location\", { method: \"PUT\", body: JSON.stringify({ consent }) }),\n updateLocation: (data: { lat: number; lng: number; accuracy_m?: number | null; label?: string | null }) =>\n request<UserProfile>(\"/profile/location\", { method: \"POST\", body: JSON.stringify(data) }),\n clearLocation: () =>\n request<UserProfile>(\"/profile/location\", { method: \"DELETE\" }),\n },\n\n access: {\n list: () => request<import(\"./types\").AccessWhitelistEntry[]>(\"/access\"),\n add: (identity: string, display_name?: string | null) =>\n request<import(\"./types\").AccessWhitelistEntry>(\"/access\", {\n method: \"POST\", body: JSON.stringify({ identity, display_name }),\n }),\n remove: (identity: string) =>\n request<{ deleted: boolean }>(`/access/${encodeURIComponent(identity)}`, { method: \"DELETE\" }),\n },\n\n tasks: {\n list: (opts?: { force?: boolean }) =>\n cachedList(taskListCache, () => request<TaskAssignment[]>(\"/tasks\"), setTaskListCache, opts?.force === true),\n assign: async (agent_id: string, model_config_name: string, tool_policy?: ToolPolicy) => {\n const assigned = await request<TaskAssignment>(`/tasks/${encodeURIComponent(agent_id)}`, {\n method: \"PUT\", body: JSON.stringify({ model_config_name, tool_policy }),\n });\n if (taskListCache.data) {\n const exists = taskListCache.data.some((t) => t.agent_id === agent_id);\n const next = exists\n ? taskListCache.data.map((t) => (t.agent_id === agent_id ? assigned : t))\n : [...taskListCache.data, assigned];\n setTaskListCache(next);\n } else if (typeof window !== \"undefined\") {\n window.dispatchEvent(new CustomEvent(\"jarela:tasks-changed\"));\n }\n return assigned;\n },\n unassign: async (agent_id: string) => {\n const res = await request<{ deleted: boolean }>(`/tasks/${encodeURIComponent(agent_id)}`, { method: \"DELETE\" });\n if (taskListCache.data) setTaskListCache(taskListCache.data.filter((t) => t.agent_id !== agent_id));\n else if (typeof window !== \"undefined\") window.dispatchEvent(new CustomEvent(\"jarela:tasks-changed\"));\n return res;\n },\n },\n\n dashboard: {\n metrics: (days = 30) => request<DashboardMetrics>(`/dashboard/metrics?days=${encodeURIComponent(String(days))}`),\n refreshPricing: (opts?: { force?: boolean; ttlDays?: number }) => {\n const qs = new URLSearchParams();\n if (opts?.force === true) qs.set(\"force\", \"1\");\n if (typeof opts?.ttlDays === \"number\" && Number.isFinite(opts.ttlDays)) qs.set(\"ttlDays\", String(opts.ttlDays));\n const suffix = qs.toString() ? `?${qs.toString()}` : \"\";\n return request<DashboardPricingRefreshResult>(`/dashboard/pricing${suffix}`, {\n method: \"POST\",\n body: \"{}\",\n });\n },\n currency: (opts?: { lat?: number | null; lng?: number | null; currency?: string | null }) => {\n const qs = new URLSearchParams();\n if (typeof opts?.lat === \"number\" && Number.isFinite(opts.lat)) qs.set(\"lat\", String(opts.lat));\n if (typeof opts?.lng === \"number\" && Number.isFinite(opts.lng)) qs.set(\"lng\", String(opts.lng));\n if (opts?.currency) qs.set(\"currency\", opts.currency);\n const suffix = qs.toString() ? `?${qs.toString()}` : \"\";\n return request<DashboardCurrencyInfo>(`/dashboard/currency${suffix}`);\n },\n },\n\n mcp: {\n list: () => request<McpServer[]>(\"/mcp-servers\"),\n create: (data: McpServerIn) =>\n request<McpServer>(\"/mcp-servers\", { method: \"POST\", body: JSON.stringify(data) }),\n update: (name: string, data: Partial<McpServerIn>) =>\n request<McpServer>(`/mcp-servers/${encodeURIComponent(name)}`, { method: \"PUT\", body: JSON.stringify(data) }),\n delete: (name: string) =>\n request<{ deleted: boolean }>(`/mcp-servers/${encodeURIComponent(name)}`, { method: \"DELETE\" }),\n registry: (params?: { q?: string; cursor?: string; fresh?: boolean }) => {\n const qs = new URLSearchParams();\n if (params?.q) qs.set(\"q\", params.q);\n if (params?.cursor) qs.set(\"cursor\", params.cursor);\n if (params?.fresh) qs.set(\"fresh\", \"1\");\n const suffix = qs.toString() ? `?${qs}` : \"\";\n return request<{ entries: McpRegistryEntry[]; nextCursor?: string }>(`/mcp-servers/registry${suffix}`);\n },\n },\n\n integrations: {\n list: () => request<IntegrationsListResponse>(\"/integrations\"),\n save: (name: string, values: Record<string, string>) =>\n request<IntegrationStatus>(`/integrations/${encodeURIComponent(name)}`, {\n method: \"PUT\", body: JSON.stringify(values),\n }),\n delete: (name: string) =>\n request<{ deleted: boolean }>(`/integrations/${encodeURIComponent(name)}`, { method: \"DELETE\" }),\n test: (name: string) =>\n request<{ ok: boolean; error?: string; detail?: Record<string, unknown> }>(\n `/integrations/${encodeURIComponent(name)}/test`, { method: \"POST\", body: \"{}\" },\n ),\n gmailOauthStart: (creds: { client_id?: string; client_secret?: string }) =>\n request<{ authorize_url: string; state: string; redirect_uri: string }>(\n `/integrations/gmail/oauth/start`,\n { method: \"POST\", body: JSON.stringify(creds) },\n ),\n gmailOauthStatus: (state: string) =>\n request<{ status: \"pending\" | \"done\" | \"error\" | \"unknown\"; error?: string }>(\n `/integrations/gmail/oauth/status?state=${encodeURIComponent(state)}`,\n ),\n outlookOauthStart: (creds: { client_id?: string; client_secret?: string }) =>\n request<{ authorize_url: string; state: string; redirect_uri: string }>(\n `/integrations/outlook/oauth/start`,\n { method: \"POST\", body: JSON.stringify(creds) },\n ),\n outlookOauthStatus: (state: string) =>\n request<{ status: \"pending\" | \"done\" | \"error\" | \"unknown\"; error?: string }>(\n `/integrations/outlook/oauth/status?state=${encodeURIComponent(state)}`,\n ),\n },\n\n envSync: {\n preview: () => request<EnvSyncResult>(\"/env-sync\"),\n apply: () => request<EnvSyncResult>(\"/env-sync\", { method: \"POST\", body: \"{}\" }),\n allowlist: {\n get: () => request<EnvAllowlistConfig>(\"/env-sync/allowlist\"),\n set: (integration: string, field: string, envVars: string[]) =>\n request<EnvAllowlistConfig>(\"/env-sync/allowlist\", {\n method: \"PUT\",\n body: JSON.stringify({ integration, field, envVars }),\n }),\n },\n },\n\n pending: {\n list: (status?: \"pending\" | \"approved\" | \"denied\" | \"failed\") =>\n request<PendingAction[]>(`/pending-actions${status ? `?status=${status}` : \"\"}`),\n // ADR-0010: `extras` carries approval-time secret material (provider keys,\n // integration credentials) that the agent never sees. The route forwards\n // it to applyAction; the agent's pending_actions.payload stays clean.\n approve: (id: string, extras?: Record<string, unknown>) =>\n request<PendingAction>(\n `/pending-actions/${encodeURIComponent(id)}/approve`,\n { method: \"POST\", body: JSON.stringify(extras ? { extras } : {}) },\n ),\n deny: (id: string) =>\n request<PendingAction>(`/pending-actions/${encodeURIComponent(id)}/deny`, { method: \"POST\", body: \"{}\" }),\n },\n\n scheduledTasks: {\n list: (agent_id?: string) =>\n request<ScheduledTask[]>(`/scheduled-tasks${agent_id ? `?agent_id=${encodeURIComponent(agent_id)}` : \"\"}`),\n // ADR-0032 — patch supports the reaction discriminator. Mirrors the\n // watchers.update shape; explicit reaction_kind triggers a full replace.\n update: (id: string, patch: Partial<Pick<ScheduledTask, \"agent_id\" | \"prompt\" | \"description\" | \"kind\" | \"schedule\" | \"enabled\" | \"silent\">> & {\n reaction_kind?: \"agent_prompt\" | \"script\";\n reaction_script?: string | null;\n reaction_script_args?: Record<string, unknown> | null;\n }) =>\n request<ScheduledTask>(`/scheduled-tasks/${encodeURIComponent(id)}`, { method: \"PATCH\", body: JSON.stringify(patch) }),\n cancel: (id: string) =>\n request<{ deleted: boolean }>(`/scheduled-tasks/${encodeURIComponent(id)}`, { method: \"DELETE\" }),\n runNow: (id: string) =>\n request<{ accepted: boolean; task_id: string }>(`/scheduled-tasks/${encodeURIComponent(id)}/run`, { method: \"POST\", body: \"{}\" }),\n },\n\n // Event-driven watchers (ADR-0027). Polls a built-in tool every N\n // seconds; only fires the agent when the tool output changes.\n watchers: {\n list: (agent_id?: string) =>\n request<Watcher[]>(`/watchers${agent_id ? `?agent_id=${encodeURIComponent(agent_id)}` : \"\"}`),\n create: (data: {\n agent_id: string;\n label: string;\n tool: string;\n args?: Record<string, unknown>;\n every_seconds: number;\n silent?: boolean;\n reaction_kind?: \"agent_prompt\" | \"script\";\n reaction_prompt?: string | null;\n reaction_script?: string | null;\n reaction_script_args?: Record<string, unknown> | null;\n }) =>\n request<Watcher>(\"/watchers\", { method: \"POST\", body: JSON.stringify(data) }),\n update: (\n id: string,\n patch: Partial<{\n agent_id: string;\n label: string;\n interval_seconds: number;\n enabled: boolean;\n silent: boolean;\n reaction_kind: \"agent_prompt\" | \"script\";\n reaction_prompt: string | null;\n reaction_script: string | null;\n reaction_script_args: Record<string, unknown> | null;\n }>,\n ) =>\n request<Watcher>(`/watchers/${encodeURIComponent(id)}`, { method: \"PATCH\", body: JSON.stringify(patch) }),\n cancel: (id: string) =>\n request<{ deleted: boolean }>(`/watchers/${encodeURIComponent(id)}`, { method: \"DELETE\" }),\n runNow: (id: string) =>\n request<{ accepted: boolean; watcher_id: string }>(`/watchers/${encodeURIComponent(id)}/run`, { method: \"POST\", body: \"{}\" }),\n // ADR-0031: list registered reaction scripts (`reaction.*` namespace)\n // for the watcher UI's reaction-kind picker.\n listReactionScripts: () =>\n request<{ scripts: string[] }>(\"/watchers/reaction-scripts\"),\n },\n\n // Document RAG (ADR-0024). Folder sources are scanned by the scheduler\n // every ~10 minutes; the search endpoint is a thin wrapper over the\n // `documents_search` tool so callers can preview hits without invoking\n // an agent.\n documents: {\n listSources: () => request<DocumentSource[]>(\"/documents/sources\"),\n createSource: (data: DocumentSourceIn) =>\n request<DocumentSource>(\"/documents/sources\", { method: \"POST\", body: JSON.stringify(data) }),\n updateSource: (id: string, patch: DocumentSourcePatch) =>\n request<DocumentSource>(`/documents/sources/${encodeURIComponent(id)}`, { method: \"PATCH\", body: JSON.stringify(patch) }),\n deleteSource: (id: string) =>\n request<{ deleted: boolean }>(`/documents/sources/${encodeURIComponent(id)}`, { method: \"DELETE\" }),\n reindex: (id: string) =>\n request<DocumentReindexResult>(`/documents/sources/${encodeURIComponent(id)}/reindex`, { method: \"POST\", body: \"{}\" }),\n search: (q: string, opts?: { limit?: number; source_id?: string }) => {\n const p = new URLSearchParams({ q });\n if (opts?.limit) p.set(\"limit\", String(opts.limit));\n if (opts?.source_id) p.set(\"source_id\", opts.source_id);\n return request<{ query: string; hits: DocumentHit[] }>(`/documents/search?${p.toString()}`);\n },\n getSettings: () => request<DocumentSettings>(\"/documents/settings\"),\n setSettings: (patch: DocumentSettings) =>\n request<DocumentSettings>(\"/documents/settings\", { method: \"PUT\", body: JSON.stringify(patch) }),\n },\n\n // Filesystem browse — backs the folder-picker dialog in the Documents\n // panel. Lists immediate subdirectories at an absolute path.\n fs: {\n browse: (p?: string) => {\n const qs = p ? `?path=${encodeURIComponent(p)}` : \"\";\n return request<{\n path: string;\n parent: string | null;\n home: string;\n entries: { name: string; path: string }[];\n }>(`/fs/browse${qs}`);\n },\n },\n\n githubCopilotAuth: {\n status: () => request<{ signed_in: boolean; stored_at: string | null }>(\"/providers/github-copilot/auth\"),\n start: () => request<{ device_code: string; user_code: string; verification_uri: string; expires_in: number; interval: number }>(\n \"/providers/github-copilot/auth\", { method: \"POST\", body: \"{}\" },\n ),\n poll: (device_code: string) => request<{ status: string; access_token?: string; error?: string }>(\n \"/providers/github-copilot/auth\", { method: \"PUT\", body: JSON.stringify({ device_code }) },\n ),\n signOut: () => request<{ deleted: boolean }>(\"/providers/github-copilot/auth\", { method: \"DELETE\" }),\n },\n\n bridges: {\n list: () => request<Bridge[]>(\"/bridges\"),\n get: (id: string) => request<Bridge>(`/bridges/${encodeURIComponent(id)}`),\n create: (data: BridgeIn) =>\n request<Bridge>(\"/bridges\", { method: \"POST\", body: JSON.stringify(data) }),\n update: (id: string, patch: BridgePatch) =>\n request<Bridge>(`/bridges/${encodeURIComponent(id)}`, { method: \"PATCH\", body: JSON.stringify(patch) }),\n delete: (id: string) =>\n request<{ deleted: boolean }>(`/bridges/${encodeURIComponent(id)}`, { method: \"DELETE\" }),\n status: (id: string) => request<BridgeLiveStatus>(`/bridges/${encodeURIComponent(id)}/status`),\n pair: (id: string) =>\n request<{ accepted: boolean }>(`/bridges/${encodeURIComponent(id)}/pair`, { method: \"POST\", body: \"{}\" }),\n chats: (id: string) => request<BridgeChatsResponse>(`/bridges/${encodeURIComponent(id)}/chats`),\n lookup: (id: string, phone: string) =>\n request<{ chat: import(\"./types\").BridgeChat | null }>(\n `/bridges/${encodeURIComponent(id)}/lookup`,\n { method: \"POST\", body: JSON.stringify({ phone }) },\n ),\n\n routes: {\n list: (bridge_id: string) =>\n request<BridgeRoute[]>(`/bridges/${encodeURIComponent(bridge_id)}/routes`),\n create: (bridge_id: string, data: BridgeRouteIn) =>\n request<BridgeRoute>(`/bridges/${encodeURIComponent(bridge_id)}/routes`, {\n method: \"POST\", body: JSON.stringify(data),\n }),\n update: (bridge_id: string, route_id: string, patch: BridgeRoutePatch) =>\n request<BridgeRoute>(\n `/bridges/${encodeURIComponent(bridge_id)}/routes/${encodeURIComponent(route_id)}`,\n { method: \"PATCH\", body: JSON.stringify(patch) },\n ),\n delete: (bridge_id: string, route_id: string) =>\n request<{ deleted: boolean }>(\n `/bridges/${encodeURIComponent(bridge_id)}/routes/${encodeURIComponent(route_id)}`,\n { method: \"DELETE\" },\n ),\n },\n },\n\n tailscale: {\n status: () => request<import(\"./types\").TailscaleStatus>(\"/tailscale\"),\n },\n\n harnesses: {\n list: () => request<HarnessListResponse>(\"/harnesses\"),\n get: (id: string) => request<Harness>(`/harnesses/${encodeURIComponent(id)}`),\n create: (data: HarnessIn) =>\n request<Harness>(\"/harnesses\", { method: \"POST\", body: JSON.stringify(data) }),\n update: (id: string, patch: HarnessPatch) =>\n request<Harness>(`/harnesses/${encodeURIComponent(id)}`, {\n method: \"PATCH\",\n body: JSON.stringify(patch),\n }),\n delete: (id: string) =>\n request<{ deleted: boolean }>(`/harnesses/${encodeURIComponent(id)}`, { method: \"DELETE\" }),\n setDefault: (id: string) =>\n request<{ id: string }>(\"/harnesses/default\", {\n method: \"PUT\",\n body: JSON.stringify({ id }),\n }),\n },\n\n proxy: {\n get: () => request<import(\"./types\").ProxyConfigEnvelope>(\"/proxy-config\"),\n save: (input: import(\"./types\").ProxyConfigInput) =>\n request<import(\"./types\").ProxyConfigEnvelope>(\"/proxy-config\", {\n method: \"PUT\",\n body: JSON.stringify(input),\n }),\n clear: () =>\n request<import(\"./types\").ProxyConfigEnvelope & { deleted: boolean }>(\"/proxy-config\", {\n method: \"DELETE\",\n }),\n },\n};\n\n\n// ---------------------------------------------------------------------------\n// Agent run streaming — CQRS transport (ADR-0008)\n// ---------------------------------------------------------------------------\n//\n// One turn = one POST (submit) + one EventSource (subscribe). The previous\n// WS sidecar / SSE-over-POST / SSE-GET-reattach trio is gone; EventSource\n// is the only WebKit-native streaming primitive that survives iOS Safari +\n// HTTP/2 reverse-proxies (Tailscale serve), so we route every browser\n// through it.\n\nexport interface SubmitResult {\n /** true iff the server accepted ownership of this turn (HTTP 202). */\n accepted: boolean;\n /** Present on non-2xx outcomes. `run_in_flight` = another tab/device\n * owns the current turn; caller should re-queue and still subscribe to\n * observe live deltas. */\n code?: \"run_in_flight\" | string;\n error?: string;\n}\n\n/** POST /threads/:id/run — registers a run and returns immediately. The\n * caller is expected to follow up with `subscribeRun()` to receive the\n * chunk stream. Idempotent in the sense that two simultaneous submissions\n * for the same thread will see one 202 and one 409 (`run_in_flight`). */\nexport async function submitRun(\n thread_id: string,\n message: string,\n signal: AbortSignal,\n stream_options?: StreamOptions,\n attachments?: ContentPart[],\n hot_since?: string | null,\n): Promise<SubmitResult> {\n const res = await fetch(`${BASE}/threads/${thread_id}/run`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ message, stream_options, attachments, hot_since }),\n signal,\n });\n // 2xx = accepted (currently always 202); 409 = already running. We treat\n // every other status as a hard error so the consumer's catch fires.\n if (res.status === 202) {\n // Drain the body to free the connection — Next.js sends a small JSON\n // ack but we don't need anything from it.\n try { await res.json(); } catch { /* ignore */ }\n return { accepted: true };\n }\n let body: { code?: string; error?: string } = {};\n try { body = (await res.json()) as { code?: string; error?: string }; } catch { /* */ }\n if (res.status === 409) {\n return { accepted: false, code: body.code ?? \"run_in_flight\" };\n }\n throw new Error(`${res.status} ${body.error ?? res.statusText}`);\n}\n\n/** GET /threads/:id/run — opens an `EventSource` and yields raw `data:`\n * payloads (one JSON event per yield). Closes the source when the consumer\n * stops iterating (either via `break` after a terminal `done`/`error`, or\n * when the abort signal fires).\n *\n * EventSource handles its own reconnection on transient drops. The\n * server-side run keeps publishing into the registry across drops, so a\n * resumed connection replays buffered chunks via `subscribe()` and the\n * consumer sees the run through to its terminal event.\n *\n * `stream_options` filter flags ride as query params (`show_tools`,\n * `show_thinking`); the rest of `StreamOptions` is meaningful only on the\n * POST and is ignored here.\n */\nexport function subscribeRun(\n thread_id: string,\n signal: AbortSignal,\n stream_options?: StreamOptions,\n): AsyncGenerator<string> {\n const params = new URLSearchParams();\n const includeTools = stream_options?.filters?.include_tools;\n const includeThinking = stream_options?.filters?.include_thinking;\n if (includeTools === false) params.set(\"show_tools\", \"false\");\n if (includeThinking === false) params.set(\"show_thinking\", \"false\");\n const qs = params.toString();\n const url = `${BASE}/threads/${thread_id}/run${qs ? `?${qs}` : \"\"}`;\n\n return (async function* () {\n const queue: string[] = [];\n const waiters: Array<() => void> = [];\n let done = false;\n let streamError: Error | null = null;\n const notify = () => { while (waiters.length > 0) waiters.shift()?.(); };\n\n const es = new EventSource(url, { withCredentials: true });\n es.onmessage = (e) => {\n if (typeof e.data === \"string\") {\n queue.push(e.data);\n try {\n const parsed = JSON.parse(e.data) as { type?: string };\n if (parsed.type === \"done\" || parsed.type === \"error\") {\n done = true;\n }\n } catch { /* let consumer surface parse errors */ }\n notify();\n }\n };\n // EventSource auto-reconnects on transient network drops. We only treat\n // it as a hard error if the *first* connect attempt fails (no successful\n // 'open' ever fired) — anything after that is a recoverable drop and\n // the server's replay buffer will deliver missed chunks on reconnect.\n // EXCEPT when the browser flips readyState to CLOSED — that's the spec's\n // terminal state (e.g. the reconnect attempt got a 404 because the run\n // finished + TTL-evicted), and no further events will ever arrive. If\n // we ignored that case the consumer would hang on the waiter forever\n // and the UI activity label (\"Reconnecting…\") would never clear.\n let everOpened = false;\n es.onopen = () => {\n everOpened = true;\n if (connectTimer !== null) {\n clearTimeout(connectTimer);\n connectTimer = null;\n }\n };\n es.onerror = () => {\n if (es.readyState === EventSource.CLOSED) {\n done = true;\n notify();\n return;\n }\n if (!everOpened) {\n streamError = new Error(\"EventSource failed to open\");\n done = true;\n notify();\n }\n // else: ignore — EventSource will try to reconnect.\n };\n\n // Connect-timeout safety net: if onopen hasn't fired within 8s the\n // server is unreachable (DNS, TLS handshake stuck, proxy black-holing\n // the GET, …). EventSource alone won't surface that — it stays in\n // CONNECTING forever, retrying silently. Force the iterator to fail so\n // the caller's catch/finally can release the UI gate.\n let connectTimer: ReturnType<typeof setTimeout> | null = setTimeout(() => {\n connectTimer = null;\n if (!everOpened && !done) {\n streamError = new Error(\"EventSource connect timeout\");\n done = true;\n try { es.close(); } catch { /* */ }\n notify();\n }\n }, 8_000);\n\n const onAbort = () => {\n done = true;\n if (connectTimer !== null) {\n clearTimeout(connectTimer);\n connectTimer = null;\n }\n try { es.close(); } catch { /* */ }\n notify();\n };\n signal.addEventListener(\"abort\", onAbort, { once: true });\n\n try {\n while (!done || queue.length > 0) {\n if (queue.length > 0) {\n yield queue.shift() as string;\n continue;\n }\n if (streamError) throw streamError;\n await new Promise<void>((resolve) => waiters.push(resolve));\n }\n if (streamError) throw streamError;\n } finally {\n if (connectTimer !== null) clearTimeout(connectTimer);\n signal.removeEventListener(\"abort\", onAbort);\n try { es.close(); } catch { /* */ }\n }\n })();\n}","\"use client\";\nimport { Braces, Eye, FileText, Globe, Mic, Wrench, Zap, type LucideIcon } from \"lucide-react\";\nimport { modelCapabilities, type ModelCapabilities } from \"@/lib/providers/capabilities\";\n\ntype CapKey = keyof ModelCapabilities;\n\nconst CAP_META: Record<CapKey, { icon: LucideIcon; label: string }> = {\n vision: { icon: Eye, label: \"Vision (image input)\" },\n files: { icon: FileText, label: \"File / document input\" },\n audio: { icon: Mic, label: \"Audio / voice input\" },\n tools: { icon: Wrench, label: \"Tool calling\" },\n web_search: { icon: Globe, label: \"Built-in web search\" },\n json_mode: { icon: Braces, label: \"Structured JSON output\" },\n streaming: { icon: Zap, label: \"Streaming responses\" },\n};\n\nconst CAP_ORDER: CapKey[] = [\"vision\", \"files\", \"audio\", \"tools\", \"web_search\", \"json_mode\", \"streaming\"];\n\ninterface Props {\n caps?: ModelCapabilities;\n provider?: string;\n modelId?: string;\n size?: \"xs\" | \"sm\";\n}\n\nexport function CapBadges({ caps, provider, modelId, size = \"xs\" }: Props) {\n const resolved = caps ?? (provider && modelId ? modelCapabilities(provider, modelId) : null);\n if (!resolved) return null;\n const active = CAP_ORDER.filter((k) => resolved[k]);\n if (!active.length) return null;\n const box = size === \"sm\" ? \"w-5 h-5\" : \"w-4 h-4\";\n const icon = size === \"sm\" ? \"w-3 h-3\" : \"w-2.5 h-2.5\";\n return (\n <span className=\"inline-flex flex-wrap gap-0.5 align-middle\">\n {active.map((k) => {\n const { icon: Icon, label } = CAP_META[k];\n return (\n <span\n key={k}\n title={label}\n aria-label={label}\n className={`inline-flex items-center justify-center ${box} rounded bg-surface text-fg-subtle border border-border`}\n >\n <Icon className={icon} strokeWidth={2} aria-hidden />\n </span>\n );\n })}\n </span>\n );\n}\n","\"use client\";\nimport { createContext, useContext, useEffect, useReducer, type ReactNode } from \"react\";\n\nexport type ExperienceMode = \"essential\" | \"full\";\n\nconst EXPERIENCE_MODE_KEY = \"jarela.experience.mode\";\n\n// Back-compat: pre-rename builds stored \"normal\" / \"advanced\". Read those\n// values silently so an upgrade does not reset the user's choice.\nfunction parseStoredMode(raw: string | null): ExperienceMode | null {\n if (raw === \"essential\" || raw === \"normal\") return \"essential\";\n if (raw === \"full\" || raw === \"advanced\") return \"full\";\n return null;\n}\n\nexport type Tab = \"chat\" | \"dashboard\" | \"agents\" | \"memory\" | \"documents\" | \"models\" | \"mcp\" | \"extensions\" | \"tools\" | \"connections\" | \"tasks\" | \"bridges\" | \"profile\" | \"harness\";\n\ninterface AppState {\n activeThreadId: string | null;\n activeAgentId: string | null;\n activeTab: Tab;\n experienceMode: ExperienceMode;\n // Per-tab sub-selection (gmail in connections, an mcp server name, an\n // agent uuid, a profile subsection slug, …). Settings panels read their\n // slot to scroll-to + highlight; the URL mirrors this via `?item=<id>`.\n selectedItem: Partial<Record<Tab, string>>;\n}\n\ntype Action =\n | { type: \"SELECT_THREAD\"; threadId: string; agentId: string }\n | { type: \"NEW_CHAT\" }\n | { type: \"SET_AGENT\"; agentId: string }\n | { type: \"SET_TAB\"; tab: Tab }\n | { type: \"SET_EXPERIENCE_MODE\"; mode: ExperienceMode }\n | { type: \"SET_SELECTION\"; tab: Tab; itemId: string | null };\n\nfunction reducer(state: AppState, action: Action): AppState {\n switch (action.type) {\n case \"SELECT_THREAD\":\n return { ...state, activeThreadId: action.threadId, activeAgentId: action.agentId, activeTab: \"chat\" };\n case \"NEW_CHAT\":\n return { ...state, activeThreadId: null, activeAgentId: null, activeTab: \"chat\" };\n case \"SET_AGENT\":\n return { ...state, activeAgentId: action.agentId };\n case \"SET_TAB\":\n return { ...state, activeTab: action.tab };\n case \"SET_EXPERIENCE_MODE\":\n return { ...state, experienceMode: action.mode };\n case \"SET_SELECTION\": {\n const next = { ...state.selectedItem };\n if (action.itemId == null) delete next[action.tab];\n else next[action.tab] = action.itemId;\n return { ...state, selectedItem: next };\n }\n }\n}\n\nconst AppContext = createContext<{ state: AppState; dispatch: React.Dispatch<Action> } | null>(null);\n\nexport function AppProvider({ children }: { children: ReactNode }) {\n const [state, dispatch] = useReducer(reducer, {\n activeThreadId: null,\n activeAgentId: null,\n activeTab: \"chat\",\n experienceMode: \"essential\",\n selectedItem: {},\n });\n\n useEffect(() => {\n try {\n const stored = parseStoredMode(window.localStorage.getItem(EXPERIENCE_MODE_KEY));\n if (stored) {\n dispatch({ type: \"SET_EXPERIENCE_MODE\", mode: stored });\n }\n } catch {\n // ignore storage failures\n }\n }, []);\n\n useEffect(() => {\n try {\n window.localStorage.setItem(EXPERIENCE_MODE_KEY, state.experienceMode);\n } catch {\n // ignore storage failures\n }\n }, [state.experienceMode]);\n\n return <AppContext.Provider value={{ state, dispatch }}>{children}</AppContext.Provider>;\n}\n\nexport function useAppContext() {\n const ctx = useContext(AppContext);\n if (!ctx) throw new Error(\"useAppContext must be used within AppProvider\");\n return ctx;\n}\n","\"use client\";\n\nimport { Bot, Brain, Briefcase, CheckCircle2, Code2, Database, ExternalLink, Image as ImageIcon, Loader2, Mic, ShieldCheck, Sparkles, UserRound, Wand2, XCircle } from \"lucide-react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { api } from \"@/api/client\";\nimport type { AgentConfig, IntegrationStatus, ModelConfig, UserProfile } from \"@/api/types\";\nimport { useAppContext } from \"@/contexts/AppContext\";\nimport { getAppName } from \"@/lib/env/app-config\";\nimport { ModelFeatureGuide } from \"@/components/models/ModelFeatureGuide\";\nimport { MarkdownTextarea } from \"@/components/ui/MarkdownTextarea\";\n\ntype Provider = \"anthropic\" | \"openai\" | \"gemini\" | \"deepseek\";\n\nconst PROVIDER_INFO: Record<\n Provider,\n { label: string; signupUrl: string; placeholder: string; defaultModel: string; hint: string }\n> = {\n anthropic: {\n label: \"Anthropic (Claude)\",\n signupUrl: \"https://console.anthropic.com/settings/keys\",\n placeholder: \"sk-ant-…\",\n defaultModel: \"claude-opus-4-7\",\n hint: \"Strong writing and reasoning. Good default if you want a focused assistant.\",\n },\n openai: {\n label: \"OpenAI (GPT)\",\n signupUrl: \"https://platform.openai.com/api-keys\",\n placeholder: \"sk-…\",\n defaultModel: \"gpt-4o\",\n hint: \"Balanced general-purpose setup with broad capability coverage.\",\n },\n gemini: {\n label: \"Google (Gemini)\",\n signupUrl: \"https://aistudio.google.com/apikey\",\n placeholder: \"AIza…\",\n defaultModel: \"gemini-2.5-pro\",\n hint: \"Best fit if you want voice and Google-powered multimodal features with one key.\",\n },\n deepseek: {\n label: \"DeepSeek\",\n signupUrl: \"https://platform.deepseek.com/api_keys\",\n placeholder: \"sk-…\",\n defaultModel: \"deepseek-chat\",\n hint: \"Lean and capable text setup when you want a simpler provider choice.\",\n },\n};\n\nconst PROVIDER_SIGNALS: Record<Provider, {\n image: \"strong\" | \"partial\" | \"limited\";\n voice: \"strong\" | \"partial\" | \"limited\";\n embeddings: \"strong\" | \"partial\" | \"limited\";\n coding: \"strong\" | \"partial\" | \"limited\";\n recommendation: string;\n}> = {\n anthropic: {\n image: \"strong\",\n voice: \"limited\",\n embeddings: \"limited\",\n coding: \"strong\",\n recommendation: \"Excellent coding copilot style responses; pair with a separate embeddings path if Documents recall is critical.\",\n },\n openai: {\n image: \"strong\",\n voice: \"partial\",\n embeddings: \"strong\",\n coding: \"strong\",\n recommendation: \"Best all-round baseline when you want one provider to cover coding plus embeddings-driven workflows.\",\n },\n gemini: {\n image: \"strong\",\n voice: \"strong\",\n embeddings: \"strong\",\n coding: \"strong\",\n recommendation: \"Strong single-provider setup for multimodal + voice without splitting credentials.\",\n },\n deepseek: {\n image: \"limited\",\n voice: \"limited\",\n embeddings: \"limited\",\n coding: \"strong\",\n recommendation: \"Great text/coding value path; pair with another provider if you need richer multimodal or embeddings.\",\n },\n};\n\nfunction signalTone(level: \"strong\" | \"partial\" | \"limited\"): string {\n if (level === \"strong\") return \"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300\";\n if (level === \"partial\") return \"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300\";\n return \"border-border bg-surface-3 text-fg-faint\";\n}\n\nconst PROFILE_PRESETS: Array<{ value: NonNullable<UserProfile[\"preset\"]>; label: string; hint: string }> = [\n { value: \"home\", label: \"Home\", hint: \"Personal AI, mail, calendar, and everyday tasks\" },\n { value: \"work\", label: \"Work\", hint: \"Project coordination, docs, issues, and team workflows\" },\n { value: \"dev\", label: \"Developer\", hint: \"Coding, debugging, tools, and infrastructure-heavy usage\" },\n { value: \"custom\", label: \"Everything\", hint: \"Show the full surface without category filtering\" },\n];\n\nconst AGENT_STYLES = {\n assistant: {\n label: \"General Assistant\",\n hint: \"Balanced help across chat, research, and daily tasks\",\n icon: Sparkles,\n identity: \"You are a practical personal assistant. Be clear, concise, and helpful. Focus on getting the user unstuck quickly.\",\n instructions: \"Prefer straightforward answers, ask only necessary follow-up questions, and keep technical detail proportional to the user's request.\",\n },\n builder: {\n label: \"Builder\",\n hint: \"Best when you mostly use the app for coding and implementation\",\n icon: Wand2,\n identity: \"You are a pragmatic software builder who turns vague requests into concrete implementation steps.\",\n instructions: \"Bias toward implementation, explain tradeoffs briefly, and keep momentum high on technical tasks.\",\n },\n researcher: {\n label: \"Research Partner\",\n hint: \"Good for synthesis, comparisons, and exploration\",\n icon: Brain,\n identity: \"You are a research partner who organizes information clearly and highlights the strongest options.\",\n instructions: \"Structure findings cleanly, surface tradeoffs, and focus on decision support instead of raw data dumps.\",\n },\n operator: {\n label: \"Work Coordinator\",\n hint: \"Better for work streams, follow-ups, and operational tasks\",\n icon: Briefcase,\n identity: \"You are an operational coordinator who keeps work moving and communicates with calm clarity.\",\n instructions: \"Prioritize action items, summarize status clearly, and help the user track what matters next.\",\n },\n} as const;\n\ntype AgentStyle = keyof typeof AGENT_STYLES;\n\ninterface TestResult {\n ok: boolean;\n models?: string[];\n error?: string;\n}\n\ninterface Props {\n context: \"setup\" | \"profile\";\n}\n\nfunction supportedProvider(value: string | null | undefined): Provider {\n if (value === \"anthropic\" || value === \"openai\" || value === \"gemini\" || value === \"deepseek\") return value;\n return \"anthropic\";\n}\n\nfunction syntheticGoogleIntegration(): IntegrationStatus {\n return {\n name: \"google\",\n configured: true,\n values: {},\n updated_at: null,\n };\n}\n\nexport function OnboardingWizard({ context }: Props) {\n const { state, dispatch } = useAppContext();\n const [loading, setLoading] = useState(true);\n const [profile, setProfile] = useState<UserProfile | null>(null);\n const [models, setModels] = useState<ModelConfig[]>([]);\n const [agents, setAgents] = useState<AgentConfig[]>([]);\n const [integrations, setIntegrations] = useState<IntegrationStatus[]>([]);\n\n const [name, setName] = useState(\"\");\n const [about, setAbout] = useState(\"\");\n const [preset, setPreset] = useState<NonNullable<UserProfile[\"preset\"]>>(\"home\");\n const [provider, setProvider] = useState<Provider>(\"anthropic\");\n const [apiKey, setApiKey] = useState(\"\");\n const [modelId, setModelId] = useState(PROVIDER_INFO.anthropic.defaultModel);\n const [availableModels, setAvailableModels] = useState<string[]>([]);\n const [test, setTest] = useState<TestResult | null>(null);\n const [testing, setTesting] = useState(false);\n const [reuseGoogleKey, setReuseGoogleKey] = useState(true);\n const [useAsChatDefault, setUseAsChatDefault] = useState(true);\n const [useAsEmbeddingDefault, setUseAsEmbeddingDefault] = useState(true);\n const [useAsVoicePath, setUseAsVoicePath] = useState(true);\n const [agentName, setAgentName] = useState(\"My Assistant\");\n const [agentStyle, setAgentStyle] = useState<AgentStyle>(\"assistant\");\n const [voiceEnabled, setVoiceEnabled] = useState(false);\n const [saving, setSaving] = useState(false);\n const [saveError, setSaveError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n async function load() {\n setLoading(true);\n try {\n const [profileData, modelRows, agentRows, integrationRows] = await Promise.all([\n api.profile.get().catch(() => null),\n api.models.list().catch(() => []),\n api.agents.list().catch(() => []),\n api.integrations.list().then((res) => res.statuses).catch(() => []),\n ]);\n if (cancelled) return;\n\n const defaultModel = modelRows.find((row) => row.is_default) ?? modelRows[0] ?? null;\n const defaultAgent = agentRows.find((row) => row.is_default) ?? agentRows[0] ?? null;\n\n setProfile(profileData);\n setModels(modelRows);\n setAgents(agentRows);\n setIntegrations(integrationRows);\n\n setName(profileData?.name ?? \"\");\n setAbout(profileData?.about ?? \"\");\n setPreset((profileData?.preset as NonNullable<UserProfile[\"preset\"]> | null) ?? \"home\");\n\n const resolvedProvider = supportedProvider(defaultModel?.provider);\n setProvider(resolvedProvider);\n setApiKey(typeof defaultModel?.params.api_key === \"string\" ? defaultModel.params.api_key : \"\");\n setModelId(defaultModel?.model_id ?? PROVIDER_INFO[resolvedProvider].defaultModel);\n\n setAgentName(defaultAgent?.name ?? `${profileData?.name?.trim() || \"My\"} Assistant`);\n setVoiceEnabled(defaultAgent?.voice_enabled ?? false);\n setUseAsChatDefault(defaultModel?.is_default ?? true);\n setUseAsEmbeddingDefault(true);\n setUseAsVoicePath(defaultAgent?.voice_enabled ?? true);\n } finally {\n if (!cancelled) setLoading(false);\n }\n }\n void load();\n return () => {\n cancelled = true;\n };\n }, []);\n\n const activeModel = models.find((row) => row.is_default) ?? models[0] ?? null;\n const activeAgent = agents.find((row) => row.is_default) ?? agents[0] ?? null;\n const providerInfo = PROVIDER_INFO[provider];\n const providerSignals = PROVIDER_SIGNALS[provider];\n const effectiveIntegrations = useMemo(() => {\n if (provider === \"gemini\" && reuseGoogleKey && apiKey.trim()) {\n const hasGoogle = integrations.some((status) => status.name === \"google\" && status.configured);\n return hasGoogle ? integrations : [...integrations, syntheticGoogleIntegration()];\n }\n return integrations;\n }, [apiKey, integrations, provider, reuseGoogleKey]);\n const modelReady = !!modelId.trim() && (!!test?.ok || (activeModel != null && apiKey.trim().length > 0));\n const canSave = name.trim().length > 0 && agentName.trim().length > 0 && modelReady;\n\n function chooseProvider(next: Provider) {\n setProvider(next);\n setModelId(PROVIDER_INFO[next].defaultModel);\n setAvailableModels([]);\n setTest(null);\n setSaveError(null);\n if (next !== \"gemini\") setVoiceEnabled(false);\n }\n\n async function runTest() {\n if (!apiKey.trim()) return;\n setTesting(true);\n setTest(null);\n setSaveError(null);\n try {\n const res = await fetch(\"/api/v1/setup/test-key\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ provider, api_key: apiKey.trim() }),\n });\n const data = (await res.json()) as TestResult;\n setTest(data);\n setAvailableModels(data.models ?? []);\n if (data.ok && data.models && data.models.length > 0 && !data.models.includes(modelId)) {\n setModelId(data.models[0]);\n }\n } catch (err) {\n setTest({ ok: false, error: `network error: ${err instanceof Error ? err.message : String(err)}` });\n } finally {\n setTesting(false);\n }\n }\n\n async function handleSave() {\n if (!canSave) return;\n setSaving(true);\n setSaveError(null);\n try {\n const updatedProfile = await api.profile.update({ name: name.trim(), about: about.trim(), preset });\n setProfile(updatedProfile);\n\n const modelName = activeModel?.name ?? `${provider}-default`;\n const modelPayload = {\n provider,\n model_id: modelId.trim(),\n params: {\n ...(activeModel?.params ?? {}),\n api_key: apiKey.trim(),\n },\n is_default: useAsChatDefault || !activeModel,\n };\n const savedModel = activeModel\n ? await api.models.update(modelName, modelPayload)\n : await api.models.create(modelName, modelPayload);\n\n if (useAsEmbeddingDefault) {\n await api.documents.setSettings({ embedding_model_config: savedModel.name });\n }\n\n if (provider === \"gemini\" && reuseGoogleKey && apiKey.trim()) {\n await api.integrations.save(\"google\", { api_key: apiKey.trim() });\n }\n\n const style = AGENT_STYLES[agentStyle];\n const agentPayload = {\n name: agentName.trim(),\n identity: style.identity,\n instructions: style.instructions,\n model_config_name: savedModel.name,\n is_default: true,\n voice_enabled: provider === \"gemini\" && reuseGoogleKey && useAsVoicePath && voiceEnabled,\n voice_model: \"gemini-2.5-flash-preview-tts\",\n voice_name: \"Kore\",\n voice_stt_model: \"gemini-2.5-flash\",\n voice_auto_speak: true,\n };\n const savedAgent = activeAgent\n ? await api.agents.update(activeAgent.id, agentPayload)\n : await api.agents.create(agentPayload);\n\n if (context === \"setup\") {\n window.location.href = \"/\";\n return;\n }\n\n dispatch({ type: \"SET_AGENT\", agentId: savedAgent.id });\n dispatch({ type: \"SET_TAB\", tab: \"chat\" });\n } catch (err) {\n setSaveError(err instanceof Error ? err.message : String(err));\n } finally {\n setSaving(false);\n }\n }\n\n const fullScreen = context === \"setup\";\n\n if (loading) {\n return (\n <div className={`flex items-center justify-center ${fullScreen ? \"min-h-screen\" : \"h-full\"}`}>\n <div className=\"inline-flex items-center gap-2 text-sm text-fg-faint\">\n <Loader2 size={16} className=\"animate-spin\" /> Loading setup\n </div>\n </div>\n );\n }\n\n return (\n <main className={`${fullScreen ? \"min-h-screen bg-surface\" : \"h-full bg-surface\"} text-fg`}>\n <div className=\"mx-auto w-full max-w-6xl px-4 py-6 sm:px-6 sm:py-8\">\n <div className=\"mb-6 flex items-start gap-4\">\n {fullScreen && (\n // eslint-disable-next-line @next/next/no-img-element\n <img src=\"/logo-mark-transparent.png\" alt=\"\" className=\"mt-1 h-11 w-auto\" />\n )}\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-[11px] font-semibold uppercase tracking-[0.2em] text-fg-faint\">\n {fullScreen ? \"First launch setup\" : state.experienceMode === \"essential\" ? \"Guided setup\" : \"Profile\"}\n </p>\n <h1 className=\"mt-1 text-2xl font-semibold tracking-tight\">\n {fullScreen ? `Set up ${getAppName()} once` : \"Set up your assistant\"}\n </h1>\n <p className=\"mt-2 max-w-2xl text-sm text-fg-subtle leading-relaxed\">\n Configure your profile, choose a model, and create a first agent from one screen. As you change the model, the feature icons below light up to show what the provider and model actually ship.\n </p>\n <div className=\"mt-4 flex flex-col sm:flex-row gap-2 max-w-xl\">\n {([\"essential\", \"full\"] as const).map((mode) => (\n <button\n key={mode}\n type=\"button\"\n onClick={() => dispatch({ type: \"SET_EXPERIENCE_MODE\", mode })}\n aria-pressed={state.experienceMode === mode}\n className={`flex-1 rounded-xl border px-3 py-2.5 text-left transition-colors ${\n state.experienceMode === mode\n ? \"border-accent/60 bg-accent/15 shadow-sm\"\n : \"border-border bg-surface-2 hover:border-border-strong\"\n }`}\n >\n <div className=\"text-sm font-medium capitalize\">{mode === \"essential\" ? \"Guided\" : \"Full controls\"}</div>\n <div className=\"mt-0.5 text-[11px] text-fg-faint leading-snug\">\n {mode === \"essential\"\n ? \"Curated panels and a simpler model editor.\"\n : \"Every panel, context tuning, and engine-room toggles.\"}\n </div>\n </button>\n ))}\n </div>\n </div>\n </div>\n\n <div className=\"grid grid-cols-1 xl:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.9fr)] gap-5\">\n <div className=\"space-y-5\">\n <section className=\"rounded-2xl border border-border bg-surface-2 p-4 sm:p-5 space-y-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <span className=\"inline-flex h-8 w-8 items-center justify-center rounded-xl bg-accent/15 text-accent\">\n <UserRound size={16} />\n </span>\n <div>\n <h2 className=\"text-sm font-semibold\">1. Your profile</h2>\n <p className=\"text-[11px] text-fg-faint\">This shapes the app and tells the assistant who it is helping.</p>\n </div>\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n <label className=\"block\">\n <span className=\"text-xs text-fg-subtle mb-1 block\">Your name</span>\n <input\n className=\"w-full rounded-xl border border-border bg-surface-3 px-3 py-2 text-sm\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"Your name\"\n />\n </label>\n </div>\n\n <label className=\"block\">\n <span className=\"text-xs text-fg-subtle mb-1 block\">About you</span>\n <MarkdownTextarea\n className=\"min-h-[6rem] w-full resize-y rounded-xl border border-border bg-surface-3 px-3 py-2 text-sm\"\n value={about}\n onChange={setAbout}\n rows={4}\n placeholder=\"What should your assistant know about how you work and what you care about?\"\n />\n </label>\n\n <div>\n <span className=\"text-xs text-fg-subtle mb-2 block\">What kind of setup do you want?</span>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-2\">\n {PROFILE_PRESETS.map((option) => (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => setPreset(option.value)}\n className={`rounded-xl border px-3 py-2.5 text-left transition-colors ${\n preset === option.value\n ? \"border-accent/60 bg-accent/15 shadow-sm\"\n : \"border-border bg-surface-3\"\n }`}\n >\n <div className=\"text-xs font-medium\">{option.label}</div>\n <div className=\"mt-1 text-[10px] text-fg-faint leading-snug\">{option.hint}</div>\n </button>\n ))}\n </div>\n </div>\n </section>\n\n <section className=\"rounded-2xl border border-border bg-surface-2 p-4 sm:p-5 space-y-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <span className=\"inline-flex h-8 w-8 items-center justify-center rounded-xl bg-accent/15 text-accent\">\n <ShieldCheck size={16} />\n </span>\n <div>\n <h2 className=\"text-sm font-semibold\">2. Pick your model</h2>\n <p className=\"text-[11px] text-fg-faint\">Choose a provider, test the key, and see which features this model unlocks.</p>\n </div>\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-2\">\n {(Object.keys(PROVIDER_INFO) as Provider[]).map((option) => (\n <button\n key={option}\n type=\"button\"\n onClick={() => chooseProvider(option)}\n className={`rounded-xl border px-3 py-3 text-left transition-colors ${\n provider === option\n ? \"border-accent/60 bg-accent/15 shadow-sm\"\n : \"border-border bg-surface-3\"\n }`}\n >\n <div className=\"text-sm font-medium\">{PROVIDER_INFO[option].label}</div>\n <div className=\"mt-1 text-[11px] text-fg-faint leading-snug\">{PROVIDER_INFO[option].hint}</div>\n </button>\n ))}\n </div>\n\n <div className=\"rounded-xl border border-border bg-surface-3/70 px-3 py-3 space-y-2.5\">\n <div className=\"flex items-center justify-between gap-2\">\n <p className=\"text-xs font-semibold text-fg-muted uppercase tracking-wide\">Provider capability preview</p>\n <p className=\"text-[11px] text-fg-faint\">{PROVIDER_INFO[provider].label}</p>\n </div>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-2\">\n <div className={`rounded-lg border px-2 py-1.5 text-[11px] ${signalTone(providerSignals.image)}`}>\n <div className=\"inline-flex items-center gap-1\"><ImageIcon size={12} /> Image</div>\n </div>\n <div className={`rounded-lg border px-2 py-1.5 text-[11px] ${signalTone(providerSignals.voice)}`}>\n <div className=\"inline-flex items-center gap-1\"><Mic size={12} /> Voice</div>\n </div>\n <div className={`rounded-lg border px-2 py-1.5 text-[11px] ${signalTone(providerSignals.embeddings)}`}>\n <div className=\"inline-flex items-center gap-1\"><Database size={12} /> Embeddings</div>\n </div>\n <div className={`rounded-lg border px-2 py-1.5 text-[11px] ${signalTone(providerSignals.coding)}`}>\n <div className=\"inline-flex items-center gap-1\"><Code2 size={12} /> Coding</div>\n </div>\n </div>\n <p className=\"text-[11px] leading-snug text-fg-subtle\">\n <span className=\"font-medium text-fg\">Recommendation:</span> {providerSignals.recommendation}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_auto] gap-3 items-end\">\n <label className=\"block\">\n <div className=\"mb-1 flex items-center justify-between gap-2\">\n <span className=\"text-xs text-fg-subtle\">API key</span>\n <a\n href={providerInfo.signupUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"text-[11px] text-accent hover:text-accent-hover inline-flex items-center gap-1\"\n >\n Get key <ExternalLink size={11} />\n </a>\n </div>\n <input\n type=\"password\"\n value={apiKey}\n onChange={(e) => {\n setApiKey(e.target.value);\n setTest(null);\n }}\n placeholder={providerInfo.placeholder}\n className=\"w-full rounded-xl border border-border bg-surface-3 px-3 py-2 text-sm font-mono\"\n autoComplete=\"off\"\n spellCheck={false}\n />\n </label>\n <button\n type=\"button\"\n onClick={runTest}\n disabled={testing || !apiKey.trim()}\n className=\"inline-flex items-center justify-center gap-2 rounded-xl border border-border px-4 py-2 text-sm hover:border-fg-faint disabled:opacity-50\"\n >\n {testing ? <Loader2 size={14} className=\"animate-spin\" /> : <ShieldCheck size={14} />}\n {testing ? \"Testing\" : \"Test connection\"}\n </button>\n </div>\n\n {provider === \"gemini\" && (\n <label className=\"flex items-start gap-2 rounded-xl border border-border bg-surface-3 px-3 py-2.5\">\n <input\n type=\"checkbox\"\n className=\"mt-0.5 rounded border-border\"\n checked={reuseGoogleKey}\n onChange={(e) => setReuseGoogleKey(e.target.checked)}\n />\n <span className=\"text-[11px] leading-snug text-fg-subtle\">\n Reuse this same Gemini key for Google AI features like voice and image tools. This avoids asking you to configure a second credential for the same provider.\n </span>\n </label>\n )}\n\n <label className=\"block\">\n <span className=\"text-xs text-fg-subtle mb-1 block\">Model</span>\n {availableModels.length > 0 ? (\n <select\n value={modelId}\n onChange={(e) => setModelId(e.target.value)}\n className=\"w-full rounded-xl border border-border bg-surface-3 px-3 py-2 text-sm\"\n >\n {availableModels.map((option) => (\n <option key={option} value={option}>{option}</option>\n ))}\n </select>\n ) : (\n <input\n value={modelId}\n onChange={(e) => setModelId(e.target.value)}\n className=\"w-full rounded-xl border border-border bg-surface-3 px-3 py-2 text-sm font-mono\"\n />\n )}\n </label>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-3 gap-2\">\n <label className=\"flex items-start gap-2 rounded-xl border border-border bg-surface-3 px-3 py-2.5\">\n <input\n type=\"checkbox\"\n className=\"mt-0.5 rounded border-border\"\n checked={useAsChatDefault}\n onChange={(e) => setUseAsChatDefault(e.target.checked)}\n />\n <span className=\"text-[11px] leading-snug text-fg-subtle\">\n Default chat model\n </span>\n </label>\n <label className=\"flex items-start gap-2 rounded-xl border border-border bg-surface-3 px-3 py-2.5\">\n <input\n type=\"checkbox\"\n className=\"mt-0.5 rounded border-border\"\n checked={useAsEmbeddingDefault}\n onChange={(e) => setUseAsEmbeddingDefault(e.target.checked)}\n />\n <span className=\"text-[11px] leading-snug text-fg-subtle\">\n Default embeddings model\n </span>\n </label>\n <label className={`flex items-start gap-2 rounded-xl border px-3 py-2.5 ${provider === \"gemini\" ? \"border-border bg-surface-3\" : \"border-border/60 bg-surface-2 opacity-70\"}`}>\n <input\n type=\"checkbox\"\n className=\"mt-0.5 rounded border-border\"\n checked={useAsVoicePath}\n onChange={(e) => setUseAsVoicePath(e.target.checked)}\n disabled={provider !== \"gemini\"}\n />\n <span className=\"text-[11px] leading-snug text-fg-subtle\">\n Voice-capable path\n </span>\n </label>\n </div>\n\n {test && (\n <div className={`rounded-xl border px-3 py-2.5 text-sm flex items-start gap-2 ${\n test.ok\n ? \"border-emerald-700/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300\"\n : \"border-rose-700/40 bg-rose-500/10 text-rose-700 dark:text-rose-300\"\n }`}>\n {test.ok ? <CheckCircle2 size={16} className=\"mt-0.5 shrink-0\" /> : <XCircle size={16} className=\"mt-0.5 shrink-0\" />}\n <span>{test.ok ? `Connection validated. ${test.models?.length ?? 0} models available.` : test.error}</span>\n </div>\n )}\n </section>\n\n <section className=\"rounded-2xl border border-border bg-surface-2 p-4 sm:p-5 space-y-4 shadow-sm\">\n <div className=\"flex items-center gap-3\">\n <span className=\"inline-flex h-8 w-8 items-center justify-center rounded-xl bg-accent/15 text-accent\">\n <Bot size={16} />\n </span>\n <div>\n <h2 className=\"text-sm font-semibold\">3. Create your first agent</h2>\n <p className=\"text-[11px] text-fg-faint\">Pick a starting style. You can refine this later in the Agents panel.</p>\n </div>\n </div>\n\n <label className=\"block\">\n <span className=\"text-xs text-fg-subtle mb-1 block\">Agent name</span>\n <input\n className=\"w-full rounded-xl border border-border bg-surface-3 px-3 py-2 text-sm\"\n value={agentName}\n onChange={(e) => setAgentName(e.target.value)}\n placeholder=\"My Assistant\"\n />\n </label>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-2\">\n {(Object.entries(AGENT_STYLES) as Array<[AgentStyle, typeof AGENT_STYLES[AgentStyle]]>).map(([key, option]) => {\n const Icon = option.icon;\n return (\n <button\n key={key}\n type=\"button\"\n onClick={() => setAgentStyle(key)}\n className={`rounded-xl border px-3 py-3 text-left transition-colors ${\n agentStyle === key\n ? \"border-accent/60 bg-accent/15 shadow-sm\"\n : \"border-border bg-surface-3\"\n }`}\n >\n <div className=\"flex items-center gap-2\">\n <span className=\"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-surface text-fg-subtle border border-border\">\n <Icon size={14} />\n </span>\n <span className=\"text-sm font-medium\">{option.label}</span>\n </div>\n <div className=\"mt-2 text-[11px] text-fg-faint leading-snug\">{option.hint}</div>\n </button>\n );\n })}\n </div>\n\n <label className={`flex items-start gap-2 rounded-xl border px-3 py-2.5 ${provider === \"gemini\" && reuseGoogleKey ? \"border-border bg-surface-3\" : \"border-border/60 bg-surface-2 opacity-70\"}`}>\n <input\n type=\"checkbox\"\n className=\"mt-0.5 rounded border-border\"\n checked={voiceEnabled}\n onChange={(e) => setVoiceEnabled(e.target.checked)}\n disabled={!(provider === \"gemini\" && reuseGoogleKey)}\n />\n <span className=\"text-[11px] leading-snug text-fg-subtle\">\n Enable voice for this first agent. This lights up when your setup can reuse the Gemini key for Google AI features without extra credential steps.\n </span>\n </label>\n </section>\n </div>\n\n <div className=\"space-y-5 xl:sticky xl:top-4 self-start\">\n <ModelFeatureGuide\n provider={provider}\n modelId={modelId}\n models={models}\n integrations={effectiveIntegrations}\n title=\"Feature signals\"\n description=\"These icons update as you choose a provider and model, so you can see what ships with this setup before saving it.\"\n />\n\n <section className=\"rounded-2xl border border-border bg-surface-2 p-4 shadow-sm space-y-3\">\n <div>\n <h2 className=\"text-sm font-semibold\">Ready to continue?</h2>\n <p className=\"mt-1 text-[11px] text-fg-faint leading-snug\">\n This will save your profile, create or update the default model, and create or update your main agent.\n </p>\n </div>\n\n {saveError && (\n <div className=\"rounded-xl border border-rose-700/40 bg-rose-500/10 px-3 py-2 text-sm text-rose-700 dark:text-rose-300\">\n {saveError}\n </div>\n )}\n\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={saving || !canSave}\n className=\"w-full inline-flex items-center justify-center gap-2 rounded-xl bg-accent px-4 py-3 text-sm font-medium text-white shadow-sm transition-colors hover:bg-accent-hover disabled:opacity-50\"\n >\n {saving ? <Loader2 size={15} className=\"animate-spin\" /> : null}\n {context === \"setup\" ? \"Finish setup\" : \"Save setup and open chat\"}\n </button>\n\n <div className=\"rounded-xl border border-border bg-surface-3 px-3 py-2.5 text-[11px] text-fg-faint leading-snug\">\n Normal mode keeps this flow simple. Advanced mode is still available later if you want deeper tuning.\n </div>\n </section>\n </div>\n </div>\n </div>\n </main>\n );\n}\n","\"use client\";\n\nimport { Database, Eye, FileText, Globe, MessageSquare, Mic, Wrench } from \"lucide-react\";\nimport type { IntegrationStatus, ModelConfig } from \"@/api/types\";\nimport { CapBadges } from \"./CapBadges\";\nimport { computeFeatureReadiness } from \"@/lib/ui/feature-readiness\";\n\nfunction FeatureCard({\n title,\n description,\n enabled,\n icon: Icon,\n}: {\n title: string;\n description: string;\n enabled: boolean;\n icon: typeof MessageSquare;\n}) {\n return (\n <div className={`rounded-lg border px-3 py-2.5 transition-colors ${\n enabled\n ? \"border-emerald-500/30 bg-emerald-500/10\"\n : \"border-border bg-surface-3/70\"\n }`}>\n <div className=\"flex items-center gap-2\">\n <span className={`inline-flex h-7 w-7 items-center justify-center rounded-md border ${\n enabled\n ? \"border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300\"\n : \"border-border bg-surface text-fg-faint\"\n }`}>\n <Icon size={14} />\n </span>\n <div className=\"min-w-0\">\n <div className={`text-xs font-medium ${enabled ? \"text-fg\" : \"text-fg-subtle\"}`}>{title}</div>\n <div className={`text-[10px] uppercase tracking-wide ${enabled ? \"text-emerald-700 dark:text-emerald-300\" : \"text-fg-faint\"}`}>\n {enabled ? \"ready\" : \"not detected\"}\n </div>\n </div>\n </div>\n <p className=\"mt-2 text-[11px] leading-snug text-fg-faint\">{description}</p>\n </div>\n );\n}\n\ninterface Props {\n provider: string;\n modelId: string;\n models?: ModelConfig[];\n integrations?: IntegrationStatus[];\n title?: string;\n description?: string;\n}\n\nexport function ModelFeatureGuide({\n provider,\n modelId,\n models = [],\n integrations = [],\n title = \"What This Model Unlocks\",\n description = \"Pick a provider/model once here and the compatible app features light up based on what this installation can already use.\",\n}: Props) {\n const trimmedModelId = modelId.trim();\n if (!trimmedModelId) return null;\n\n const readiness = computeFeatureReadiness({\n models,\n integrations,\n selectedProvider: provider,\n selectedModelId: trimmedModelId,\n });\n\n if (!readiness.selectedModelCaps) return null;\n\n const featureCards = [\n {\n title: \"General chat\",\n description: \"Good baseline conversational model for agents and everyday chat.\",\n enabled: true,\n icon: MessageSquare,\n },\n {\n title: \"Images and screenshots\",\n description: \"Lets agents inspect screenshots, bridge images, and file attachments visually.\",\n enabled: readiness.selectedModelCaps.vision,\n icon: Eye,\n },\n {\n title: \"Document and file input\",\n description: \"Useful when the model needs to read uploaded files and richer document payloads.\",\n enabled: readiness.selectedModelCaps.files,\n icon: FileText,\n },\n {\n title: \"Voice and audio workflows\",\n description: readiness.hasGoogleIntegration\n ? \"Best fit for voice-oriented setups and audio-aware experiences.\"\n : \"Requires the existing Google AI integration; without it, voice would need extra setup.\",\n enabled: readiness.voiceReady,\n icon: Mic,\n },\n {\n title: \"Tool calling\",\n description: \"Lets agents use tools reliably for actions, retrieval, and automations.\",\n enabled: readiness.selectedModelCaps.tools,\n icon: Wrench,\n },\n {\n title: \"Built-in web search\",\n description: \"Provider-native web retrieval when the selected model supports it.\",\n enabled: readiness.selectedModelCaps.web_search,\n icon: Globe,\n },\n {\n title: \"Documents semantic search\",\n description: readiness.documentsReady\n ? \"Useful for embeddings-backed recall in the Documents panel.\"\n : \"Needs an embeddings-capable model already available in this installation.\",\n enabled: readiness.documentsReady,\n icon: Database,\n },\n ];\n\n return (\n <div className=\"rounded-xl border border-border bg-surface-3/60 p-3 space-y-2.5\">\n <div className=\"flex items-center justify-between gap-2\">\n <div>\n <p className=\"text-xs font-semibold text-fg-muted uppercase tracking-wide\">{title}</p>\n <p className=\"text-[11px] text-fg-faint mt-1 leading-snug\">{description}</p>\n </div>\n <CapBadges provider={provider} modelId={trimmedModelId} size=\"sm\" />\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-2\">\n {featureCards.map((feature) => (\n <FeatureCard\n key={feature.title}\n title={feature.title}\n description={feature.description}\n enabled={feature.enabled}\n icon={feature.icon}\n />\n ))}\n </div>\n </div>\n );\n}\n","// Branding knobs sourced from NEXT_PUBLIC_* env vars so forks can rebrand\n// the app without patching source. NEXT_PUBLIC_* is the right\n// channel here because Next.js inlines these at build time, which lets\n// client components read them directly (no React Context, no server\n// round-trip). Server-only modules read the same keys at runtime.\n//\n// Keep this module client-safe — no Node-only imports, no DB/FS access.\n\nconst DEFAULT_APP_NAME = \"Jarela\";\nconst DEFAULT_APP_DESCRIPTION = \"Jarela — local chat interface for LangGraph agents\";\nconst DEFAULT_ISSUE_URL = \"https://github.com/CircuitWall/jarela/issues/new\";\n\nexport function getAppName(): string {\n return process.env.NEXT_PUBLIC_APP_NAME?.trim() || DEFAULT_APP_NAME;\n}\n\nexport function getAppDescription(): string {\n return process.env.NEXT_PUBLIC_APP_DESCRIPTION?.trim() || DEFAULT_APP_DESCRIPTION;\n}\n\nexport function getAppIssueUrl(): string {\n return process.env.NEXT_PUBLIC_APP_ISSUE_URL?.trim() || DEFAULT_ISSUE_URL;\n}\n","import type { IntegrationStatus, ModelConfig } from \"@/api/types\";\nimport { modelCapabilities, type ModelCapabilities } from \"@/lib/providers/capabilities\";\n\nfunction providerLikelySupportsEmbeddings(provider: string): boolean {\n return new Set([\"openai\", \"gemini\", \"github-copilot\", \"mock\"]).has(provider.toLowerCase());\n}\n\nfunction isIntegrationConfigured(statuses: IntegrationStatus[], name: string): boolean {\n return statuses.some((status) => status.name === name && status.configured);\n}\n\nexport interface FeatureReadiness {\n selectedModelCaps: ModelCapabilities | null;\n hasGoogleIntegration: boolean;\n hasGeminiModel: boolean;\n hasEmbeddingsModel: boolean;\n voiceReady: boolean;\n documentsReady: boolean;\n}\n\nexport function computeFeatureReadiness({\n models,\n integrations,\n selectedProvider,\n selectedModelId,\n}: {\n models: ModelConfig[];\n integrations?: IntegrationStatus[];\n selectedProvider?: string;\n selectedModelId?: string;\n}): FeatureReadiness {\n const selectedModelCaps = selectedProvider && selectedModelId\n ? modelCapabilities(selectedProvider, selectedModelId)\n : null;\n\n const hasGoogleIntegration = isIntegrationConfigured(integrations ?? [], \"google\");\n const hasGeminiModel = models.some((model) => model.provider === \"gemini\") || selectedProvider === \"gemini\";\n const hasEmbeddingsModel = models.some((model) => providerLikelySupportsEmbeddings(model.provider))\n || !!selectedProvider && providerLikelySupportsEmbeddings(selectedProvider);\n\n return {\n selectedModelCaps,\n hasGoogleIntegration,\n hasGeminiModel,\n hasEmbeddingsModel,\n voiceReady: hasGoogleIntegration && hasGeminiModel,\n documentsReady: hasEmbeddingsModel,\n };\n}\n"],"names":["PATTERNS","openai","anthropic","gemini","deepseek","cohere","langchain","mock","modelSupportsImages","provider","modelId","pats","toLowerCase","some","re","test","isProviderClassified","AUDIO_PATTERNS","FILES_PATTERNS","WEB_SEARCH_PATTERNS","JSON_MODE_PROVIDERS","Set","matchesAny","map","modelCapabilities","p","noTools","vision","tools","streaming","json_mode","has","web_search","audio","files","useState","ReactMarkdown","remarkGfm","MD_REMARK_PLUGINS","MarkdownTextarea","value","onChange","className","placeholder","rows","maxLength","monospace","mode","setMode","fontClass","div","role","span","tabIndex","onClick","onKeyDown","e","key","preventDefault","trim","aria-disabled","textarea","target","style","minHeight","undefined","remarkPlugins","BASE","LIST_TTL_MS","emptyCache","data","fetchedAt","inflight","cloneRows","row","agentListCache","modelListCache","taskListCache","setAgentListCache","notify","snap","Date","now","window","dispatchEvent","CustomEvent","setModelListCache","setTaskListCache","cachedList","cache","fetchFn","setCache","force","Promise","resolve","req","then","request","path","init","res","fetch","headers","ok","text","catch","statusText","Error","status","json","api","agents","list","opts","get","id","encodeURIComponent","create","created","method","body","JSON","stringify","update","updated","a","delete","deleted","filter","getThread","compact","builtinTools","setEnabled","category","enabled","extensions","getToolSecrets","name","saveToolSecrets","values","threads","limit","offset","agent_id","title","thread_id","URLSearchParams","set","String","before","after","qs","toString","abortRun","setContextPin","hot_since","memory","namespace","search","models","providers","catalog","m","t","model_config_name","profile","setLocationConsent","consent","updateLocation","clearLocation","access","add","identity","display_name","remove","tasks","assign","tool_policy","assigned","exists","next","unassign","dashboard","metrics","days","refreshPricing","ttlDays","Number","isFinite","suffix","currency","lat","lng","mcp","registry","params","q","cursor","fresh","integrations","save","gmailOauthStart","creds","gmailOauthStatus","state","outlookOauthStart","outlookOauthStatus","envSync","preview","apply","allowlist","integration","field","envVars","pending","approve","extras","deny","scheduledTasks","patch","cancel","runNow","watchers","listReactionScripts","documents","listSources","createSource","updateSource","deleteSource","reindex","source_id","getSettings","setSettings","fs","browse","githubCopilotAuth","start","poll","device_code","signOut","bridges","pair","chats","lookup","phone","routes","bridge_id","route_id","tailscale","harnesses","setDefault","proxy","input","clear","submitRun","message","signal","stream_options","attachments","accepted","code","error","subscribeRun","includeTools","filters","include_tools","includeThinking","include_thinking","url","queue","waiters","done","streamError","length","shift","es","EventSource","withCredentials","onmessage","push","parsed","parse","type","everOpened","onopen","connectTimer","clearTimeout","onerror","readyState","CLOSED","setTimeout","close","onAbort","addEventListener","once","removeEventListener","Braces","Eye","FileText","Globe","Mic","Wrench","Zap","CAP_META","icon","label","CAP_ORDER","CapBadges","caps","size","resolved","active","k","box","Icon","aria-label","strokeWidth","aria-hidden","createContext","useContext","useEffect","useReducer","EXPERIENCE_MODE_KEY","parseStoredMode","raw","reducer","action","activeThreadId","threadId","activeAgentId","agentId","activeTab","tab","experienceMode","selectedItem","itemId","AppContext","AppProvider","children","dispatch","stored","localStorage","getItem","setItem","Provider","useAppContext","ctx","Bot","Brain","Briefcase","CheckCircle2","Code2","Database","ExternalLink","Image","ImageIcon","Loader2","ShieldCheck","Sparkles","UserRound","Wand2","XCircle","useMemo","getAppName","ModelFeatureGuide","PROVIDER_INFO","signupUrl","defaultModel","hint","PROVIDER_SIGNALS","image","voice","embeddings","coding","recommendation","signalTone","level","PROFILE_PRESETS","AGENT_STYLES","assistant","instructions","builder","researcher","operator","supportedProvider","syntheticGoogleIntegration","configured","updated_at","OnboardingWizard","context","loading","setLoading","setProfile","setModels","setAgents","setIntegrations","setName","about","setAbout","preset","setPreset","setProvider","apiKey","setApiKey","setModelId","availableModels","setAvailableModels","setTest","testing","setTesting","reuseGoogleKey","setReuseGoogleKey","useAsChatDefault","setUseAsChatDefault","useAsEmbeddingDefault","setUseAsEmbeddingDefault","useAsVoicePath","setUseAsVoicePath","agentName","setAgentName","agentStyle","setAgentStyle","voiceEnabled","setVoiceEnabled","saving","setSaving","saveError","setSaveError","cancelled","load","profileData","modelRows","agentRows","integrationRows","all","statuses","find","is_default","defaultAgent","resolvedProvider","api_key","model_id","voice_enabled","activeModel","activeAgent","providerInfo","providerSignals","effectiveIntegrations","hasGoogle","modelReady","canSave","chooseProvider","runTest","includes","err","handleSave","updatedProfile","modelName","modelPayload","savedModel","embedding_model_config","agentPayload","voice_model","voice_name","voice_stt_model","voice_auto_speak","savedAgent","location","href","fullScreen","main","img","src","alt","h1","button","aria-pressed","section","h2","option","Object","keys","rel","autoComplete","spellCheck","disabled","checked","select","entries","description","MessageSquare","computeFeatureReadiness","FeatureCard","trimmedModelId","readiness","selectedProvider","selectedModelId","selectedModelCaps","featureCards","hasGoogleIntegration","voiceReady","documentsReady","feature","DEFAULT_APP_NAME","DEFAULT_APP_DESCRIPTION","DEFAULT_ISSUE_URL","process","env","NEXT_PUBLIC_APP_NAME","getAppDescription","NEXT_PUBLIC_APP_DESCRIPTION","getAppIssueUrl","NEXT_PUBLIC_APP_ISSUE_URL","providerLikelySupportsEmbeddings","isIntegrationConfigured","hasGeminiModel","model","hasEmbeddingsModel"],"sourceRoot":"","ignoreList":[]}
|