clawpad 0.4.14 → 0.4.15
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 +7 -7
- 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 +2 -2
- 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 +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/api/ai/write/route.js +2 -2
- package/.next/standalone/.next/server/app/api/ai/write/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/record/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/revert/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/run/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/chat/abort/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/pages/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/recent/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/search/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/spaces/[space]/pages/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/spaces/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/watch/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/config/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/detect/route.js +2 -2
- package/.next/standalone/.next/server/app/api/gateway/detect/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/events/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/features/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/history/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/resolve/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/sessions/route.js +1 -2
- package/.next/standalone/.next/server/app/api/gateway/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/gateway/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/status/route.js +2 -2
- package/.next/standalone/.next/server/app/api/gateway/status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/openclaw/commands/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/settings/search-status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/bootstrap/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/bootstrap-workspace/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/trigger-onboarding/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/connection/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/connection.html +1 -1
- package/.next/standalone/.next/server/app/settings/connection.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/settings/connection/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/settings/connection.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/relay/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/relay.html +1 -1
- package/.next/standalone/.next/server/app/settings/relay.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/settings/relay/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/settings/relay.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +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 +1 -1
- package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
- 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/waitlist/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/waitlist.html +1 -1
- package/.next/standalone/.next/server/app/waitlist.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/waitlist/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/waitlist.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspace/search/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspace/search.html +2 -2
- package/.next/standalone/.next/server/app/workspace/search.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/workspace/search/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/workspace/search.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/workspace.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.html +2 -2
- package/.next/standalone/.next/server/app/workspace.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/workspace.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +7 -7
- package/.next/standalone/.next/server/chunks/1210.js +2 -2
- package/.next/standalone/.next/server/chunks/8353.js +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/package.json +1 -1
- package/bin/clawpad.js +6 -0
- package/package.json +1 -1
- /package/.next/static/{1E6zfk_m1pZXKb_d0xUT- → Wa475fYq7y8N9jedn5ZlJ}/_buildManifest.js +0 -0
- /package/.next/static/{1E6zfk_m1pZXKb_d0xUT- → Wa475fYq7y8N9jedn5ZlJ}/_ssgManifest.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--1E6zfk_m1pZXKb_d0xUT_--><html lang="en" class="__variable_245d8d __variable_97c177"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/27834908180db20f-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/78fec81b34c4a365.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/a6a6c7db5d43079b.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/b5d2bd8e17641061.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-bae8b6e8f6434041.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-a1f34f01f7efbb58.js" async=""></script><script src="/_next/static/chunks/330-60f33582af3e15a5.js" async=""></script><script src="/_next/static/chunks/7300-9984bd6aa378227a.js" async=""></script><script src="/_next/static/chunks/6609-078a8cdc853f87c6.js" async=""></script><script src="/_next/static/chunks/8935-b62f5c8bf50ff5e8.js" async=""></script><script src="/_next/static/chunks/112-8da50d6fab374e89.js" async=""></script><script src="/_next/static/chunks/1178-f2f0bd687a63b9f8.js" async=""></script><script src="/_next/static/chunks/app/layout-6fad2f96726e757a.js" async=""></script><script src="/_next/static/chunks/ba12c10f-cb1126b897816a0f.js" async=""></script><script src="/_next/static/chunks/4559-722e02df6a03e69f.js" async=""></script><script src="/_next/static/chunks/5403-0bffd8f59627ffd1.js" async=""></script><script src="/_next/static/chunks/9352-dcb425f6cf5347f4.js" async=""></script><script src="/_next/static/chunks/1285-5a2da086334493ab.js" async=""></script><script src="/_next/static/chunks/8550-1006bc90e28110d2.js" async=""></script><script src="/_next/static/chunks/9075-6844b0538e143748.js" async=""></script><script src="/_next/static/chunks/7230-ae3fcfca93b2ad80.js" async=""></script><script src="/_next/static/chunks/app/workspace/layout-10e6e52da47d81e4.js" async=""></script><script src="/_next/static/chunks/app/workspace/page-e1500b07743ca666.js" async=""></script><meta name="next-size-adjust" content=""/><title>ClawPad</title><meta name="description" content="The workspace for OpenClaw"/><link rel="icon" href="/favicon.ico?50c20623341a5f1c" type="image/x-icon" sizes="256x256"/><link rel="icon" href="/favicon.ico"/><link rel="icon" href="/favicon.png" type="image/png"/><link rel="apple-touch-icon" href="/brand/apple-touch-icon.png"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="flex h-screen overflow-hidden"><div class="relative flex h-full shrink-0 flex-col border-r bg-sidebar" style="width:240px;min-width:208px;max-width:35vw"><div class="flex h-12 shrink-0 items-center justify-between px-3"><a class="flex items-center gap-2 text-[13px] font-semibold leading-none transition-colors hover:text-foreground/80" href="/workspace"><span class="inline-flex items-center -translate-y-[2px]"><img alt="ClawPad" loading="lazy" width="127" height="26" decoding="async" data-nimg="1" class="block" style="color:transparent" srcSet="/_next/image?url=%2Fbrand%2Flogo.png&w=128&q=75 1x, /_next/image?url=%2Fbrand%2Flogo.png&w=256&q=75 2x" src="/_next/image?url=%2Fbrand%2Flogo.png&w=256&q=75"/></span><span class="relative flex h-2.5 w-2.5" data-state="closed" data-slot="tooltip-trigger"><span class="relative inline-flex h-2.5 w-2.5 rounded-full ring-1 ring-[color:var(--cp-brand-border)] bg-zinc-400"></span></span></a><button data-slot="tooltip-trigger" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent dark:hover:bg-accent/50 size-9 h-7 w-7 text-muted-foreground hover:text-foreground" data-state="closed"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close h-4 w-4" aria-hidden="true"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button></div><div class="flex-1 min-h-0 min-w-0 overflow-hidden"><div class="flex h-full w-full flex-col overflow-hidden"><div class="shrink-0 space-y-0.5 px-2"><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search h-4 w-4" aria-hidden="true"><path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle></svg></span><span class="flex-1 min-w-0 truncate text-left">Search</span><kbd class="shrink-0 rounded border border-border/70 bg-muted/70 px-1.5 py-0.5 text-[11px] font-mono font-medium leading-none tracking-tight text-muted-foreground/85">⌘K</kbd></button><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus h-4 w-4" aria-hidden="true"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg></span><span class="flex-1 min-w-0 truncate text-left">New Document</span><kbd class="shrink-0 rounded border border-border/70 bg-muted/70 px-1.5 py-0.5 text-[11px] font-mono font-medium leading-none tracking-tight text-muted-foreground/85">⌘N</kbd></button><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-plus h-4 w-4" aria-hidden="true"><path d="M12 10v6"></path><path d="M9 13h6"></path><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"></path></svg></span><span class="flex-1 min-w-0 truncate text-left">New Space</span></button></div><div data-orientation="horizontal" role="none" data-slot="separator" class="bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-2 shrink-0"></div><div dir="ltr" data-slot="scroll-area" class="relative min-h-0 flex-1 w-full min-w-0 px-2" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" data-slot="scroll-area-viewport" class="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&>div]:!block [&>div]:!min-w-0" style="overflow-x:hidden;overflow-y:hidden"><div style="min-width:100%;display:table"><div class="w-full py-1"><h3 class="mb-1 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">Spaces</h3><p class="px-2 py-2 text-xs text-muted-foreground">No spaces yet</p></div></div></div></div><div data-orientation="horizontal" role="none" data-slot="separator" class="bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px shrink-0"></div><div class="shrink-0 space-y-0.5 px-2 py-2"><div class="flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px]"><span class="relative flex h-2 w-2"><span class="relative inline-flex h-2 w-2 rounded-full bg-red-400"></span></span><span class="flex-1 text-[11px] text-muted-foreground">Disconnected</span><button class="text-[10px] text-blue-500 hover:text-blue-400 transition-colors">Retry</button></div><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun hidden h-4 w-4 dark:inline" aria-hidden="true"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2"></path><path d="M12 20v2"></path><path d="m4.93 4.93 1.41 1.41"></path><path d="m17.66 17.66 1.41 1.41"></path><path d="M2 12h2"></path><path d="M20 12h2"></path><path d="m6.34 17.66-1.41 1.41"></path><path d="m19.07 4.93-1.41 1.41"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon inline h-4 w-4 dark:hidden" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"></path></svg></span><span class="flex-1 min-w-0 truncate text-left"><span class="hidden dark:inline">Light Mode</span><span class="inline dark:hidden">Dark Mode</span></span></button><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings h-4 w-4" aria-hidden="true"><path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"></path><circle cx="12" cy="12" r="3"></circle></svg></span><span class="flex-1 min-w-0 truncate text-left">Settings</span></button></div></div></div><div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" class="absolute right-0 top-0 z-20 h-full w-2 cursor-col-resize group"><div class="absolute inset-y-0 right-0 w-px bg-border/70 transition-colors group-hover:bg-[color:var(--cp-brand-2)]"></div></div></div><main class="workspace-scroll-area relative z-0 flex-1 overflow-y-auto"><!--$--><div class="flex h-full items-center justify-center text-sm text-muted-foreground">Loading workspace...</div><!--$--><!--/$--><!--/$--></main><!--$?--><template id="B:0"></template><div class="flex h-full w-full flex-col p-4 gap-4"><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-8 w-32"></div><div class="flex-1 space-y-3"><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-16 w-3/4 ml-auto"></div><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-24 w-4/5"></div><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-16 w-2/3 ml-auto"></div></div><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-12 w-full"></div></div><!--/$--></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script>requestAnimationFrame(function(){$RT=performance.now()});</script><script src="/_next/static/chunks/webpack-bae8b6e8f6434041.js" id="_R_" async=""></script><div hidden id="S:0"><div class="relative flex flex-col bg-background h-full shrink-0 border-l" style="width:600px;min-width:400px;max-width:40vw"><div role="separator" aria-orientation="vertical" aria-label="Resize chat panel" class="absolute left-0 top-0 z-20 h-full w-2 cursor-col-resize group"><div class="absolute inset-y-0 left-0 w-px bg-border/70 transition-colors group-hover:bg-[color:var(--cp-brand-2)]"></div></div><div class="flex shrink-0 items-center justify-between border-b px-4 h-12"><div class="flex items-center gap-2.5"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles h-4 w-4 shrink-0 text-[color:var(--cp-brand-2)]" aria-hidden="true"><path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"></path><path d="M20 2v4"></path><path d="M22 4h-4"></path><circle cx="4" cy="20" r="2"></circle></svg><span class="text-sm font-medium">Chat</span><span class="relative flex h-2 w-2" title="disconnected"><span class="relative inline-flex h-2 w-2 rounded-full bg-zinc-300 dark:bg-zinc-600"></span></span></div><div class="flex items-center gap-1"><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent dark:hover:bg-accent/50 size-9 h-8 w-8 text-muted-foreground hover:text-foreground" title="Show details" aria-pressed="false" aria-label="Show details"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye h-4 w-4" aria-hidden="true"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg></button><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent dark:hover:bg-accent/50 size-9 h-8 w-8 text-muted-foreground hover:text-foreground" title="New chat"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-plus h-4 w-4" aria-hidden="true"><path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"></path><path d="M12 8v6"></path><path d="M9 11h6"></path></svg></button></div></div><div class="border-b border-amber-500/30 bg-amber-500/10 px-4 py-2 text-xs text-amber-700 dark:text-amber-300">OpenClaw gateway is unavailable. Start or restart the gateway to resume chat.</div><div class="flex-1 min-h-0 min-w-0 overflow-y-auto"><div class="relative flex min-h-full flex-col gap-4 p-4 pb-[calc(8rem+env(safe-area-inset-bottom,0px))] min-w-0 overflow-hidden"><div class="flex items-center justify-center gap-2 py-8 text-muted-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader-circle h-3.5 w-3.5 animate-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-6.219-8.56"></path></svg><span class="text-xs">Loading history…</span></div></div></div><div class="shrink-0 border-t p-4"><form class="w-full"><input type="file" accept="image/png,image/jpeg,image/gif,image/webp" multiple="" class="hidden"/><div class="relative flex w-full flex-col gap-2 rounded-2xl border bg-muted/30 px-4 py-3 shadow-[0_2px_5px_rgba(0,0,0,0.04)] transition-shadow duration-150 focus-within:shadow-[0_8px_14px_rgba(0,0,0,0.08)]"><textarea placeholder="Ask your agent…" rows="2" class="w-full resize-none bg-transparent px-1 py-1 text-sm leading-relaxed placeholder:text-muted-foreground/80 focus:outline-none focus:ring-0 min-h-[44px] max-h-[150px]"></textarea><div class="flex items-center justify-between"><div class="flex items-center gap-2"><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:hover:bg-accent/50 size-9 h-8 w-8 rounded-full text-muted-foreground/70 hover:text-foreground hover:bg-muted/60" type="button" title="Attach image" aria-label="Attach image" disabled=""><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus h-4 w-4" aria-hidden="true"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg></button></div><button data-slot="button" data-variant="default" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-9 h-9 w-9 rounded-full bg-white text-black shadow-sm hover:bg-white/90" type="submit" aria-label="Send message" disabled=""><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up h-4 w-4" aria-hidden="true"><path d="m5 12 7-7 7 7"></path><path d="M12 19V5"></path></svg></button></div></div></form></div></div></div><script>$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
|
|
2
|
-
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};$RC("B:0","S:0")</script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[37279,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"112\",\"static/chunks/112-8da50d6fab374e89.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"7177\",\"static/chunks/app/layout-6fad2f96726e757a.js\"],\"Providers\"]\n3:I[57121,[],\"\"]\n4:I[74581,[],\"\"]\n5:I[25044,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"112\",\"static/chunks/112-8da50d6fab374e89.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"7177\",\"static/chunks/app/layout-6fad2f96726e757a.js\"],\"Toaster\"]\n6:I[78616,[],\"ClientSegmentRoot\"]\n7:I[24733,[\"8803\",\"static/chunks/ba12c10f-cb1126b897816a0f.js\",\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"4559\",\"static/chunks/4559-722e02df6a03e69f.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"5403\",\"static/chunks/5403-0bffd8f59627ffd1.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"9352\",\"static/chunks/9352-dcb425f6cf5347f4.js\",\"1285\",\"static/chunks/1285-5a2da086334493ab.js\",\"8550\",\"static/chunks/8550-1006bc90e28110d2.js\",\"9075\",\"static/chunks/9075-6844b0538e143748.js\",\"7230\",\"static/chunks/7230-ae3fcfca93b2ad80.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"1807\",\"static/chunks/app/workspace/layout-10e6e52da47d81e4.js\"],\"default\"]\n9:I[61304,[],\"ClientPageRoot\"]\na:I[59176,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"5403\",\"static/chunks/5403-0bffd8f59627ffd1.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"6364\",\"static/chunks/app/workspace/page-e1500b07743ca666.js\"],\"default\"]\nd:I[90484,[],\"OutletBoundary\"]\ne:\"$Sreact.suspense\"\n10:I[90484,[],\"ViewportBoundary\"]\n12:I[90484,[],\"MetadataBoundary\"]\n14:I[27123,[],\"\"]\n:HL[\"/_next/static/media/27834908180db20f-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/78fec81b34c4a365.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/a6a6c7db5d43079b.css\",\"style\"]\n:HL[\"/_next/static/css/b5d2bd8e17641061.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--Wa475fYq7y8N9jedn5ZlJ--><html lang="en" class="__variable_245d8d __variable_97c177"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/27834908180db20f-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/78fec81b34c4a365.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/a6a6c7db5d43079b.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/b5d2bd8e17641061.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-bae8b6e8f6434041.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-a1f34f01f7efbb58.js" async=""></script><script src="/_next/static/chunks/330-60f33582af3e15a5.js" async=""></script><script src="/_next/static/chunks/7300-9984bd6aa378227a.js" async=""></script><script src="/_next/static/chunks/6609-078a8cdc853f87c6.js" async=""></script><script src="/_next/static/chunks/8935-b62f5c8bf50ff5e8.js" async=""></script><script src="/_next/static/chunks/112-8da50d6fab374e89.js" async=""></script><script src="/_next/static/chunks/1178-f2f0bd687a63b9f8.js" async=""></script><script src="/_next/static/chunks/app/layout-6fad2f96726e757a.js" async=""></script><script src="/_next/static/chunks/ba12c10f-cb1126b897816a0f.js" async=""></script><script src="/_next/static/chunks/4559-722e02df6a03e69f.js" async=""></script><script src="/_next/static/chunks/5403-0bffd8f59627ffd1.js" async=""></script><script src="/_next/static/chunks/9352-dcb425f6cf5347f4.js" async=""></script><script src="/_next/static/chunks/1285-5a2da086334493ab.js" async=""></script><script src="/_next/static/chunks/8550-1006bc90e28110d2.js" async=""></script><script src="/_next/static/chunks/9075-6844b0538e143748.js" async=""></script><script src="/_next/static/chunks/7230-ae3fcfca93b2ad80.js" async=""></script><script src="/_next/static/chunks/app/workspace/layout-10e6e52da47d81e4.js" async=""></script><script src="/_next/static/chunks/app/workspace/page-e1500b07743ca666.js" async=""></script><meta name="next-size-adjust" content=""/><title>ClawPad</title><meta name="description" content="The workspace for OpenClaw"/><link rel="icon" href="/favicon.ico?50c20623341a5f1c" type="image/x-icon" sizes="256x256"/><link rel="icon" href="/favicon.ico"/><link rel="icon" href="/favicon.png" type="image/png"/><link rel="apple-touch-icon" href="/brand/apple-touch-icon.png"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="flex h-screen overflow-hidden"><div class="relative flex h-full shrink-0 flex-col border-r bg-sidebar" style="width:240px;min-width:208px;max-width:35vw"><div class="flex h-12 shrink-0 items-center justify-between px-3"><a class="flex items-center gap-2 text-[13px] font-semibold leading-none transition-colors hover:text-foreground/80" href="/workspace"><span class="inline-flex items-center -translate-y-[2px]"><img alt="ClawPad" loading="lazy" width="127" height="26" decoding="async" data-nimg="1" class="block" style="color:transparent" srcSet="/_next/image?url=%2Fbrand%2Flogo.png&w=128&q=75 1x, /_next/image?url=%2Fbrand%2Flogo.png&w=256&q=75 2x" src="/_next/image?url=%2Fbrand%2Flogo.png&w=256&q=75"/></span><span class="relative flex h-2.5 w-2.5" data-state="closed" data-slot="tooltip-trigger"><span class="relative inline-flex h-2.5 w-2.5 rounded-full ring-1 ring-[color:var(--cp-brand-border)] bg-zinc-400"></span></span></a><button data-slot="tooltip-trigger" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent dark:hover:bg-accent/50 size-9 h-7 w-7 text-muted-foreground hover:text-foreground" data-state="closed"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close h-4 w-4" aria-hidden="true"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button></div><div class="flex-1 min-h-0 min-w-0 overflow-hidden"><div class="flex h-full w-full flex-col overflow-hidden"><div class="shrink-0 space-y-0.5 px-2"><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search h-4 w-4" aria-hidden="true"><path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle></svg></span><span class="flex-1 min-w-0 truncate text-left">Search</span><kbd class="shrink-0 rounded border border-border/70 bg-muted/70 px-1.5 py-0.5 text-[11px] font-mono font-medium leading-none tracking-tight text-muted-foreground/85">⌘K</kbd></button><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus h-4 w-4" aria-hidden="true"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg></span><span class="flex-1 min-w-0 truncate text-left">New Document</span><kbd class="shrink-0 rounded border border-border/70 bg-muted/70 px-1.5 py-0.5 text-[11px] font-mono font-medium leading-none tracking-tight text-muted-foreground/85">⌘N</kbd></button><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-plus h-4 w-4" aria-hidden="true"><path d="M12 10v6"></path><path d="M9 13h6"></path><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"></path></svg></span><span class="flex-1 min-w-0 truncate text-left">New Space</span></button></div><div data-orientation="horizontal" role="none" data-slot="separator" class="bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-2 shrink-0"></div><div dir="ltr" data-slot="scroll-area" class="relative min-h-0 flex-1 w-full min-w-0 px-2" style="position:relative;--radix-scroll-area-corner-width:0px;--radix-scroll-area-corner-height:0px"><style>[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}</style><div data-radix-scroll-area-viewport="" data-slot="scroll-area-viewport" class="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&>div]:!block [&>div]:!min-w-0" style="overflow-x:hidden;overflow-y:hidden"><div style="min-width:100%;display:table"><div class="w-full py-1"><h3 class="mb-1 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">Spaces</h3><p class="px-2 py-2 text-xs text-muted-foreground">No spaces yet</p></div></div></div></div><div data-orientation="horizontal" role="none" data-slot="separator" class="bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px shrink-0"></div><div class="shrink-0 space-y-0.5 px-2 py-2"><div class="flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px]"><span class="relative flex h-2 w-2"><span class="relative inline-flex h-2 w-2 rounded-full bg-red-400"></span></span><span class="flex-1 text-[11px] text-muted-foreground">Disconnected</span><button class="text-[10px] text-blue-500 hover:text-blue-400 transition-colors">Retry</button></div><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun hidden h-4 w-4 dark:inline" aria-hidden="true"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2"></path><path d="M12 20v2"></path><path d="m4.93 4.93 1.41 1.41"></path><path d="m17.66 17.66 1.41 1.41"></path><path d="M2 12h2"></path><path d="M20 12h2"></path><path d="m6.34 17.66-1.41 1.41"></path><path d="m19.07 4.93-1.41 1.41"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon inline h-4 w-4 dark:hidden" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"></path></svg></span><span class="flex-1 min-w-0 truncate text-left"><span class="hidden dark:inline">Light Mode</span><span class="inline dark:hidden">Dark Mode</span></span></button><button type="button" class="relative z-[1] flex w-full min-w-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-200 pointer-events-auto text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-foreground py-1.5"><span class="shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings h-4 w-4" aria-hidden="true"><path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"></path><circle cx="12" cy="12" r="3"></circle></svg></span><span class="flex-1 min-w-0 truncate text-left">Settings</span></button></div></div></div><div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" class="absolute right-0 top-0 z-20 h-full w-2 cursor-col-resize group"><div class="absolute inset-y-0 right-0 w-px bg-border/70 transition-colors group-hover:bg-[color:var(--cp-brand-2)]"></div></div></div><main class="workspace-scroll-area relative z-0 flex-1 overflow-y-auto"><!--$--><div class="flex h-full items-center justify-center text-sm text-muted-foreground">Loading workspace...</div><!--$--><!--/$--><!--/$--></main><!--$?--><template id="B:0"></template><div class="flex h-full w-full flex-col p-4 gap-4"><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-8 w-32"></div><div class="flex-1 space-y-3"><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-16 w-3/4 ml-auto"></div><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-24 w-4/5"></div><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-16 w-2/3 ml-auto"></div></div><div data-slot="skeleton" class="bg-accent animate-pulse rounded-md h-12 w-full"></div></div><!--/$--></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script>requestAnimationFrame(function(){$RT=performance.now()});</script><script src="/_next/static/chunks/webpack-bae8b6e8f6434041.js" id="_R_" async=""></script><div hidden id="S:0"><div class="relative flex flex-col bg-background h-full shrink-0 border-l" style="width:600px;min-width:400px;max-width:40vw"><div role="separator" aria-orientation="vertical" aria-label="Resize chat panel" class="absolute left-0 top-0 z-20 h-full w-2 cursor-col-resize group"><div class="absolute inset-y-0 left-0 w-px bg-border/70 transition-colors group-hover:bg-[color:var(--cp-brand-2)]"></div></div><div class="flex shrink-0 items-center justify-between border-b px-4 h-12"><div class="flex items-center gap-2.5"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles h-4 w-4 shrink-0 text-[color:var(--cp-brand-2)]" aria-hidden="true"><path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"></path><path d="M20 2v4"></path><path d="M22 4h-4"></path><circle cx="4" cy="20" r="2"></circle></svg><span class="text-sm font-medium">Chat</span><span class="relative flex h-2 w-2" title="disconnected"><span class="relative inline-flex h-2 w-2 rounded-full bg-zinc-300 dark:bg-zinc-600"></span></span></div><div class="flex items-center gap-1"><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent dark:hover:bg-accent/50 size-9 h-8 w-8 text-muted-foreground hover:text-foreground" title="Show details" aria-pressed="false" aria-label="Show details"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye h-4 w-4" aria-hidden="true"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg></button><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent dark:hover:bg-accent/50 size-9 h-8 w-8 text-muted-foreground hover:text-foreground" title="New chat"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-plus h-4 w-4" aria-hidden="true"><path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"></path><path d="M12 8v6"></path><path d="M9 11h6"></path></svg></button></div></div><div class="border-b border-amber-500/30 bg-amber-500/10 px-4 py-2 text-xs text-amber-700 dark:text-amber-300">OpenClaw gateway is unavailable. Start or restart the gateway to resume chat.</div><div class="flex-1 min-h-0 min-w-0 overflow-y-auto"><div class="relative flex min-h-full flex-col gap-4 p-4 pb-[calc(8rem+env(safe-area-inset-bottom,0px))] min-w-0 overflow-hidden"><div class="flex items-center justify-center gap-2 py-8 text-muted-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader-circle h-3.5 w-3.5 animate-spin" aria-hidden="true"><path d="M21 12a9 9 0 1 1-6.219-8.56"></path></svg><span class="text-xs">Loading history…</span></div></div></div><div class="shrink-0 border-t p-4"><form class="w-full"><input type="file" accept="image/png,image/jpeg,image/gif,image/webp" multiple="" class="hidden"/><div class="relative flex w-full flex-col gap-2 rounded-2xl border bg-muted/30 px-4 py-3 shadow-[0_2px_5px_rgba(0,0,0,0.04)] transition-shadow duration-150 focus-within:shadow-[0_8px_14px_rgba(0,0,0,0.08)]"><textarea placeholder="Ask your agent…" rows="2" class="w-full resize-none bg-transparent px-1 py-1 text-sm leading-relaxed placeholder:text-muted-foreground/80 focus:outline-none focus:ring-0 min-h-[44px] max-h-[150px]"></textarea><div class="flex items-center justify-between"><div class="flex items-center gap-2"><button data-slot="button" data-variant="ghost" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:hover:bg-accent/50 size-9 h-8 w-8 rounded-full text-muted-foreground/70 hover:text-foreground hover:bg-muted/60" type="button" title="Attach image" aria-label="Attach image" disabled=""><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus h-4 w-4" aria-hidden="true"><path d="M5 12h14"></path><path d="M12 5v14"></path></svg></button></div><button data-slot="button" data-variant="default" data-size="icon" class="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-9 h-9 w-9 rounded-full bg-white text-black shadow-sm hover:bg-white/90" type="submit" aria-label="Send message" disabled=""><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up h-4 w-4" aria-hidden="true"><path d="m5 12 7-7 7 7"></path><path d="M12 19V5"></path></svg></button></div></div></form></div></div></div><script>$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d||"/&"===d)if(0===h)break;else h--;else"$"!==d&&"$?"!==d&&"$~"!==d&&"$!"!==d&&"&"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data="$";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};
|
|
2
|
+
$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data="$~",$RB.push(a,b),2===$RB.length&&("number"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};$RC("B:0","S:0")</script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[37279,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"112\",\"static/chunks/112-8da50d6fab374e89.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"7177\",\"static/chunks/app/layout-6fad2f96726e757a.js\"],\"Providers\"]\n3:I[57121,[],\"\"]\n4:I[74581,[],\"\"]\n5:I[25044,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"112\",\"static/chunks/112-8da50d6fab374e89.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"7177\",\"static/chunks/app/layout-6fad2f96726e757a.js\"],\"Toaster\"]\n6:I[78616,[],\"ClientSegmentRoot\"]\n7:I[24733,[\"8803\",\"static/chunks/ba12c10f-cb1126b897816a0f.js\",\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"4559\",\"static/chunks/4559-722e02df6a03e69f.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"5403\",\"static/chunks/5403-0bffd8f59627ffd1.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"9352\",\"static/chunks/9352-dcb425f6cf5347f4.js\",\"1285\",\"static/chunks/1285-5a2da086334493ab.js\",\"8550\",\"static/chunks/8550-1006bc90e28110d2.js\",\"9075\",\"static/chunks/9075-6844b0538e143748.js\",\"7230\",\"static/chunks/7230-ae3fcfca93b2ad80.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"1807\",\"static/chunks/app/workspace/layout-10e6e52da47d81e4.js\"],\"default\"]\n9:I[61304,[],\"ClientPageRoot\"]\na:I[59176,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"5403\",\"static/chunks/5403-0bffd8f59627ffd1.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"6364\",\"static/chunks/app/workspace/page-e1500b07743ca666.js\"],\"default\"]\nd:I[90484,[],\"OutletBoundary\"]\ne:\"$Sreact.suspense\"\n10:I[90484,[],\"ViewportBoundary\"]\n12:I[90484,[],\"MetadataBoundary\"]\n14:I[27123,[],\"\"]\n:HL[\"/_next/static/media/27834908180db20f-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/78fec81b34c4a365.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/a6a6c7db5d43079b.css\",\"style\"]\n:HL[\"/_next/static/css/b5d2bd8e17641061.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"Wa475fYq7y8N9jedn5ZlJ\",\"c\":[\"\",\"workspace\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"workspace\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a6a6c7db5d43079b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b5d2bd8e17641061.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"__variable_245d8d __variable_97c177\",\"children\":[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L5\",null,{}]]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"Component\":\"$7\",\"slots\":{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]},\"serverProvidedParams\":{\"params\":{},\"promises\":[\"$@8\"]}}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L9\",null,{\"Component\":\"$a\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":\"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params\",\"promises\":[\"$@b\",\"$@c\"]}}],null,[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"$e\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@f\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L10\",null,{\"children\":\"$L11\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L12\",null,{\"children\":[\"$\",\"$e\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L13\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$14\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:\"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params\"\nb:{}\nc:\"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"11:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"15:I[86869,[],\"IconMark\"]\nf:null\n13:[[\"$\",\"title\",\"0\",{\"children\":\"ClawPad\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"The workspace for OpenClaw\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?50c20623341a5f1c\",\"type\":\"image/x-icon\",\"sizes\":\"256x256\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon.png\",\"type\":\"image/png\"}],[\"$\",\"link\",\"5\",{\"rel\":\"apple-touch-icon\",\"href\":\"/brand/apple-touch-icon.png\"}],[\"$\",\"$L15\",\"6\",{}]]\n"])</script></body></html>
|
|
@@ -16,7 +16,7 @@ e:"$Sreact.suspense"
|
|
|
16
16
|
:HL["/_next/static/media/78fec81b34c4a365.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
17
17
|
:HL["/_next/static/css/a6a6c7db5d43079b.css","style"]
|
|
18
18
|
:HL["/_next/static/css/b5d2bd8e17641061.css","style"]
|
|
19
|
-
0:{"P":null,"b":"
|
|
19
|
+
0:{"P":null,"b":"Wa475fYq7y8N9jedn5ZlJ","c":["","workspace"],"q":"","i":false,"f":[[["",{"children":["workspace",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a6a6c7db5d43079b.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b5d2bd8e17641061.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"className":"__variable_245d8d __variable_97c177","children":["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"children":[["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L5",null,{}]]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L6",null,{"Component":"$7","slots":{"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@8"]}}]]}],{"children":[["$","$1","c",{"children":[["$","$L9",null,{"Component":"$a","serverProvidedParams":{"searchParams":{},"params":"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params","promises":["$@b","$@c"]}}],null,["$","$Ld",null,{"children":["$","$e",null,{"name":"Next.MetadataOutlet","children":"$@f"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$L10",null,{"children":"$L11"}],["$","div",null,{"hidden":true,"children":["$","$L12",null,{"children":["$","$e",null,{"name":"Next.Metadata","children":"$L13"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$14",[]],"S":true}
|
|
20
20
|
8:"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params"
|
|
21
21
|
b:{}
|
|
22
22
|
c:"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params"
|
|
@@ -16,7 +16,7 @@ e:"$Sreact.suspense"
|
|
|
16
16
|
:HL["/_next/static/media/78fec81b34c4a365.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
17
17
|
:HL["/_next/static/css/a6a6c7db5d43079b.css","style"]
|
|
18
18
|
:HL["/_next/static/css/b5d2bd8e17641061.css","style"]
|
|
19
|
-
0:{"P":null,"b":"
|
|
19
|
+
0:{"P":null,"b":"Wa475fYq7y8N9jedn5ZlJ","c":["","workspace"],"q":"","i":false,"f":[[["",{"children":["workspace",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a6a6c7db5d43079b.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b5d2bd8e17641061.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"className":"__variable_245d8d __variable_97c177","children":["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"children":[["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L5",null,{}]]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L6",null,{"Component":"$7","slots":{"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]},"serverProvidedParams":{"params":{},"promises":["$@8"]}}]]}],{"children":[["$","$1","c",{"children":[["$","$L9",null,{"Component":"$a","serverProvidedParams":{"searchParams":{},"params":"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params","promises":["$@b","$@c"]}}],null,["$","$Ld",null,{"children":["$","$e",null,{"name":"Next.MetadataOutlet","children":"$@f"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$L10",null,{"children":"$L11"}],["$","div",null,{"hidden":true,"children":["$","$L12",null,{"children":["$","$e",null,{"name":"Next.Metadata","children":"$L13"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$14",[]],"S":true}
|
|
20
20
|
8:"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params"
|
|
21
21
|
b:{}
|
|
22
22
|
c:"$0:f:0:1:1:children:0:props:children:1:props:serverProvidedParams:params"
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
3:I[90484,[],"MetadataBoundary"]
|
|
4
4
|
4:"$Sreact.suspense"
|
|
5
5
|
5:I[86869,[],"IconMark"]
|
|
6
|
-
0:{"buildId":"
|
|
6
|
+
0:{"buildId":"Wa475fYq7y8N9jedn5ZlJ","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"ClawPad"}],["$","meta","1",{"name":"description","content":"The workspace for OpenClaw"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?50c20623341a5f1c","type":"image/x-icon","sizes":"256x256"}],["$","link","3",{"rel":"icon","href":"/favicon.ico"}],["$","link","4",{"rel":"icon","href":"/favicon.png","type":"image/png"}],["$","link","5",{"rel":"apple-touch-icon","href":"/brand/apple-touch-icon.png"}],["$","$L5","6",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false}
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
5:I[25044,["330","static/chunks/330-60f33582af3e15a5.js","7300","static/chunks/7300-9984bd6aa378227a.js","6609","static/chunks/6609-078a8cdc853f87c6.js","8935","static/chunks/8935-b62f5c8bf50ff5e8.js","112","static/chunks/112-8da50d6fab374e89.js","1178","static/chunks/1178-f2f0bd687a63b9f8.js","7177","static/chunks/app/layout-6fad2f96726e757a.js"],"Toaster"]
|
|
6
6
|
:HL["/_next/static/css/a6a6c7db5d43079b.css","style"]
|
|
7
7
|
:HL["/_next/static/css/b5d2bd8e17641061.css","style"]
|
|
8
|
-
0:{"buildId":"
|
|
8
|
+
0:{"buildId":"Wa475fYq7y8N9jedn5ZlJ","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/a6a6c7db5d43079b.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/b5d2bd8e17641061.css","precedence":"next"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"className":"__variable_245d8d __variable_97c177","children":["$","body",null,{"className":"font-sans antialiased","children":["$","$L2",null,{"children":[["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}],["$","$L5",null,{}]]}]}]}]]}],"loading":null,"isPartial":false}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
:HL["/_next/static/media/78fec81b34c4a365.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
|
3
3
|
:HL["/_next/static/css/a6a6c7db5d43079b.css","style"]
|
|
4
4
|
:HL["/_next/static/css/b5d2bd8e17641061.css","style"]
|
|
5
|
-
0:{"buildId":"
|
|
5
|
+
0:{"buildId":"Wa475fYq7y8N9jedn5ZlJ","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"workspace","paramType":null,"paramKey":"workspace","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
3:I[59176,["330","static/chunks/330-60f33582af3e15a5.js","5403","static/chunks/5403-0bffd8f59627ffd1.js","1178","static/chunks/1178-f2f0bd687a63b9f8.js","6364","static/chunks/app/workspace/page-e1500b07743ca666.js"],"default"]
|
|
4
4
|
6:I[90484,[],"OutletBoundary"]
|
|
5
5
|
7:"$Sreact.suspense"
|
|
6
|
-
0:{"buildId":"
|
|
6
|
+
0:{"buildId":"Wa475fYq7y8N9jedn5ZlJ","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],null,["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false}
|
|
7
7
|
4:{}
|
|
8
8
|
5:{}
|
|
9
9
|
8:null
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
3:I[24733,["8803","static/chunks/ba12c10f-cb1126b897816a0f.js","330","static/chunks/330-60f33582af3e15a5.js","7300","static/chunks/7300-9984bd6aa378227a.js","4559","static/chunks/4559-722e02df6a03e69f.js","6609","static/chunks/6609-078a8cdc853f87c6.js","5403","static/chunks/5403-0bffd8f59627ffd1.js","8935","static/chunks/8935-b62f5c8bf50ff5e8.js","9352","static/chunks/9352-dcb425f6cf5347f4.js","1285","static/chunks/1285-5a2da086334493ab.js","8550","static/chunks/8550-1006bc90e28110d2.js","9075","static/chunks/9075-6844b0538e143748.js","7230","static/chunks/7230-ae3fcfca93b2ad80.js","1178","static/chunks/1178-f2f0bd687a63b9f8.js","1807","static/chunks/app/workspace/layout-10e6e52da47d81e4.js"],"default"]
|
|
4
4
|
4:I[57121,[],""]
|
|
5
5
|
5:I[74581,[],""]
|
|
6
|
-
0:{"buildId":"
|
|
6
|
+
0:{"buildId":"Wa475fYq7y8N9jedn5ZlJ","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"Component":"$3","slots":{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}]}]},"serverProvidedParams":{"params":{},"promises":["$@6"]}}]]}],"loading":null,"isPartial":false}
|
|
7
7
|
6:"$0:rsc:props:children:1:props:serverProvidedParams:params"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"/_not-found/page": "app/_not-found/page.js",
|
|
3
|
-
"/api/ai/write/route": "app/api/ai/write/route.js",
|
|
4
3
|
"/_global-error/page": "app/_global-error/page.js",
|
|
4
|
+
"/api/ai/write/route": "app/api/ai/write/route.js",
|
|
5
5
|
"/api/chat/abort/route": "app/api/chat/abort/route.js",
|
|
6
6
|
"/api/chat/route": "app/api/chat/route.js",
|
|
7
|
-
"/api/files/pages/[...path]/route": "app/api/files/pages/[...path]/route.js",
|
|
8
7
|
"/api/files/recent/route": "app/api/files/recent/route.js",
|
|
8
|
+
"/api/files/pages/[...path]/route": "app/api/files/pages/[...path]/route.js",
|
|
9
9
|
"/api/files/search/route": "app/api/files/search/route.js",
|
|
10
10
|
"/api/files/spaces/[space]/pages/route": "app/api/files/spaces/[space]/pages/route.js",
|
|
11
11
|
"/api/files/spaces/route": "app/api/files/spaces/route.js",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"/api/gateway/config/route": "app/api/gateway/config/route.js",
|
|
14
14
|
"/api/gateway/detect/route": "app/api/gateway/detect/route.js",
|
|
15
15
|
"/api/gateway/features/route": "app/api/gateway/features/route.js",
|
|
16
|
-
"/api/gateway/resolve/route": "app/api/gateway/resolve/route.js",
|
|
17
16
|
"/api/gateway/history/route": "app/api/gateway/history/route.js",
|
|
17
|
+
"/api/gateway/resolve/route": "app/api/gateway/resolve/route.js",
|
|
18
18
|
"/api/gateway/sessions/route": "app/api/gateway/sessions/route.js",
|
|
19
19
|
"/api/gateway/status/route": "app/api/gateway/status/route.js",
|
|
20
20
|
"/api/openclaw/commands/route": "app/api/openclaw/commands/route.js",
|
|
21
21
|
"/api/search/route": "app/api/search/route.js",
|
|
22
22
|
"/api/settings/search-status/route": "app/api/settings/search-status/route.js",
|
|
23
|
+
"/api/setup/bootstrap-workspace/route": "app/api/setup/bootstrap-workspace/route.js",
|
|
23
24
|
"/api/setup/bootstrap/route": "app/api/setup/bootstrap/route.js",
|
|
24
25
|
"/api/setup/status/route": "app/api/setup/status/route.js",
|
|
25
|
-
"/api/setup/bootstrap-workspace/route": "app/api/setup/bootstrap-workspace/route.js",
|
|
26
26
|
"/api/setup/trigger-onboarding/route": "app/api/setup/trigger-onboarding/route.js",
|
|
27
27
|
"/api/version/route": "app/api/version/route.js",
|
|
28
28
|
"/favicon.ico/route": "app/favicon.ico/route.js",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"/api/changes/record/route": "app/api/changes/record/route.js",
|
|
33
33
|
"/api/changes/run/route": "app/api/changes/run/route.js",
|
|
34
34
|
"/api/gateway/events/route": "app/api/gateway/events/route.js",
|
|
35
|
-
"/page": "app/page.js",
|
|
36
35
|
"/settings/connection/page": "app/settings/connection/page.js",
|
|
37
|
-
"/
|
|
36
|
+
"/page": "app/page.js",
|
|
38
37
|
"/settings/relay/page": "app/settings/relay/page.js",
|
|
38
|
+
"/settings/page": "app/settings/page.js",
|
|
39
39
|
"/setup/page": "app/setup/page.js",
|
|
40
40
|
"/waitlist/page": "app/waitlist/page.js",
|
|
41
|
-
"/workspace/page": "app/workspace/page.js",
|
|
42
41
|
"/workspace/[...path]/page": "app/workspace/[...path]/page.js",
|
|
42
|
+
"/workspace/page": "app/workspace/page.js",
|
|
43
43
|
"/workspace/search/page": "app/workspace/search/page.js"
|
|
44
44
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";exports.id=1210,exports.ids=[1210],exports.modules={81210:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{t:()=>m});var e=c(48161),f=c.n(e),g=c(56220),h=c(94615),i=a([g]);g=(i.then?(await i)():i)[0];let j={id:"webchat-ui",version:"clawpad",platform:"web",mode:"webchat"},k=["operator.read","operator.write","operator.admin"];class l{get status(){return this._status}getLastError(){return this.lastError}getLastErrorCode(){return this.lastErrorCode}getFeatures(){return this.features}async connect(a,b){if(a&&this.applyPreferredGatewayUrl(a),arguments.length>=2){let a=this.normalizeToken(b);this.configuredToken=a,this.token=a}"connected"!==this._status&&"connecting"!==this._status&&this.doConnect()}disconnect(a){this.cancelReconnect(),this.reconnectAttempts=0,this.ws&&(this.ws.removeAllListeners(),this.ws.close(),this.ws=null),this.setStatus("disconnected"),a?.reconnect&&this.scheduleReconnect(a.reason)}onEvent(a){return this.eventListeners.add(a),()=>{this.eventListeners.delete(a)}}onStatus(a){return this.statusListeners.add(a),a(this._status),()=>{this.statusListeners.delete(a)}}get listenerCount(){return this.eventListeners.size}sendRPC(a,b,c=3e4){return new Promise((d,e)=>{if("connected"!==this._status||!this.ws)return void e(Error(`Cannot send RPC: WS status is "${this._status}"`));let f=String(++this.requestId),g=setTimeout(()=>{this.pendingRPC.delete(f),e(Error(`RPC "${a}" timed out after ${c}ms`))},c);this.pendingRPC.set(f,{resolve:d,reject:e,timer:g});try{this.ws.send(JSON.stringify({type:"req",id:f,method:a,params:b}))}catch(a){this.pendingRPC.delete(f),clearTimeout(g),e(Error(`Failed to send RPC: ${a}`))}})}async ensureConnected(a=1e4){if("connected"!==this._status){if("disconnected"===this._status){let{detectGateway:a}=await c.e(4526).then(c.bind(c,4526)),b=await a();if(b){let a=b.url.replace(/^http/,"ws");await this.connect(a,b.token)}}return new Promise((b,c)=>{if("connected"===this._status)return void b();let d=setTimeout(()=>{e(),c(Error("WS connect timed out"))},a),e=this.onStatus(a=>{"connected"===a&&(clearTimeout(d),e(),b())})})}}normalizeToken(a){return a?.trim()||void 0}buildOrigin(a){if(!a)return null;let b=a.replace(/^ws/i,"http");try{return new URL(b).origin}catch{return null}}normalizeHost(a){return a.trim().toLowerCase()}getLocalHostAliases(){let a=Date.now();if(this.localHostAliases&&a-this.localHostAliasesAtMs<6e4)return this.localHostAliases;let b=new Set(["localhost","127.0.0.1","::1"]),c=this.normalizeHost(f().hostname());for(let a of(c&&(b.add(c),b.add(`${c}.local`)),Object.values(f().networkInterfaces())))for(let c of a??[]){let a=this.normalizeHost(c.address??"");a&&b.add(a)}return this.localHostAliases=b,this.localHostAliasesAtMs=a,b}resolveLoopbackUrl(a){if(!a)return null;let b=a.replace(/^ws/i,"http");try{let a=new URL(b),c=this.normalizeHost(a.hostname);if(!c||"localhost"===c||"127.0.0.1"===c||"::1"===c||!this.getLocalHostAliases().has(c))return null;let d="https:"===a.protocol?"https:":"http:",e=a.port||("https:"===d?"443":"80"),f=a.pathname&&"/"!==a.pathname?a.pathname:"";return`${d}//127.0.0.1:${e}${f}${a.search}`}catch{return null}}applyPreferredGatewayUrl(a){let b=a.trim();if(!b)return;this.configuredUrl=b;let c=this.resolveLoopbackUrl(b);if(c&&c!==b){this.url=c,this.fallbackUrl=b;return}this.url=b,this.fallbackUrl=null}isAuthError(a,b){let c=(a??"").toUpperCase();if("NOT_PAIRED"===c||"AUTH_REQUIRED"===c||"UNAUTHORIZED"===c)return!0;let d=(b??"").toLowerCase();return!!d&&(d.includes("device identity required")||d.includes("not paired"))}async refreshConfig(a){let b=Date.now();return this.configRefreshInFlight?this.configRefreshInFlight:b-this.lastConfigRefreshAt<5e3?void 0:(this.configRefreshInFlight=(async()=>{this.lastConfigRefreshAt=Date.now();try{let{detectGateway:a}=await c.e(4526).then(c.bind(c,4526)),b=await a();if(b){this.applyPreferredGatewayUrl(b.url);let a=this.normalizeToken(b.token);this.configuredToken=a,this.token=a}}catch(b){console.warn("[gateway-ws] Config refresh failed:",a,b)}finally{this.configRefreshInFlight=null}})(),this.configRefreshInFlight)}setStatus(a){if(this._status!==a)for(let b of(this._status=a,"connected"===a&&(this.reconnectAttempts=0),this.statusListeners))try{b(a)}catch{}}doConnect(){this.setStatus("connecting");let a=!1;try{let a=this.url.replace(/^http/,"ws"),b=this.buildOrigin(this.url);this.ws=new g.default(a,b?{origin:b}:void 0)}catch(a){console.error("[gateway-ws] Failed to create WebSocket:",a),this.scheduleReconnect();return}this.ws.on("open",()=>{a=!0,console.log("[gateway-ws] WebSocket opened, waiting for challenge..."),this.lastPongAt=Date.now(),this.pingInterval||(this.pingInterval=setInterval(()=>{if(this.ws){if(Date.now()-this.lastPongAt>6e4){try{this.ws.terminate()}catch{}return}try{this.ws.ping()}catch{}}},3e4))}),this.ws.on("message",a=>{this.handleMessage(String(a))}),this.ws.on("error",a=>{console.error("[gateway-ws] WebSocket error:",a.message),this.lastError=a.message,this.lastErrorCode=null}),this.ws.on("close",()=>{for(let[a,b]of(this.ws=null,this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null),this.pendingRPC))clearTimeout(b.timer),b.reject(Error("WebSocket closed"));this.pendingRPC.clear(),!a&&this.fallbackUrl&&this.url!==this.fallbackUrl&&(this.lastError="localhost probe failed; retrying configured gateway address",this.lastErrorCode="GATEWAY_URL_FALLBACK",this.url=this.fallbackUrl,this.fallbackUrl=null,this.lastAuthRetryAt=null),this.setStatus("disconnected"),this.scheduleReconnect()}),this.ws.on("pong",()=>{this.lastPongAt=Date.now()})}handleMessage(a){let b;try{b=JSON.parse(a)}catch{console.warn("[gateway-ws] Failed to parse frame:",a.slice(0,200));return}if("event"===b.type){let a=b;if("connect.challenge"===a.event){console.log("[gateway-ws] Received challenge, sending connect...");let b=a.payload;this.handleChallenge(b.nonce);return}for(let b of this.eventListeners)try{b(a)}catch(a){console.error("[gateway-ws] Listener error:",a)}}else if("res"===b.type){let a=b,c=this.pendingRPC.get(a.id);if(c){this.pendingRPC.delete(a.id),clearTimeout(c.timer),a.ok?c.resolve(a.payload):c.reject(Error(`RPC error: ${JSON.stringify(a.error)}`));return}if(a.ok){console.log("[gateway-ws] Connected to gateway, payload:",JSON.stringify(a.payload)),this.lastError=null,this.lastErrorCode=null,this.lastAuthError=null,this.lastAuthErrorAt=null,this.lastAuthRetryAt=null;let b=a.payload&&"object"==typeof a.payload?a.payload:void 0,c="string"==typeof b?.auth?.deviceToken?b.auth.deviceToken:null,d="string"==typeof b?.auth?.role?b.auth.role:"operator",e=Array.isArray(b?.auth?.scopes)?b.auth.scopes.filter(a=>"string"==typeof a):[],f=!(e.length>0)||(0,h.PP)(e,h.qq);if(c){let a=(0,h.aZ)();f?((0,h.HQ)({deviceId:a.deviceId,role:d,token:c,scopes:e,gatewayUrl:this.url}),this.token=c):(0,h.Sm)({deviceId:a.deviceId,role:d,gatewayUrl:this.url,includeLegacyRoleEntry:!0})}if(f)this.lastScopeRecoveryAt=null;else{let a=new Set(e.map(a=>a.toLowerCase())),b=h.qq.filter(b=>!a.has(b)),c=`gateway issued device token without required scopes (${b.join(", ")||"unknown"})`;this.lastError=c,this.lastErrorCode="MISSING_SCOPE";let d=Date.now();if(!this.lastScopeRecoveryAt||d-this.lastScopeRecoveryAt>6e4){this.lastScopeRecoveryAt=d,this.forceConfigTokenOnNextChallenge=!0,console.warn("[gateway-ws] Missing required scopes in issued token. Retrying with configured token."),this.disconnect({reconnect:!0,reason:"scope-recovery"});return}console.warn("[gateway-ws] Missing required scopes in issued token; recovery recently attempted.")}this.updateFeatures(a.payload),this.setStatus("connected")}else{let b=a.error?.code,c=a.error?.message??"connect rejected",d=(()=>{let b=a.error;if(b&&"object"==typeof b){if(b.details&&"object"==typeof b.details)return b.details;if(b.data&&"object"==typeof b.data&&"details"in b.data&&"object"==typeof b.data.details)return b.data.details}})(),e="string"==typeof d?.code?d.code.trim().toUpperCase():void 0,f="string"==typeof d?.requestId&&d.requestId.trim()?d.requestId.trim():void 0,g="string"==typeof b?b:"number"==typeof b?String(b):null;console.error("[gateway-ws] Connect rejected:",a.error);let i=(g??"").toUpperCase();if(this.lastError=c,this.lastErrorCode=g,this.isAuthError(g,c)){if(this.lastAuthError=c,this.lastAuthErrorAt=Date.now(),"stored"===this.lastConnectTokenSource){let a=(0,h.aZ)();(0,h.Sm)({deviceId:a.deviceId,role:"operator",gatewayUrl:this.url,includeLegacyRoleEntry:!0}),this.configuredToken&&this.configuredToken!==this.lastConnectToken&&(this.forceConfigTokenOnNextChallenge=!0,this.token=this.configuredToken,this.lastError="cached device token rejected; retrying with gateway token",this.lastErrorCode="AUTH_RECOVERY")}if("NOT_PAIRED"===i)if("PAIRING_REQUIRED"===e||c.toLowerCase().includes("pairing required")){let a=this.resolveLoopbackUrl(this.configuredUrl);a&&a!==this.url?(this.fallbackUrl=this.configuredUrl,this.url=a,this.lastError="pairing required on gateway address; retrying localhost",this.lastErrorCode="PAIRING_LOCAL_RETRY",this.lastAuthRetryAt=null):(this.configuredToken,this.lastError=f?`pairing required (request ${f})`:"pairing required")}else"DEVICE_IDENTITY_REQUIRED"===e&&(this.lastError=this.configuredToken?"device identity required":"device identity required (gateway token not detected)",this.lastErrorCode="DEVICE_IDENTITY_REQUIRED");else"AUTH_REQUIRED"!==i||this.configuredToken||(this.lastError="gateway token missing")}this.disconnect({reconnect:!0,reason:"connect-rejected"})}}}async handleChallenge(a){if(!this.ws)return;this.token||this.configuredToken||await this.refreshConfig("challenge");let b="operator",c=(0,h.aZ)(),d=this.normalizeToken(this.configuredToken??this.token),e=this.forceConfigTokenOnNextChallenge?void 0:(0,h.vM)({deviceId:c.deviceId,role:b,gatewayUrl:this.url,requiredScopes:h.qq})?.token,f=this.normalizeToken(e??d);this.forceConfigTokenOnNextChallenge=!1,f||(this.lastAuthError="token missing",this.lastAuthErrorAt=Date.now(),this.lastError="device identity required",this.lastErrorCode="AUTH_REQUIRED");let g="string"==typeof a&&a.trim()?a.trim():void 0,i=(0,h.n3)({identity:c,clientId:j.id,clientMode:j.mode,role:b,scopes:k,token:f,nonce:g}),l={type:"req",id:String(++this.requestId),method:"connect",params:{minProtocol:3,maxProtocol:3,client:j,role:b,scopes:k,caps:[],commands:[],permissions:{},auth:f?{token:f}:{},device:i}};this.token=f,this.lastConnectToken=f,this.lastConnectTokenSource=e?"stored":f?"config":"none";try{this.ws.send(JSON.stringify(l))}catch(a){console.error("[gateway-ws] Failed to send connect:",a)}}updateFeatures(a){if(!a||"object"!=typeof a)return;let b=a.features;if(!b||"object"!=typeof b)return;let c=b.methods,d=b.events,e=Array.isArray(c)?c.filter(a=>"string"==typeof a):[],f=Array.isArray(d)?d.filter(a=>"string"==typeof a):[];(e.length||f.length)&&(this.features={methods:e,events:f})}scheduleReconnect(a){if("connected"===this._status||"connecting"===this._status)return;this.cancelReconnect(),this.setStatus("reconnecting");let b=Date.now();if(this.isAuthError(this.lastErrorCode,this.lastError)){let a=this.token&&this.token!==this.lastConnectToken;if(this.lastAuthRetryAt&&b-this.lastAuthRetryAt<3e4&&!a)return;this.lastAuthRetryAt=b}let c=this.reconnectAttempts,d=Math.min(3e4,2e3*Math.pow(1.8,c)),e=.25*d*(2*Math.random()-1),f=Math.max(500,Math.round(d+e));this.reconnectAttempts+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,"disconnected"===this._status&&(this.reconnectInFlight||(this.reconnectInFlight=!0,this.refreshConfig("reconnect").catch(()=>{}).finally(()=>{this.reconnectInFlight=!1,"disconnected"===this._status&&this.doConnect()})))},f)}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}constructor(){this.ws=null,this._status="disconnected",this.configuredUrl="http://127.0.0.1:18789",this.fallbackUrl=null,this.localHostAliases=null,this.localHostAliasesAtMs=0,this.url="http://127.0.0.1:18789",this.reconnectTimer=null,this.requestId=0,this.lastError=null,this.lastErrorCode=null,this.lastAuthError=null,this.lastAuthErrorAt=null,this.lastAuthRetryAt=null,this.lastConnectTokenSource="none",this.configRefreshInFlight=null,this.lastConfigRefreshAt=0,this.reconnectInFlight=!1,this.reconnectAttempts=0,this.pingInterval=null,this.lastPongAt=0,this.features=null,this.forceConfigTokenOnNextChallenge=!1,this.lastScopeRecoveryAt=null,this.eventListeners=new Set,this.statusListeners=new Set,this.pendingRPC=new Map}}let m=new l;d()}catch(a){d(a)}})},94615:(a,b,c)=>{c.d(b,{HQ:()=>G,PP:()=>x,Sm:()=>H,aZ:()=>u,n3:()=>C,qq:()=>l,vM:()=>F});var d=c(55511),e=c.n(d),f=c(29021),g=c.n(f),h=c(33873),i=c.n(h),j=c(27843);let k=Buffer.from("302a300506032b6570032100","hex"),l=["operator.read","operator.write"];function m(a=process.env){return i().join((0,j.We)(a),"identity")}function n(a=process.env){return i().join(m(a),"device-auth.json")}function o(a){return a.toString("base64").replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function p(a){if("string"==typeof a)return a.trim()||void 0}function q(a){if("string"==typeof a)return a.trim().toLowerCase()||void 0}function r(a){let b=e().createPublicKey(a).export({type:"spki",format:"der"});return b.length===k.length+32&&b.subarray(0,k.length).equals(k)?b.subarray(k.length):b}function s(a){let b=r(a);return e().createHash("sha256").update(b).digest("hex")}function t(a,b){g().mkdirSync(i().dirname(a),{recursive:!0}),g().writeFileSync(a,`${JSON.stringify(b,null,2)}
|
|
2
|
-
`,{mode:384});try{g().chmodSync(a,384)}catch{}}function u(a=process.env){let b=function(a=process.env){return i().join(m(a),"device.json")}(a);try{if(g().existsSync(b)){let a=g().readFileSync(b,"utf8"),c=JSON.parse(a);if(c?.version===1&&"string"==typeof c.deviceId&&"string"==typeof c.publicKeyPem&&"string"==typeof c.privateKeyPem){let a=s(c.publicKeyPem);if(a!==c.deviceId)return t(b,{version:1,deviceId:a,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem,createdAtMs:Date.now()}),{deviceId:a,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem};return{deviceId:c.deviceId,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem}}}}catch{}let c=function(){let{publicKey:a,privateKey:b}=e().generateKeyPairSync("ed25519"),c=a.export({type:"spki",format:"pem"}).toString(),d=b.export({type:"pkcs8",format:"pem"}).toString();return{deviceId:s(c),publicKeyPem:c,privateKeyPem:d}}();return t(b,{version:1,deviceId:c.deviceId,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem,createdAtMs:Date.now()}),c}function v(a){let b=new Set,c=[];for(let d of a){let a=q(d);!a||b.has(a)||(b.add(a),c.push(a))}return c}function w(a){return v(a).sort()}function x(a,b=l){if(!Array.isArray(a)||0===a.length)return!1;let c=new Set;for(let b of a){let a=q(b);a&&c.add(a)}for(let a of b){let b=q(a);if(b&&!c.has(b))return!1}return!0}function y(a){if(!Array.isArray(a)||0===a.length)return 0;let b=new Set;for(let c of a){let a=q(c);a&&b.add(a)}let c=0;return b.has("operator.read")&&(c+=100),b.has("operator.write")&&(c+=200),b.has("operator.admin")&&(c+=30),b.has("operator.approvals")&&(c+=5),b.has("operator.pairing")&&(c+=5),c}function z(a){if(!a)return;let b=a.trim();if(b)try{let a=new URL(/^wss?:\/\//i.test(b)?b.replace(/^wss?/i,"http"):/^https?:\/\//i.test(b)?b:`http://${b}`),c=a.port||("https:"===a.protocol?"443":"80");return`${a.hostname.toLowerCase()}:${c}`}catch{return b.toLowerCase()}}function A(a,b){return b?`${a}::${b}`:a}function B(a,b){if(!b||"object"!=typeof b)return null;let c=function(a){let b=a.indexOf("::");if(-1===b)return{role:a.trim()};let c=a.slice(0,b).trim(),d=z(a.slice(b+2));return{role:c,...d?{gatewayKey:d}:{}}}(a),d=p(b.token);if(!d)return null;let e="string"==typeof b.role&&b.role.trim()?b.role.trim():c.role;if(!e)return null;let f=z("string"==typeof b.gatewayKey?b.gatewayKey:c.gatewayKey),g=Array.isArray(b.scopes)?b.scopes.filter(a=>"string"==typeof a):[],h="number"==typeof b.updatedAtMs&&Number.isFinite(b.updatedAtMs)?b.updatedAtMs:0;return{token:d,role:e,scopes:w(g),updatedAtMs:h,...f?{gatewayKey:f}:{}}}function C(a){var b,c;let d,f,g,h=v(a.scopes),i=Date.now(),j=(f=[d=(b={deviceId:a.identity.deviceId,clientId:a.clientId,clientMode:a.clientMode,role:a.role,scopes:h,signedAtMs:i,token:a.token,nonce:a.nonce}).nonce?"v2":"v1",b.deviceId,b.clientId,b.clientMode,b.role,b.scopes.join(","),String(b.signedAtMs),b.token??""],"v2"===d&&f.push(b.nonce??""),f.join("|"));return{id:a.identity.deviceId,publicKey:o(r(a.identity.publicKeyPem)),signature:(c=a.identity.privateKeyPem,g=e().createPrivateKey(c),o(e().sign(null,Buffer.from(j,"utf8"),g))),signedAt:i,...a.nonce?{nonce:a.nonce}:{}}}function D(a=process.env){let b=n(a);try{if(!g().existsSync(b))return null;let a=g().readFileSync(b,"utf8"),c=JSON.parse(a);if(!c||1!==c.version&&2!==c.version||"string"!=typeof c.deviceId||!c.tokens||"object"!=typeof c.tokens)return null;return c}catch{return null}}function E(a,b=process.env){t(n(b),a)}function F(a){let b=D(a.env);if(!b||b.deviceId!==a.deviceId)return null;let c=a.role.trim();if(!c)return null;let d=z(a.gatewayUrl),e=w((a.requiredScopes??[]).filter(a=>"string"==typeof a)),f=[];for(let[a,g]of Object.entries(b.tokens)){let b=B(a,g);if(!b||b.role!==c||d&&b.gatewayKey&&b.gatewayKey!==d||e.length>0&&!x(b.scopes,e))continue;let h=d?b.gatewayKey===d?2:+!b.gatewayKey:+!!b.gatewayKey;f.push({...b,gatewayMatch:h,scopeScore:y(b.scopes)})}if(0===f.length)return null;f.sort((a,b)=>b.gatewayMatch-a.gatewayMatch||b.scopeScore-a.scopeScore||b.updatedAtMs-a.updatedAtMs);let g=f[0];return{token:g.token,role:g.role,scopes:g.scopes,updatedAtMs:g.updatedAtMs,...g.gatewayKey?{gatewayKey:g.gatewayKey}:{}}}function G(a){let b=a.role.trim(),c=p(a.token);if(!b||!c)return!1;let d=z(a.gatewayUrl),e=A(b,d),f=D(a.env),g=f&&f.deviceId===a.deviceId&&f.tokens&&"object"==typeof f.tokens?f:{version:2,deviceId:a.deviceId,tokens:{}};g.version=2;let h={token:c,role:b,scopes:w(a.scopes),updatedAtMs:Date.now(),...d?{gatewayKey:d}:{}},i=B(e,g.tokens[e]);if(i&&y(i.scopes)>y(h.scopes))return!1;return g.tokens[e]=h,E(g,a.env),!0}function H(a){let b=a.role.trim();if(!b)return!1;let c=D(a.env);if(!c||c.deviceId!==a.deviceId)return!1;let d=A(b,z(a.gatewayUrl)),e=!1;return c.tokens[d]&&(delete c.tokens[d],e=!0),a.includeLegacyRoleEntry&&c.tokens[b]&&(delete c.tokens[b],e=!0),e&&(c.version=2,E(c,a.env)),e}}};
|
|
1
|
+
"use strict";exports.id=1210,exports.ids=[1210],exports.modules={81210:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{t:()=>m});var e=c(48161),f=c.n(e),g=c(56220),h=c(94615),i=a([g]);g=(i.then?(await i)():i)[0];let j={id:"webchat-ui",version:"clawpad",platform:"web",mode:"webchat"},k=["operator.read","operator.write","operator.admin"];class l{get status(){return this._status}getLastError(){return this.lastError}getLastErrorCode(){return this.lastErrorCode}getFeatures(){return this.features}async connect(a,b){if(a&&this.applyPreferredGatewayUrl(a),arguments.length>=2){let a=this.normalizeToken(b);this.configuredToken=a,this.token=a}"connected"!==this._status&&"connecting"!==this._status&&this.doConnect()}disconnect(a){this.cancelReconnect(),this.reconnectAttempts=0,this.ws&&(this.ws.removeAllListeners(),this.ws.close(),this.ws=null),this.setStatus("disconnected"),a?.reconnect&&this.scheduleReconnect(a.reason)}onEvent(a){return this.eventListeners.add(a),()=>{this.eventListeners.delete(a)}}onStatus(a){return this.statusListeners.add(a),a(this._status),()=>{this.statusListeners.delete(a)}}get listenerCount(){return this.eventListeners.size}sendRPC(a,b,c=3e4){return new Promise((d,e)=>{if("connected"!==this._status||!this.ws)return void e(Error(`Cannot send RPC: WS status is "${this._status}"`));let f=String(++this.requestId),g=setTimeout(()=>{this.pendingRPC.delete(f),e(Error(`RPC "${a}" timed out after ${c}ms`))},c);this.pendingRPC.set(f,{resolve:d,reject:e,timer:g});try{this.ws.send(JSON.stringify({type:"req",id:f,method:a,params:b}))}catch(a){this.pendingRPC.delete(f),clearTimeout(g),e(Error(`Failed to send RPC: ${a}`))}})}async ensureConnected(a=1e4){if("connected"!==this._status){if("disconnected"===this._status){let{detectGateway:a}=await c.e(4526).then(c.bind(c,4526)),b=await a();if(b){let a=b.url.replace(/^http/,"ws");await this.connect(a,b.token)}}return new Promise((b,c)=>{if("connected"===this._status)return void b();let d=setTimeout(()=>{e(),c(Error("WS connect timed out"))},a),e=this.onStatus(a=>{"connected"===a&&(clearTimeout(d),e(),b())})})}}normalizeToken(a){return a?.trim()||void 0}buildOrigin(a){if(!a)return null;let b=a.replace(/^ws/i,"http");try{return new URL(b).origin}catch{return null}}normalizeHost(a){return a.trim().toLowerCase()}getLocalHostAliases(){let a=Date.now();if(this.localHostAliases&&a-this.localHostAliasesAtMs<6e4)return this.localHostAliases;let b=new Set(["localhost","127.0.0.1","::1"]),c=this.normalizeHost(f().hostname());for(let a of(c&&(b.add(c),b.add(`${c}.local`)),Object.values(f().networkInterfaces())))for(let c of a??[]){let a=this.normalizeHost(c.address??"");a&&b.add(a)}return this.localHostAliases=b,this.localHostAliasesAtMs=a,b}resolveLoopbackUrl(a){if(!a)return null;let b=a.replace(/^ws/i,"http");try{let a=new URL(b),c=this.normalizeHost(a.hostname);if(!c||"localhost"===c||"127.0.0.1"===c||"::1"===c||!this.getLocalHostAliases().has(c))return null;let d="https:"===a.protocol?"https:":"http:",e=a.port||("https:"===d?"443":"80"),f=a.pathname&&"/"!==a.pathname?a.pathname:"";return`${d}//127.0.0.1:${e}${f}${a.search}`}catch{return null}}applyPreferredGatewayUrl(a){let b=a.trim();if(!b)return;this.configuredUrl=b;let c=this.resolveLoopbackUrl(b);if(c&&c!==b){this.url=c,this.fallbackUrl=b;return}this.url=b,this.fallbackUrl=null}isAuthError(a,b){let c=(a??"").toUpperCase();if("NOT_PAIRED"===c||"AUTH_REQUIRED"===c||"UNAUTHORIZED"===c)return!0;let d=(b??"").toLowerCase();return!!d&&(d.includes("device identity required")||d.includes("not paired"))}async refreshConfig(a){let b=Date.now();return this.configRefreshInFlight?this.configRefreshInFlight:b-this.lastConfigRefreshAt<5e3?void 0:(this.configRefreshInFlight=(async()=>{this.lastConfigRefreshAt=Date.now();try{let{detectGateway:a}=await c.e(4526).then(c.bind(c,4526)),b=await a();if(b){this.applyPreferredGatewayUrl(b.url);let a=this.normalizeToken(b.token);this.configuredToken=a,this.token=a}}catch(b){console.warn("[gateway-ws] Config refresh failed:",a,b)}finally{this.configRefreshInFlight=null}})(),this.configRefreshInFlight)}setStatus(a){if(this._status!==a)for(let b of(this._status=a,"connected"===a&&(this.reconnectAttempts=0),this.statusListeners))try{b(a)}catch{}}doConnect(){this.setStatus("connecting");let a=!1;try{let a=this.url.replace(/^http/,"ws"),b=this.buildOrigin(this.url);this.ws=new g.default(a,b?{origin:b}:void 0)}catch(a){console.error("[gateway-ws] Failed to create WebSocket:",a),this.scheduleReconnect();return}this.ws.on("open",()=>{a=!0,console.log("[gateway-ws] WebSocket opened, waiting for challenge..."),this.lastPongAt=Date.now(),this.pingInterval||(this.pingInterval=setInterval(()=>{if(this.ws){if(Date.now()-this.lastPongAt>6e4){try{this.ws.terminate()}catch{}return}try{this.ws.ping()}catch{}}},3e4))}),this.ws.on("message",a=>{this.handleMessage(String(a))}),this.ws.on("error",a=>{console.error("[gateway-ws] WebSocket error:",a.message),this.lastError=a.message,this.lastErrorCode=null}),this.ws.on("close",()=>{for(let[a,b]of(this.ws=null,this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null),this.pendingRPC))clearTimeout(b.timer),b.reject(Error("WebSocket closed"));this.pendingRPC.clear(),!a&&this.fallbackUrl&&this.url!==this.fallbackUrl&&(this.lastError="localhost probe failed; retrying configured gateway address",this.lastErrorCode="GATEWAY_URL_FALLBACK",this.url=this.fallbackUrl,this.fallbackUrl=null,this.lastAuthRetryAt=null),this.setStatus("disconnected"),this.scheduleReconnect()}),this.ws.on("pong",()=>{this.lastPongAt=Date.now()})}handleMessage(a){let b;try{b=JSON.parse(a)}catch{console.warn("[gateway-ws] Failed to parse frame:",a.slice(0,200));return}if("event"===b.type){let a=b;if("connect.challenge"===a.event){console.log("[gateway-ws] Received challenge, sending connect...");let b=a.payload;this.handleChallenge(b.nonce);return}for(let b of this.eventListeners)try{b(a)}catch(a){console.error("[gateway-ws] Listener error:",a)}}else if("res"===b.type){let a=b,c=this.pendingRPC.get(a.id);if(c){this.pendingRPC.delete(a.id),clearTimeout(c.timer),a.ok?c.resolve(a.payload):c.reject(Error(`RPC error: ${JSON.stringify(a.error)}`));return}if(a.ok){console.log("[gateway-ws] Connected to gateway, payload:",JSON.stringify(a.payload)),this.lastError=null,this.lastErrorCode=null,this.lastAuthError=null,this.lastAuthErrorAt=null,this.lastAuthRetryAt=null;let b=a.payload&&"object"==typeof a.payload?a.payload:void 0,c="string"==typeof b?.auth?.deviceToken?b.auth.deviceToken:null,d="string"==typeof b?.auth?.role?b.auth.role:"operator",e=Array.isArray(b?.auth?.scopes)?b.auth.scopes.filter(a=>"string"==typeof a):[],f=!(e.length>0)||(0,h.PP)(e,h.qq);if(c){let a=(0,h.aZ)();f?((0,h.HQ)({deviceId:a.deviceId,role:d,token:c,scopes:e,gatewayUrl:this.url}),this.token=c):(0,h.Sm)({deviceId:a.deviceId,role:d,gatewayUrl:this.url,includeLegacyRoleEntry:!0})}if(f)this.lastScopeRecoveryAt=null;else{let a=new Set(e.map(a=>a.toLowerCase())),b=h.qq.filter(b=>!a.has(b)),c=`gateway issued device token without required scopes (${b.join(", ")||"unknown"})`;this.lastError=c,this.lastErrorCode="MISSING_SCOPE";let d=Date.now();if(!this.lastScopeRecoveryAt||d-this.lastScopeRecoveryAt>6e4){this.lastScopeRecoveryAt=d,this.forceConfigTokenOnNextChallenge=!0,console.warn("[gateway-ws] Missing required scopes in issued token. Retrying with configured token."),this.disconnect({reconnect:!0,reason:"scope-recovery"});return}console.warn("[gateway-ws] Missing required scopes in issued token; recovery recently attempted.")}this.updateFeatures(a.payload),this.setStatus("connected")}else{let b=a.error?.code,c=a.error?.message??"connect rejected",d=(()=>{let b=a.error;if(b&&"object"==typeof b){if(b.details&&"object"==typeof b.details)return b.details;if(b.data&&"object"==typeof b.data&&"details"in b.data&&"object"==typeof b.data.details)return b.data.details}})(),e="string"==typeof d?.code?d.code.trim().toUpperCase():void 0,f="string"==typeof d?.requestId&&d.requestId.trim()?d.requestId.trim():void 0,g="string"==typeof b?b:"number"==typeof b?String(b):null;console.error("[gateway-ws] Connect rejected:",a.error);let i=(g??"").toUpperCase();if(this.lastError=c,this.lastErrorCode=g,this.isAuthError(g,c)){if(this.lastAuthError=c,this.lastAuthErrorAt=Date.now(),"stored"===this.lastConnectTokenSource){let a=(0,h.aZ)();(0,h.Sm)({deviceId:a.deviceId,role:"operator",gatewayUrl:this.url,includeLegacyRoleEntry:!0}),this.configuredToken&&this.configuredToken!==this.lastConnectToken&&(this.forceConfigTokenOnNextChallenge=!0,this.token=this.configuredToken,this.lastError="cached device token rejected; retrying with gateway token",this.lastErrorCode="AUTH_RECOVERY")}if("NOT_PAIRED"===i)if("PAIRING_REQUIRED"===e||c.toLowerCase().includes("pairing required")){let a=this.resolveLoopbackUrl(this.configuredUrl);a&&a!==this.url?(this.fallbackUrl=this.configuredUrl,this.url=a,this.lastError="pairing required on gateway address; retrying localhost",this.lastErrorCode="PAIRING_LOCAL_RETRY",this.lastAuthRetryAt=null):(this.configuredToken,this.lastError=f?`pairing required (request ${f})`:"pairing required")}else"DEVICE_IDENTITY_REQUIRED"===e&&(this.lastError=this.configuredToken?"device identity required":"device identity required (gateway token not detected)",this.lastErrorCode="DEVICE_IDENTITY_REQUIRED");else"AUTH_REQUIRED"!==i||this.configuredToken||(this.lastError="gateway token missing")}this.disconnect({reconnect:!0,reason:"connect-rejected"})}}}async handleChallenge(a){if(!this.ws)return;this.token||this.configuredToken||await this.refreshConfig("challenge");let b="operator",c=(0,h.aZ)(),d=this.normalizeToken(this.configuredToken??this.token),e=this.forceConfigTokenOnNextChallenge?void 0:(0,h.vM)({deviceId:c.deviceId,role:b,gatewayUrl:this.url,requiredScopes:h.qq})?.token,f=this.normalizeToken(e??d);this.forceConfigTokenOnNextChallenge=!1,f||(this.lastAuthError="token missing",this.lastAuthErrorAt=Date.now(),this.lastError="device identity required",this.lastErrorCode="AUTH_REQUIRED");let g="string"==typeof a&&a.trim()?a.trim():void 0,i=(0,h.n3)({identity:c,clientId:j.id,clientMode:j.mode,role:b,scopes:k,token:f,nonce:g}),l={type:"req",id:String(++this.requestId),method:"connect",params:{minProtocol:3,maxProtocol:3,client:j,role:b,scopes:k,caps:[],commands:[],permissions:{},auth:f?{token:f}:{},device:i}};this.token=f,this.lastConnectToken=f,this.lastConnectTokenSource=e?"stored":f?"config":"none";try{this.ws.send(JSON.stringify(l))}catch(a){console.error("[gateway-ws] Failed to send connect:",a)}}updateFeatures(a){if(!a||"object"!=typeof a)return;let b=a.features;if(!b||"object"!=typeof b)return;let c=b.methods,d=b.events,e=Array.isArray(c)?c.filter(a=>"string"==typeof a):[],f=Array.isArray(d)?d.filter(a=>"string"==typeof a):[];(e.length||f.length)&&(this.features={methods:e,events:f})}scheduleReconnect(a){if("connected"===this._status||"connecting"===this._status)return;this.cancelReconnect(),this.setStatus("reconnecting");let b=Date.now();if(this.isAuthError(this.lastErrorCode,this.lastError)){let a=this.token&&this.token!==this.lastConnectToken;if(this.lastAuthRetryAt&&b-this.lastAuthRetryAt<3e4&&!a)return;this.lastAuthRetryAt=b}let c=this.reconnectAttempts,d=Math.min(3e4,2e3*Math.pow(1.8,c)),e=.25*d*(2*Math.random()-1),f=Math.max(500,Math.round(d+e));this.reconnectAttempts+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,"disconnected"===this._status&&(this.reconnectInFlight||(this.reconnectInFlight=!0,this.refreshConfig("reconnect").catch(()=>{}).finally(()=>{this.reconnectInFlight=!1,"disconnected"===this._status&&this.doConnect()})))},f)}cancelReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}constructor(){this.ws=null,this._status="disconnected",this.configuredUrl="http://127.0.0.1:18789",this.fallbackUrl=null,this.localHostAliases=null,this.localHostAliasesAtMs=0,this.url="http://127.0.0.1:18789",this.reconnectTimer=null,this.requestId=0,this.lastError=null,this.lastErrorCode=null,this.lastAuthError=null,this.lastAuthErrorAt=null,this.lastAuthRetryAt=null,this.lastConnectTokenSource="none",this.configRefreshInFlight=null,this.lastConfigRefreshAt=0,this.reconnectInFlight=!1,this.reconnectAttempts=0,this.pingInterval=null,this.lastPongAt=0,this.features=null,this.forceConfigTokenOnNextChallenge=!1,this.lastScopeRecoveryAt=null,this.eventListeners=new Set,this.statusListeners=new Set,this.pendingRPC=new Map}}let m=new l;d()}catch(a){d(a)}})},94615:(a,b,c)=>{c.d(b,{HQ:()=>G,PP:()=>x,Sm:()=>H,aZ:()=>u,n3:()=>C,qq:()=>l,vM:()=>F});var d=c(55511),e=c.n(d),f=c(29021),g=c.n(f),h=c(33873),i=c.n(h),j=c(27843);let k=Buffer.from("302a300506032b6570032100","hex"),l=["operator.read","operator.write"];function m(a=process.env){return i().join((0,j.We)(a),"identity")}function n(a=process.env){return i().join(m(a),"clawpad-device-auth.json")}function o(a){return a.toString("base64").replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function p(a){if("string"==typeof a)return a.trim()||void 0}function q(a){if("string"==typeof a)return a.trim().toLowerCase()||void 0}function r(a){let b=e().createPublicKey(a).export({type:"spki",format:"der"});return b.length===k.length+32&&b.subarray(0,k.length).equals(k)?b.subarray(k.length):b}function s(a){let b=r(a);return e().createHash("sha256").update(b).digest("hex")}function t(a,b){g().mkdirSync(i().dirname(a),{recursive:!0}),g().writeFileSync(a,`${JSON.stringify(b,null,2)}
|
|
2
|
+
`,{mode:384});try{g().chmodSync(a,384)}catch{}}function u(a=process.env){let b=function(a=process.env){return i().join(m(a),"clawpad-device.json")}(a);try{if(g().existsSync(b)){let a=g().readFileSync(b,"utf8"),c=JSON.parse(a);if(c?.version===1&&"string"==typeof c.deviceId&&"string"==typeof c.publicKeyPem&&"string"==typeof c.privateKeyPem){let a=s(c.publicKeyPem);if(a!==c.deviceId)return t(b,{version:1,deviceId:a,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem,createdAtMs:Date.now()}),{deviceId:a,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem};return{deviceId:c.deviceId,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem}}}}catch{}let c=function(){let{publicKey:a,privateKey:b}=e().generateKeyPairSync("ed25519"),c=a.export({type:"spki",format:"pem"}).toString(),d=b.export({type:"pkcs8",format:"pem"}).toString();return{deviceId:s(c),publicKeyPem:c,privateKeyPem:d}}();return t(b,{version:1,deviceId:c.deviceId,publicKeyPem:c.publicKeyPem,privateKeyPem:c.privateKeyPem,createdAtMs:Date.now()}),c}function v(a){let b=new Set,c=[];for(let d of a){let a=q(d);!a||b.has(a)||(b.add(a),c.push(a))}return c}function w(a){return v(a).sort()}function x(a,b=l){if(!Array.isArray(a)||0===a.length)return!1;let c=new Set;for(let b of a){let a=q(b);a&&c.add(a)}for(let a of b){let b=q(a);if(b&&!c.has(b))return!1}return!0}function y(a){if(!Array.isArray(a)||0===a.length)return 0;let b=new Set;for(let c of a){let a=q(c);a&&b.add(a)}let c=0;return b.has("operator.read")&&(c+=100),b.has("operator.write")&&(c+=200),b.has("operator.admin")&&(c+=30),b.has("operator.approvals")&&(c+=5),b.has("operator.pairing")&&(c+=5),c}function z(a){if(!a)return;let b=a.trim();if(b)try{let a=new URL(/^wss?:\/\//i.test(b)?b.replace(/^wss?/i,"http"):/^https?:\/\//i.test(b)?b:`http://${b}`),c=a.port||("https:"===a.protocol?"443":"80");return`${a.hostname.toLowerCase()}:${c}`}catch{return b.toLowerCase()}}function A(a,b){return b?`${a}::${b}`:a}function B(a,b){if(!b||"object"!=typeof b)return null;let c=function(a){let b=a.indexOf("::");if(-1===b)return{role:a.trim()};let c=a.slice(0,b).trim(),d=z(a.slice(b+2));return{role:c,...d?{gatewayKey:d}:{}}}(a),d=p(b.token);if(!d)return null;let e="string"==typeof b.role&&b.role.trim()?b.role.trim():c.role;if(!e)return null;let f=z("string"==typeof b.gatewayKey?b.gatewayKey:c.gatewayKey),g=Array.isArray(b.scopes)?b.scopes.filter(a=>"string"==typeof a):[],h="number"==typeof b.updatedAtMs&&Number.isFinite(b.updatedAtMs)?b.updatedAtMs:0;return{token:d,role:e,scopes:w(g),updatedAtMs:h,...f?{gatewayKey:f}:{}}}function C(a){var b,c;let d,f,g,h=v(a.scopes),i=Date.now(),j=(f=[d=(b={deviceId:a.identity.deviceId,clientId:a.clientId,clientMode:a.clientMode,role:a.role,scopes:h,signedAtMs:i,token:a.token,nonce:a.nonce}).nonce?"v2":"v1",b.deviceId,b.clientId,b.clientMode,b.role,b.scopes.join(","),String(b.signedAtMs),b.token??""],"v2"===d&&f.push(b.nonce??""),f.join("|"));return{id:a.identity.deviceId,publicKey:o(r(a.identity.publicKeyPem)),signature:(c=a.identity.privateKeyPem,g=e().createPrivateKey(c),o(e().sign(null,Buffer.from(j,"utf8"),g))),signedAt:i,...a.nonce?{nonce:a.nonce}:{}}}function D(a=process.env){let b=n(a);try{if(!g().existsSync(b))return null;let a=g().readFileSync(b,"utf8"),c=JSON.parse(a);if(!c||1!==c.version&&2!==c.version||"string"!=typeof c.deviceId||!c.tokens||"object"!=typeof c.tokens)return null;return c}catch{return null}}function E(a,b=process.env){t(n(b),a)}function F(a){let b=D(a.env);if(!b||b.deviceId!==a.deviceId)return null;let c=a.role.trim();if(!c)return null;let d=z(a.gatewayUrl),e=w((a.requiredScopes??[]).filter(a=>"string"==typeof a)),f=[];for(let[a,g]of Object.entries(b.tokens)){let b=B(a,g);if(!b||b.role!==c||d&&b.gatewayKey&&b.gatewayKey!==d||e.length>0&&!x(b.scopes,e))continue;let h=d?b.gatewayKey===d?2:+!b.gatewayKey:+!!b.gatewayKey;f.push({...b,gatewayMatch:h,scopeScore:y(b.scopes)})}if(0===f.length)return null;f.sort((a,b)=>b.gatewayMatch-a.gatewayMatch||b.scopeScore-a.scopeScore||b.updatedAtMs-a.updatedAtMs);let g=f[0];return{token:g.token,role:g.role,scopes:g.scopes,updatedAtMs:g.updatedAtMs,...g.gatewayKey?{gatewayKey:g.gatewayKey}:{}}}function G(a){let b=a.role.trim(),c=p(a.token);if(!b||!c)return!1;let d=z(a.gatewayUrl),e=A(b,d),f=D(a.env),g=f&&f.deviceId===a.deviceId&&f.tokens&&"object"==typeof f.tokens?f:{version:2,deviceId:a.deviceId,tokens:{}};g.version=2;let h={token:c,role:b,scopes:w(a.scopes),updatedAtMs:Date.now(),...d?{gatewayKey:d}:{}},i=B(e,g.tokens[e]);if(i&&y(i.scopes)>y(h.scopes))return!1;return g.tokens[e]=h,E(g,a.env),!0}function H(a){let b=a.role.trim();if(!b)return!1;let c=D(a.env);if(!c||c.deviceId!==a.deviceId)return!1;let d=A(b,z(a.gatewayUrl)),e=!1;return c.tokens[d]&&(delete c.tokens[d],e=!0),a.includeLegacyRoleEntry&&c.tokens[b]&&(delete c.tokens[b],e=!0),e&&(c.version=2,E(c,a.env)),e}}};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
exports.id=8353,exports.ids=[4526,8353],exports.modules={4526:(a,b,c)=>{"use strict";c.d(b,{detectGateway:()=>x});var d=c(79748),e=c(27843),f=c(31421),g=c(51455),h=c.n(g),i=c(21642);function j(a){if("string"==typeof a)return a.trim()||void 0}function k(a){let b=new Set,c=[];if("string"==typeof a)c.push(...a.split(/[,\s]+/g));else if(Array.isArray(a))for(let b of a)"string"==typeof b&&c.push(...b.split(/[,\s]+/g));for(let a of c){let c=a.trim().toLowerCase();c&&b.add(c)}return b}function l(a){if("string"==typeof a)return j(a);if(!a||"object"!=typeof a)return;let b=a;if(!1!==b.enabled)return j(b.token??b.value??b.accessToken??b.access_token??b.bearer??b.secret)}function m(a){let b=10;return a.has("operator.read")&&(b+=100),a.has("operator.write")&&(b+=200),a.has("operator.admin")&&(b+=30),a.has("operator.approvals")&&(b+=5),a.has("operator.pairing")&&(b+=5),b}function n(a,b){let c=l(a);return c?{token:c,score:m(a&&"object"==typeof a?k(a.scopes??a.scope):new Set),priority:b}:null}function o(a){return"win32"!==process.platform||a.endsWith(".cmd")?a:`${a}.cmd`}function p(){let a=(0,f.spawnSync)(o("openclaw"),["--version"],{stdio:"ignore",timeout:1500,shell:!1,windowsHide:!0});return!a.error&&0===a.status}function q(){if(!p())return!1;for(let a of[["openclaw","gateway","restart"],["openclaw","daemon","restart"]]){let[b,...c]=a;try{return(0,f.spawn)(o(b),c,{stdio:"ignore",detached:!0,shell:!1,windowsHide:!0}).unref(),!0}catch{}}return!1}function r(a){return a&&"object"==typeof a?a:null}async function s(){if("1"===process.env.CLAWPAD_SKIP_GATEWAY_AUTH_MIGRATION)return{updated:!1,restarted:!1,configPath:null};let a=(0,e.YJ)();if(!a)return{updated:!1,restarted:!1,configPath:null};let b="";try{b=await h().readFile(a,"utf-8")}catch{return{updated:!1,restarted:!1,configPath:a}}let c=(0,i.N)(b);if(!c.ok||!c.value||"object"!=typeof c.value)return{updated:!1,restarted:!1,configPath:a};let d=c.value,f=r(d.gateway),g=r(f?.auth);if(!f||!g||!Array.isArray(g.tokens))return{updated:!1,restarted:!1,configPath:a};let k=g.tokens.map((a,b)=>n(a,b)).filter(a=>!!a);k.sort((a,b)=>b.score-a.score||a.priority-b.priority);let l=j(g.token)??k[0]?.token;l&&(g.token=l),delete g.tokens,delete g.scope,delete g.scopes;try{await h().writeFile(a,`${JSON.stringify(d,null,2)}
|
|
2
|
-
`,"utf8")}catch{return{updated:!1,restarted:!1,configPath:a}}return{updated:!0,restarted:q(),configPath:a}}var t=c(69038);let u=!1,v=null;async function w(){return u?v??Promise.resolve():(u=!0,v=(async()=>{try{let a=await s();if(!a.updated)return;let b=a.restarted?"and restarted gateway":"restart required";console.warn(`[gateway-detect] Repaired unsupported gateway.auth.tokens config at ${a.configPath??"unknown path"} (${b}).`)}catch(a){console.warn("[gateway-detect] Gateway auth config repair failed:",a)}finally{v=null}})())}async function x(){let a=process.env.OPENCLAW_GATEWAY_URL,b=A(process.env.OPENCLAW_GATEWAY_TOKEN),c=process.env.OPENCLAW_AGENT_NAME;if(a)return{url:z(a),token:b||void 0,agentName:c||void 0,source:"env"};try{let a=await (0,t.r$)();if(a?.url)return{url:z(a.url),token:A(a.token)??b,agentName:c||void 0,source:"clawpad.override"}}catch{}try{await w();let a=(0,e.YJ)();if(a){let c=await (0,d.readFile)(a,"utf-8"),e=(0,i.N)(c),f=e.ok&&e.value&&"object"==typeof e.value?e.value:{},g=f.gateway?.port??f.port??18789,h=y(f.gateway?.bind??f.gateway?.host??f.host??"127.0.0.1");return{url:`http://${h}:${g}`,token:E(f.gateway?.auth)??b,agentName:f.name??f.agentName??void 0,source:a.includes("clawdbot.json")?"clawdbot.json":"openclaw.json"}}}catch{}return{url:"http://127.0.0.1:18789",token:void 0,agentName:void 0,source:"default"}}function y(a){return({loopback:"127.0.0.1",localhost:"127.0.0.1","0.0.0.0":"127.0.0.1","::":"127.0.0.1","::1":"127.0.0.1"})[a]??a}function z(a){return a.startsWith("http://")||a.startsWith("https://")?a.replace(/\/+$/,""):`http://${a}`}function A(a){if("string"==typeof a)return a.trim()||void 0}function B(a){let b=new Set,c=[];if("string"==typeof a)c.push(...a.split(/[,\s]+/g));else if(Array.isArray(a))for(let b of a)"string"==typeof b&&c.push(...b.split(/[,\s]+/g));for(let a of c){let c=a.trim().toLowerCase();c&&b.add(c)}return b}function C(a){let b=10;return a.has("operator.read")&&(b+=100),a.has("operator.write")&&(b+=200),a.has("operator.admin")&&(b+=30),a.has("operator.approvals")&&(b+=5),a.has("operator.pairing")&&(b+=5),b}function D(a){if("string"==typeof a)return A(a);if(!a||"object"!=typeof a)return;let b=a;if(!1!==b.enabled)return A(b.token??b.value??b.accessToken??b.access_token??b.bearer??b.secret)}function E(a){if(!a||"object"!=typeof a)return;let b=a,c=[],d=A(b.token);if(d){let a=B(b.scopes??b.scope);c.push({token:d,score:a.size>0?C(a)+30:50,priority:0})}let e=Array.isArray(b.tokens)?b.tokens:[];for(let a=0;a<e.length;a+=1){let b=e[a],d=D(b);if(!d)continue;let f=b&&"object"==typeof b?B(b.scopes??b.scope):new Set;c.push({token:d,score:f.size>0?C(f):25,priority:a+1})}if(0!==c.length)return c.sort((a,b)=>b.score-a.score||a.priority-b.priority),c[0]?.token}},21642:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function loadOptionalJson5(){try{let req=eval("require"),mod=req("json5");if(mod&&"function"==typeof mod.parse)return mod}catch{}return null}function stripComments(a){let b="",c=!1,d="",e=!1,f=!1,g=!1;for(let h=0;h<a.length;h+=1){let i=a[h],j=a[h+1];if(e){"\n"===i&&(e=!1,b+=i);continue}if(f){"*"===i&&"/"===j&&(f=!1,h+=1);continue}if(c){if(b+=i,g){g=!1;continue}if("\\"===i){g=!0;continue}i===d&&(c=!1,d="");continue}if('"'===i||"'"===i){c=!0,d=i,b+=i;continue}if("/"===i&&"/"===j){e=!0,h+=1;continue}if("/"===i&&"*"===j){f=!0,h+=1;continue}b+=i}return b}function stripTrailingCommas(a){let b="",c=!1,d="",e=!1;for(let f=0;f<a.length;f+=1){let g=a[f];if(c){if(b+=g,e){e=!1;continue}if("\\"===g){e=!0;continue}g===d&&(c=!1,d="");continue}if('"'===g||"'"===g){c=!0,d=g,b+=g;continue}if(","===g){let b=f+1;for(;b<a.length&&/\s/.test(a[b]);)b+=1;let c=a[b];if("}"===c||"]"===c)continue}b+=g}return b}function parseJsonFallback(a){try{return{ok:!0,value:JSON.parse(a)}}catch{}try{let b=stripTrailingCommas(stripComments(a));return{ok:!0,value:JSON.parse(b)}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function parseOpenClawConfig(a){let b=loadOptionalJson5();if(b)try{return{ok:!0,value:b.parse(a)}}catch{}return parseJsonFallback(a)}__webpack_require__.d(__webpack_exports__,{N:()=>parseOpenClawConfig})},27843:(a,b,c)=>{"use strict";c.d(b,{We:()=>p,YJ:()=>q,l5:()=>r});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h),j=c(21642);let k=[".clawdbot"],l=["openclaw.json","clawdbot.json"];function m(a=process.env){return[...new Set([a.APPDATA?g().join(a.APPDATA,"OpenClaw"):null,a.APPDATA?g().join(a.APPDATA,"openclaw"):null,a.LOCALAPPDATA?g().join(a.LOCALAPPDATA,"OpenClaw"):null,a.LOCALAPPDATA?g().join(a.LOCALAPPDATA,"openclaw"):null,g().join(i().homedir(),"AppData","Roaming","OpenClaw"),g().join(i().homedir(),"AppData","Roaming","openclaw")].filter(a=>!!(a&&a.trim())).map(a=>g().resolve(a)))]}function n(a){let b=a.trim();return b?b.startsWith("~")?g().resolve(b.replace(/^~(?=$|[\\/])/,i().homedir())):g().resolve(b):b}function o(a){try{return e().existsSync(a)}catch{return!1}}function p(a=process.env){let b=a.OPENCLAW_STATE_DIR||a.CLAWDBOT_STATE_DIR;if(b&&b.trim())return n(b);if("win32"===process.platform){let b=m(a).find(a=>o(a));if(b)return b}return g().join(i().homedir(),".openclaw")}function q(a=process.env){let b=a.OPENCLAW_CONFIG_PATH||a.CLAWDBOT_CONFIG_PATH;if(b&&b.trim()){let a=n(b);return o(a)?a:null}let c=p(a),d="win32"===process.platform?m(a):[];for(let a of[...l.map(a=>g().join(c,a)),...d.flatMap(a=>l.map(b=>g().join(a,b))),g().join(i().homedir(),".openclaw","openclaw.json"),...k.map(a=>g().join(i().homedir(),a,"clawdbot.json"))])if(o(a))return a;return null}function r(a=process.env){let b=q(a);if(!b)return{path:null,config:null};try{let a=e().readFileSync(b,"utf-8"),c=(0,j.N)(a);if(c.ok&&c.value&&"object"==typeof c.value)return{path:b,config:c.value}}catch{}return{path:b,config:null}}},48421:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>m});var e=c(56220),f=c(4526),g=c(94615),h=a([e]);function i(a){if(!a)return null;let b=a.replace(/^ws/i,"http");try{return new URL(b).origin}catch{return null}}function j(a){return"string"==typeof a&&a.trim()?a.trim().toUpperCase():"number"==typeof a&&Number.isFinite(a)?String(a):null}function k(a){if(!a||"object"!=typeof a)return{code:null,message:"connect rejected"};let b=a,c=j(b.code),d="string"==typeof b.message&&b.message.trim()?b.message.trim():"connect rejected";return{code:c,message:d}}function l(a,b){if(!b)return!1;if("NOT_PAIRED"===a||"AUTH_REQUIRED"===a||"UNAUTHORIZED"===a)return!0;let c=b.toLowerCase();return c.includes("device identity required")||c.includes("not paired")}async function m(a){let b=await (0,f.detectGateway)();if(!b)throw Error("No gateway configuration found");let c=b.url.replace(/^http/,"ws"),d=i(b.url),h=a.timeoutMs??1e4,j="operator",m=["operator.read","operator.write","operator.admin"],n=(0,g.aZ)(),o=(0,g.vM)({deviceId:n.deviceId,role:j,gatewayUrl:b.url,requiredScopes:g.qq})?.token,p="string"==typeof b.token&&b.token.trim()?b.token.trim():void 0;class q extends Error{}let r=[];o&&r.push({token:o,source:"stored"}),o&&o===p||r.push({token:p,source:"config"}),0===r.length&&r.push({token:void 0,source:"config"});let s=async(f,i)=>new Promise((o,p)=>{let r,s=0,t=!1,u=setTimeout(()=>{if(!t){t=!0;try{r?.close()}catch{}p(Error("Gateway request timed out"))}},h);function v(a,b){if(!t){t=!0,clearTimeout(u);try{r?.close()}catch{}a?p(a):o(b)}}try{r=new e.default(c,d?{origin:d}:void 0)}catch(a){clearTimeout(u),p(Error(`Failed to create WebSocket: ${a}`));return}r.on("close",()=>{v(Error("WebSocket closed before response"))}),r.on("error",a=>{v(Error(`WebSocket error: ${a.message}`))}),r.on("message",c=>{let d;try{d=JSON.parse(String(c))}catch{return}if("event"===d.type&&"connect.challenge"===d.event){let a=d.payload&&"object"==typeof d.payload?d.payload:void 0,b="string"==typeof a?.nonce?a.nonce:void 0,c=(0,g.n3)({identity:n,clientId:"webchat-ui",clientMode:"webchat",role:j,scopes:m,token:f,nonce:b}),e={type:"req",id:String(++s),method:"connect",params:{minProtocol:3,maxProtocol:3,client:{id:"webchat-ui",version:"clawpad",platform:"web",mode:"webchat"},role:j,scopes:m,caps:[],commands:[],permissions:{},auth:f?{token:f}:{},device:c}};r.send(JSON.stringify(e));return}if("res"===d.type&&d.id===String(s)&&1===s){if(!d.ok){let{code:a,message:c}=k(d.error);if("stored"===i&&l(a,c)){(0,g.Sm)({deviceId:n.deviceId,role:j,gatewayUrl:b.url,includeLegacyRoleEntry:!0}),v(new q(`Gateway connect rejected for cached device token (${c}). Retrying with configured token.`));return}return"NOT_PAIRED"===a?void v(Error("Gateway pairing required. Approve this ClawPad device in OpenClaw, then reconnect.")):void v(Error(`Gateway connect rejected: ${JSON.stringify(d.error)}`))}let c=d.payload&&"object"==typeof d.payload?d.payload:void 0,e="string"==typeof c?.auth?.deviceToken?c.auth.deviceToken:null,f="string"==typeof c?.auth?.role?c.auth.role:j,h=Array.isArray(c?.auth?.scopes)?c.auth.scopes.filter(a=>"string"==typeof a):[],m=!(h.length>0)||(0,g.PP)(h,g.qq);if(e&&m&&(0,g.HQ)({deviceId:n.deviceId,role:f,token:e,scopes:h,gatewayUrl:b.url}),!m){let a=new Set(h.map(a=>a.toLowerCase()));(0,g.Sm)({deviceId:n.deviceId,role:f,gatewayUrl:b.url,includeLegacyRoleEntry:!0});let c=g.qq.filter(b=>!a.has(b)),d=`Gateway connect rejected: missing scope(s) ${c.join(", ")||"unknown"}. Run \`openclaw doctor --generate-gateway-token\`, \`openclaw gateway restart\`, then restart ClawPad.`;"stored"===i?v(new q(d)):v(Error(d));return}let o={type:"req",id:String(++s),method:a.method,params:a.params??{}};return void r.send(JSON.stringify(o))}if("res"===d.type&&d.id===String(s)&&2===s)return d.ok?void v(null,d.payload):void v(Error(`Gateway RPC error: ${JSON.stringify(d.error)}`))})}),t=null;for(let a of r)try{return await s(a.token,a.source)}catch(a){if(a instanceof q){t=a;continue}t=a instanceof Error?a:Error(String(a));break}throw t??Error("Gateway request failed")}e=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},69038:(a,b,c)=>{"use strict";c.d(b,{I3:()=>n,ij:()=>m,r$:()=>l});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(27843);function i(a){if("string"!=typeof a)return null;let b=a.trim();return b?(b.startsWith("http://")||b.startsWith("https://")?b:`http://${b}`).replace(/\/+$/g,""):null}function j(a){if("string"==typeof a)return a.trim()||void 0}function k(a=process.env){return g().join((0,h.We)(a),"clawpad","gateway-override.json")}async function l(a=process.env){let b=k(a);try{let a=await e().readFile(b,"utf-8"),c=JSON.parse(a),d=i(c?.url);if(c?.version!==1||!d)return null;let f=j(c?.token),g="string"==typeof c?.updatedAt&&c.updatedAt.trim()?c.updatedAt:new Date().toISOString();return{version:1,url:d,...f?{token:f}:{},updatedAt:g}}catch{return null}}async function m(a,b=process.env){let c=i(a.url);if(!c)throw Error("Gateway URL is required");let d=j(a.token),f={version:1,url:c,...d?{token:d}:{},updatedAt:new Date().toISOString()},h=k(b);await e().mkdir(g().dirname(h),{recursive:!0}),await e().writeFile(h,`${JSON.stringify(f,null,2)}
|
|
2
|
+
`,"utf8")}catch{return{updated:!1,restarted:!1,configPath:a}}return{updated:!0,restarted:q(),configPath:a}}var t=c(69038);let u=!1,v=null;async function w(){return u?v??Promise.resolve():(u=!0,v=(async()=>{try{let a=await s();if(!a.updated)return;let b=a.restarted?"and restarted gateway":"restart required";console.warn(`[gateway-detect] Repaired unsupported gateway.auth.tokens config at ${a.configPath??"unknown path"} (${b}).`)}catch(a){console.warn("[gateway-detect] Gateway auth config repair failed:",a)}finally{v=null}})())}async function x(){let a=process.env.OPENCLAW_GATEWAY_URL,b=A(process.env.OPENCLAW_GATEWAY_TOKEN),c=process.env.OPENCLAW_AGENT_NAME;if(a)return{url:z(a),token:b||void 0,agentName:c||void 0,source:"env"};try{let a=await (0,t.r$)();if(a?.url)return{url:z(a.url),token:A(a.token)??b,agentName:c||void 0,source:"clawpad.override"}}catch{}try{await w();let a=(0,e.YJ)();if(a){let c=await (0,d.readFile)(a,"utf-8"),e=(0,i.N)(c),f=e.ok&&e.value&&"object"==typeof e.value?e.value:{},g=f.gateway?.port??f.port??18789,h=y(f.gateway?.bind??f.gateway?.host??f.host??"127.0.0.1");return{url:`http://${h}:${g}`,token:E(f.gateway?.auth)??b,agentName:f.name??f.agentName??void 0,source:a.includes("clawdbot.json")?"clawdbot.json":"openclaw.json"}}}catch{}return{url:"http://127.0.0.1:18789",token:void 0,agentName:void 0,source:"default"}}function y(a){return({loopback:"127.0.0.1",localhost:"127.0.0.1","0.0.0.0":"127.0.0.1","::":"127.0.0.1","::1":"127.0.0.1"})[a]??a}function z(a){return a.startsWith("http://")||a.startsWith("https://")?a.replace(/\/+$/,""):`http://${a}`}function A(a){if("string"==typeof a)return a.trim()||void 0}function B(a){let b=new Set,c=[];if("string"==typeof a)c.push(...a.split(/[,\s]+/g));else if(Array.isArray(a))for(let b of a)"string"==typeof b&&c.push(...b.split(/[,\s]+/g));for(let a of c){let c=a.trim().toLowerCase();c&&b.add(c)}return b}function C(a){let b=10;return a.has("operator.read")&&(b+=100),a.has("operator.write")&&(b+=200),a.has("operator.admin")&&(b+=30),a.has("operator.approvals")&&(b+=5),a.has("operator.pairing")&&(b+=5),b}function D(a){if("string"==typeof a)return A(a);if(!a||"object"!=typeof a)return;let b=a;if(!1!==b.enabled)return A(b.token??b.value??b.accessToken??b.access_token??b.bearer??b.secret)}function E(a){if(!a||"object"!=typeof a)return;let b=a,c=[],d=A(b.token);if(d){let a=B(b.scopes??b.scope);c.push({token:d,score:a.size>0?C(a)+30:50,priority:0})}let e=Array.isArray(b.tokens)?b.tokens:[];for(let a=0;a<e.length;a+=1){let b=e[a],d=D(b);if(!d)continue;let f=b&&"object"==typeof b?B(b.scopes??b.scope):new Set;c.push({token:d,score:f.size>0?C(f):25,priority:a+1})}if(0!==c.length)return c.sort((a,b)=>b.score-a.score||a.priority-b.priority),c[0]?.token}},21642:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function loadOptionalJson5(){try{let req=eval("require"),mod=req("json5");if(mod&&"function"==typeof mod.parse)return mod}catch{}return null}function stripComments(a){let b="",c=!1,d="",e=!1,f=!1,g=!1;for(let h=0;h<a.length;h+=1){let i=a[h],j=a[h+1];if(e){"\n"===i&&(e=!1,b+=i);continue}if(f){"*"===i&&"/"===j&&(f=!1,h+=1);continue}if(c){if(b+=i,g){g=!1;continue}if("\\"===i){g=!0;continue}i===d&&(c=!1,d="");continue}if('"'===i||"'"===i){c=!0,d=i,b+=i;continue}if("/"===i&&"/"===j){e=!0,h+=1;continue}if("/"===i&&"*"===j){f=!0,h+=1;continue}b+=i}return b}function stripTrailingCommas(a){let b="",c=!1,d="",e=!1;for(let f=0;f<a.length;f+=1){let g=a[f];if(c){if(b+=g,e){e=!1;continue}if("\\"===g){e=!0;continue}g===d&&(c=!1,d="");continue}if('"'===g||"'"===g){c=!0,d=g,b+=g;continue}if(","===g){let b=f+1;for(;b<a.length&&/\s/.test(a[b]);)b+=1;let c=a[b];if("}"===c||"]"===c)continue}b+=g}return b}function parseJsonFallback(a){try{return{ok:!0,value:JSON.parse(a)}}catch{}try{let b=stripTrailingCommas(stripComments(a));return{ok:!0,value:JSON.parse(b)}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function parseOpenClawConfig(a){let b=loadOptionalJson5();if(b)try{return{ok:!0,value:b.parse(a)}}catch{}return parseJsonFallback(a)}__webpack_require__.d(__webpack_exports__,{N:()=>parseOpenClawConfig})},27843:(a,b,c)=>{"use strict";c.d(b,{We:()=>p,YJ:()=>q,l5:()=>r});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h),j=c(21642);let k=[".clawdbot"],l=["openclaw.json","clawdbot.json"];function m(a=process.env){return[...new Set([a.APPDATA?g().join(a.APPDATA,"OpenClaw"):null,a.APPDATA?g().join(a.APPDATA,"openclaw"):null,a.LOCALAPPDATA?g().join(a.LOCALAPPDATA,"OpenClaw"):null,a.LOCALAPPDATA?g().join(a.LOCALAPPDATA,"openclaw"):null,g().join(i().homedir(),"AppData","Roaming","OpenClaw"),g().join(i().homedir(),"AppData","Roaming","openclaw")].filter(a=>!!(a&&a.trim())).map(a=>g().resolve(a)))]}function n(a){let b=a.trim();return b?b.startsWith("~")?g().resolve(b.replace(/^~(?=$|[\\/])/,i().homedir())):g().resolve(b):b}function o(a){try{return e().existsSync(a)}catch{return!1}}function p(a=process.env){let b=a.OPENCLAW_STATE_DIR||a.CLAWDBOT_STATE_DIR;if(b&&b.trim())return n(b);if("win32"===process.platform){let b=m(a).find(a=>o(a));if(b)return b}return g().join(i().homedir(),".openclaw")}function q(a=process.env){let b=a.OPENCLAW_CONFIG_PATH||a.CLAWDBOT_CONFIG_PATH;if(b&&b.trim()){let a=n(b);return o(a)?a:null}let c=p(a),d="win32"===process.platform?m(a):[];for(let a of[...l.map(a=>g().join(c,a)),...d.flatMap(a=>l.map(b=>g().join(a,b))),g().join(i().homedir(),".openclaw","openclaw.json"),...k.map(a=>g().join(i().homedir(),a,"clawdbot.json"))])if(o(a))return a;return null}function r(a=process.env){let b=q(a);if(!b)return{path:null,config:null};try{let a=e().readFileSync(b,"utf-8"),c=(0,j.N)(a);if(c.ok&&c.value&&"object"==typeof c.value)return{path:b,config:c.value}}catch{}return{path:b,config:null}}},48421:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>n});var e=c(56220),f=c(4526),g=c(94615),h=a([e]);function i(a){if(!a)return null;let b=a.replace(/^ws/i,"http");try{return new URL(b).origin}catch{return null}}function j(a){return"string"==typeof a&&a.trim()?a.trim().toUpperCase():"number"==typeof a&&Number.isFinite(a)?String(a):null}function k(a){if(!a||"object"!=typeof a)return{code:null,message:"connect rejected"};let b=a,c=j(b.code),d="string"==typeof b.message&&b.message.trim()?b.message.trim():"connect rejected";return{code:c,message:d}}function l(a){if(!a||"object"!=typeof a)return null;let b=a;return b.details&&"object"==typeof b.details?b.details:b.data&&"object"==typeof b.data&&"details"in b.data&&"object"==typeof b.data.details?b.data.details:null}function m(a,b){if(!b)return!1;if("NOT_PAIRED"===a||"AUTH_REQUIRED"===a||"UNAUTHORIZED"===a)return!0;let c=b.toLowerCase();return c.includes("device identity required")||c.includes("not paired")}async function n(a){let b=await (0,f.detectGateway)();if(!b)throw Error("No gateway configuration found");let c=b.url.replace(/^http/,"ws"),d=i(b.url),h=a.timeoutMs??1e4,j="operator",n=["operator.read","operator.write","operator.admin"],o=(0,g.aZ)(),p=(0,g.vM)({deviceId:o.deviceId,role:j,gatewayUrl:b.url,requiredScopes:g.qq})?.token,q="string"==typeof b.token&&b.token.trim()?b.token.trim():void 0;class r extends Error{}let s=[];p&&s.push({token:p,source:"stored"}),p&&p===q||s.push({token:q,source:"config"}),0===s.length&&s.push({token:void 0,source:"config"});let t=async(f,i)=>new Promise((p,s)=>{let t,u=0,v=!1,w=setTimeout(()=>{if(!v){v=!0;try{t?.close()}catch{}s(Error("Gateway request timed out"))}},h);function x(a,b){if(!v){v=!0,clearTimeout(w);try{t?.close()}catch{}a?s(a):p(b)}}try{t=new e.default(c,d?{origin:d}:void 0)}catch(a){clearTimeout(w),s(Error(`Failed to create WebSocket: ${a}`));return}t.on("close",()=>{x(Error("WebSocket closed before response"))}),t.on("error",a=>{x(Error(`WebSocket error: ${a.message}`))}),t.on("message",c=>{let d;try{d=JSON.parse(String(c))}catch{return}if("event"===d.type&&"connect.challenge"===d.event){let a=d.payload&&"object"==typeof d.payload?d.payload:void 0,b="string"==typeof a?.nonce?a.nonce:void 0,c=(0,g.n3)({identity:o,clientId:"webchat-ui",clientMode:"webchat",role:j,scopes:n,token:f,nonce:b}),e={type:"req",id:String(++u),method:"connect",params:{minProtocol:3,maxProtocol:3,client:{id:"webchat-ui",version:"clawpad",platform:"web",mode:"webchat"},role:j,scopes:n,caps:[],commands:[],permissions:{},auth:f?{token:f}:{},device:c}};t.send(JSON.stringify(e));return}if("res"===d.type&&d.id===String(u)&&1===u){if(!d.ok){let{code:a,message:c}=k(d.error),e=l(d.error),f="string"==typeof e?.code?e.code.trim().toUpperCase():"",h="string"==typeof e?.requestId&&e.requestId.trim()?e.requestId.trim():null;if("stored"===i&&m(a,c)){(0,g.Sm)({deviceId:o.deviceId,role:j,gatewayUrl:b.url,includeLegacyRoleEntry:!0}),x(new r(`Gateway connect rejected for cached device token (${c}). Retrying with configured token.`));return}return"NOT_PAIRED"===a?"DEVICE_IDENTITY_REQUIRED"===f?void x(Error(q?"Gateway requires device identity. Restart ClawPad to retry device identity handshake.":"Gateway requires device identity and no gateway token was detected. Update OpenClaw gateway auth and restart.")):void x(Error(h?`Gateway pairing required (request ${h}). Approve this ClawPad device in OpenClaw, then reconnect.`:"Gateway pairing required. Approve this ClawPad device in OpenClaw, then reconnect.")):void x(Error(`Gateway connect rejected: ${JSON.stringify(d.error)}`))}let c=d.payload&&"object"==typeof d.payload?d.payload:void 0,e="string"==typeof c?.auth?.deviceToken?c.auth.deviceToken:null,f="string"==typeof c?.auth?.role?c.auth.role:j,h=Array.isArray(c?.auth?.scopes)?c.auth.scopes.filter(a=>"string"==typeof a):[],n=!(h.length>0)||(0,g.PP)(h,g.qq);if(e&&n&&(0,g.HQ)({deviceId:o.deviceId,role:f,token:e,scopes:h,gatewayUrl:b.url}),!n){let a=new Set(h.map(a=>a.toLowerCase()));(0,g.Sm)({deviceId:o.deviceId,role:f,gatewayUrl:b.url,includeLegacyRoleEntry:!0});let c=g.qq.filter(b=>!a.has(b)),d=`Gateway connect rejected: missing scope(s) ${c.join(", ")||"unknown"}. Run \`openclaw doctor --generate-gateway-token\`, \`openclaw gateway restart\`, then restart ClawPad.`;"stored"===i?x(new r(d)):x(Error(d));return}let p={type:"req",id:String(++u),method:a.method,params:a.params??{}};return void t.send(JSON.stringify(p))}if("res"===d.type&&d.id===String(u)&&2===u)return d.ok?void x(null,d.payload):void x(Error(`Gateway RPC error: ${JSON.stringify(d.error)}`))})}),u=null;for(let a of s)try{return await t(a.token,a.source)}catch(a){if(a instanceof r){u=a;continue}u=a instanceof Error?a:Error(String(a));break}throw u??Error("Gateway request failed")}e=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},69038:(a,b,c)=>{"use strict";c.d(b,{I3:()=>n,ij:()=>m,r$:()=>l});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(27843);function i(a){if("string"!=typeof a)return null;let b=a.trim();return b?(b.startsWith("http://")||b.startsWith("https://")?b:`http://${b}`).replace(/\/+$/g,""):null}function j(a){if("string"==typeof a)return a.trim()||void 0}function k(a=process.env){return g().join((0,h.We)(a),"clawpad","gateway-override.json")}async function l(a=process.env){let b=k(a);try{let a=await e().readFile(b,"utf-8"),c=JSON.parse(a),d=i(c?.url);if(c?.version!==1||!d)return null;let f=j(c?.token),g="string"==typeof c?.updatedAt&&c.updatedAt.trim()?c.updatedAt:new Date().toISOString();return{version:1,url:d,...f?{token:f}:{},updatedAt:g}}catch{return null}}async function m(a,b=process.env){let c=i(a.url);if(!c)throw Error("Gateway URL is required");let d=j(a.token),f={version:1,url:c,...d?{token:d}:{},updatedAt:new Date().toISOString()},h=k(b);await e().mkdir(g().dirname(h),{recursive:!0}),await e().writeFile(h,`${JSON.stringify(f,null,2)}
|
|
3
3
|
`,{mode:384});try{await e().chmod(h,384)}catch{}return f}async function n(a=process.env){let b=k(a);try{await e().unlink(b)}catch{}}},78335:()=>{},96487:()=>{}};
|