nextclaw 0.52.0 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cli/app/index.js +1 -1
  2. package/dist/{nextclaw-cli-app-Br9GLB2U.js → nextclaw-cli-app-npOWL5Nm.js} +5 -2
  3. package/dist/nextclaw-cli-app-npOWL5Nm.js.map +1 -0
  4. package/package.json +9 -9
  5. package/ui-dist/.vite/manifest.json +22 -22
  6. package/ui-dist/.vite/manifest.json.gz +0 -0
  7. package/ui-dist/assets/{account-panel-BXTCFv7d.js → account-panel-BW4GbzQd.js} +1 -1
  8. package/ui-dist/assets/account-panel-BW4GbzQd.js.gz +0 -0
  9. package/ui-dist/assets/app-presenter-provider-CBZ_-ewx.js +115 -0
  10. package/ui-dist/assets/app-presenter-provider-CBZ_-ewx.js.gz +0 -0
  11. package/ui-dist/assets/{appearance-settings-page-83T2AtVm.js → appearance-settings-page-C-uZ2Wkf.js} +1 -1
  12. package/ui-dist/assets/appearance-settings-page-C-uZ2Wkf.js.gz +0 -0
  13. package/ui-dist/assets/{keyboard-shortcuts-settings-page-CkQbSKwI.js → keyboard-shortcuts-settings-page-CScSXYS4.js} +1 -1
  14. package/ui-dist/assets/main-DMNmwcJE.js +2 -0
  15. package/ui-dist/assets/main-DMNmwcJE.js.gz +0 -0
  16. package/ui-dist/assets/{projects-O3GTERwP.js → projects-Voql-cvx.js} +1 -1
  17. package/ui-dist/assets/projects-Voql-cvx.js.gz +0 -0
  18. package/ui-dist/assets/{pwa-D_nZUwG0.js → pwa-CzqfYjFx.js} +1 -1
  19. package/ui-dist/assets/pwa-CzqfYjFx.js.gz +0 -0
  20. package/ui-dist/assets/remote-BekqL5nA.js +1 -0
  21. package/ui-dist/assets/{runtime-config-page-BHTKwgDi.js → runtime-config-page-BH9uF4u_.js} +1 -1
  22. package/ui-dist/assets/runtime-config-page-BH9uF4u_.js.gz +0 -0
  23. package/ui-dist/index.html +3 -3
  24. package/ui-dist/index.html.gz +0 -0
  25. package/dist/nextclaw-cli-app-Br9GLB2U.js.map +0 -1
  26. package/ui-dist/assets/account-panel-BXTCFv7d.js.gz +0 -0
  27. package/ui-dist/assets/app-presenter-provider-V0xnU_Wb.js +0 -115
  28. package/ui-dist/assets/app-presenter-provider-V0xnU_Wb.js.gz +0 -0
  29. package/ui-dist/assets/appearance-settings-page-83T2AtVm.js.gz +0 -0
  30. package/ui-dist/assets/main-ky5Efhq1.js +0 -2
  31. package/ui-dist/assets/main-ky5Efhq1.js.gz +0 -0
  32. package/ui-dist/assets/projects-O3GTERwP.js.gz +0 -0
  33. package/ui-dist/assets/pwa-D_nZUwG0.js.gz +0 -0
  34. package/ui-dist/assets/remote-CFWp4wyH.js +0 -1
  35. package/ui-dist/assets/runtime-config-page-BHTKwgDi.js.gz +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextclaw",
3
- "version": "0.52.0",
3
+ "version": "0.52.1",
4
4
  "description": "Powerful AI assistant for coordinating agents, skills, CLI tools, automations, and messaging apps.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -44,22 +44,22 @@
44
44
  "commander": "^12.1.0",
45
45
  "jszip": "^3.10.1",
46
46
  "yaml": "^2.8.1",
47
+ "@nextclaw/kernel": "0.17.3",
47
48
  "@nextclaw/app-runtime": "0.16.6",
48
49
  "@nextclaw/core": "0.17.22",
49
- "@nextclaw/kernel": "0.17.2",
50
- "@nextclaw/ncp-agent-runtime": "0.4.24",
51
- "@nextclaw/ncp": "0.11.0",
52
50
  "@nextclaw/mcp": "0.3.49",
51
+ "@nextclaw/ncp": "0.11.0",
52
+ "@nextclaw/ncp-agent-runtime": "0.4.24",
53
53
  "@nextclaw/ncp-mcp": "0.2.49",
54
54
  "@nextclaw/ncp-toolkit": "0.6.25",
55
55
  "@nextclaw/nextclaw-hermes-acp-bridge": "0.3.22",
56
56
  "@nextclaw/nextclaw-ncp-runtime-http-client": "0.3.23",
57
+ "@nextclaw/remote": "0.3.62",
57
58
  "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.3.49",
58
- "@nextclaw/remote": "0.3.61",
59
59
  "@nextclaw/runtime": "0.4.48",
60
- "@nextclaw/server": "0.23.4",
61
- "@nextclaw/shared": "0.7.0",
62
- "@nextclaw/service": "0.6.7"
60
+ "@nextclaw/service": "0.6.8",
61
+ "@nextclaw/server": "0.23.5",
62
+ "@nextclaw/shared": "0.7.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@types/node": "^20.17.6",
@@ -67,7 +67,7 @@
67
67
  "tsx": "^4.19.2",
68
68
  "typescript": "^5.6.3",
69
69
  "vitest": "^4.1.2",
70
- "@nextclaw/ui": "0.25.3"
70
+ "@nextclaw/ui": "0.25.4"
71
71
  },
72
72
  "scripts": {
73
73
  "dev": "tsx watch --tsconfig ../../scripts/dev/dev-runtime.tsconfig.json src/cli/app/index.ts",
@@ -1217,8 +1217,8 @@
1217
1217
  "_i18n-20rSH40D.js"
1218
1218
  ]
1219
1219
  },
1220
- "_app-presenter-provider-V0xnU_Wb.js": {
1221
- "file": "assets/app-presenter-provider-V0xnU_Wb.js",
1220
+ "_app-presenter-provider-CBZ_-ewx.js": {
1221
+ "file": "assets/app-presenter-provider-CBZ_-ewx.js",
1222
1222
  "name": "app-presenter-provider",
1223
1223
  "imports": [
1224
1224
  "_chunk-DF37yw5_.js",
@@ -2167,11 +2167,11 @@
2167
2167
  "_createLucideIcon-BNKf0_kc.js"
2168
2168
  ]
2169
2169
  },
2170
- "_pwa-D_nZUwG0.js": {
2171
- "file": "assets/pwa-D_nZUwG0.js",
2170
+ "_pwa-CzqfYjFx.js": {
2171
+ "file": "assets/pwa-CzqfYjFx.js",
2172
2172
  "name": "pwa",
2173
2173
  "imports": [
2174
- "_app-presenter-provider-V0xnU_Wb.js",
2174
+ "_app-presenter-provider-CBZ_-ewx.js",
2175
2175
  "_api-DqzQ-_3w.js",
2176
2176
  "_utils-CBZPzC_b.js",
2177
2177
  "_createLucideIcon-BNKf0_kc.js",
@@ -2346,7 +2346,7 @@
2346
2346
  ]
2347
2347
  },
2348
2348
  "index.html": {
2349
- "file": "assets/main-ky5Efhq1.js",
2349
+ "file": "assets/main-DMNmwcJE.js",
2350
2350
  "name": "main",
2351
2351
  "src": "index.html",
2352
2352
  "isEntry": true,
@@ -2354,7 +2354,7 @@
2354
2354
  "_chunk-DF37yw5_.js",
2355
2355
  "_client-BtGBwLTs.js",
2356
2356
  "_preload-helper-ca-nBW7U.js",
2357
- "_app-presenter-provider-V0xnU_Wb.js",
2357
+ "_app-presenter-provider-CBZ_-ewx.js",
2358
2358
  "_select-CG5YWnwe.js",
2359
2359
  "_dialog-Xe73hpQz.js",
2360
2360
  "_popover-NkrFlWHp.js",
@@ -2372,7 +2372,7 @@
2372
2372
  "_plus-LA8-jpxP.js",
2373
2373
  "_theme-provider-DzvAi3pe.js",
2374
2374
  "_settings-2-CE3ELQyk.js",
2375
- "_pwa-D_nZUwG0.js",
2375
+ "_pwa-CzqfYjFx.js",
2376
2376
  "_confirm-dialog-BTKCWMn6.js",
2377
2377
  "_trash-2-BPPYt2NV.js",
2378
2378
  "_i18n-provider-BPRq6S7O.js",
@@ -2399,7 +2399,7 @@
2399
2399
  "src/features/settings/pages/secrets-config-page.tsx",
2400
2400
  "src/features/settings/pages/privacy-settings-page.tsx",
2401
2401
  "src/features/desktop-capabilities/pages/desktop-capabilities-page.tsx",
2402
- "_app-presenter-provider-V0xnU_Wb.js",
2402
+ "_app-presenter-provider-CBZ_-ewx.js",
2403
2403
  "_mcp-marketplace-page-FfIfEo6w.js"
2404
2404
  ],
2405
2405
  "css": [
@@ -2429,13 +2429,13 @@
2429
2429
  ]
2430
2430
  },
2431
2431
  "src/features/account/components/account-panel.tsx": {
2432
- "file": "assets/account-panel-BXTCFv7d.js",
2432
+ "file": "assets/account-panel-BW4GbzQd.js",
2433
2433
  "name": "account-panel",
2434
2434
  "src": "src/features/account/components/account-panel.tsx",
2435
2435
  "isDynamicEntry": true,
2436
2436
  "imports": [
2437
2437
  "_chunk-DF37yw5_.js",
2438
- "_app-presenter-provider-V0xnU_Wb.js",
2438
+ "_app-presenter-provider-CBZ_-ewx.js",
2439
2439
  "_dialog-Xe73hpQz.js",
2440
2440
  "_api-DqzQ-_3w.js",
2441
2441
  "_mcp-marketplace-page-FfIfEo6w.js",
@@ -2518,13 +2518,13 @@
2518
2518
  ]
2519
2519
  },
2520
2520
  "src/features/projects/index.ts": {
2521
- "file": "assets/projects-O3GTERwP.js",
2521
+ "file": "assets/projects-Voql-cvx.js",
2522
2522
  "name": "projects",
2523
2523
  "src": "src/features/projects/index.ts",
2524
2524
  "isDynamicEntry": true,
2525
2525
  "imports": [
2526
2526
  "_chunk-DF37yw5_.js",
2527
- "_app-presenter-provider-V0xnU_Wb.js",
2527
+ "_app-presenter-provider-CBZ_-ewx.js",
2528
2528
  "_select-CG5YWnwe.js",
2529
2529
  "_dialog-Xe73hpQz.js",
2530
2530
  "_api-DqzQ-_3w.js",
@@ -2547,12 +2547,12 @@
2547
2547
  ]
2548
2548
  },
2549
2549
  "src/features/remote/index.ts": {
2550
- "file": "assets/remote-CFWp4wyH.js",
2550
+ "file": "assets/remote-BekqL5nA.js",
2551
2551
  "name": "remote",
2552
2552
  "src": "src/features/remote/index.ts",
2553
2553
  "isDynamicEntry": true,
2554
2554
  "imports": [
2555
- "_app-presenter-provider-V0xnU_Wb.js"
2555
+ "_app-presenter-provider-CBZ_-ewx.js"
2556
2556
  ]
2557
2557
  },
2558
2558
  "src/features/service-apps/components/service-apps-panel.tsx": {
@@ -2579,13 +2579,13 @@
2579
2579
  ]
2580
2580
  },
2581
2581
  "src/features/settings/pages/appearance-settings-page.tsx": {
2582
- "file": "assets/appearance-settings-page-83T2AtVm.js",
2582
+ "file": "assets/appearance-settings-page-C-uZ2Wkf.js",
2583
2583
  "name": "appearance-settings-page",
2584
2584
  "src": "src/features/settings/pages/appearance-settings-page.tsx",
2585
2585
  "isDynamicEntry": true,
2586
2586
  "imports": [
2587
2587
  "_chunk-DF37yw5_.js",
2588
- "_app-presenter-provider-V0xnU_Wb.js",
2588
+ "_app-presenter-provider-CBZ_-ewx.js",
2589
2589
  "_select-CG5YWnwe.js",
2590
2590
  "_api-DqzQ-_3w.js",
2591
2591
  "_utils-CBZPzC_b.js",
@@ -2596,12 +2596,12 @@
2596
2596
  ]
2597
2597
  },
2598
2598
  "src/features/settings/pages/keyboard-shortcuts-settings-page.tsx": {
2599
- "file": "assets/keyboard-shortcuts-settings-page-CkQbSKwI.js",
2599
+ "file": "assets/keyboard-shortcuts-settings-page-CScSXYS4.js",
2600
2600
  "name": "keyboard-shortcuts-settings-page",
2601
2601
  "src": "src/features/settings/pages/keyboard-shortcuts-settings-page.tsx",
2602
2602
  "isDynamicEntry": true,
2603
2603
  "imports": [
2604
- "_app-presenter-provider-V0xnU_Wb.js",
2604
+ "_app-presenter-provider-CBZ_-ewx.js",
2605
2605
  "_api-DqzQ-_3w.js",
2606
2606
  "_utils-CBZPzC_b.js",
2607
2607
  "_use-viewport-layout-BS18drMT.js",
@@ -2741,13 +2741,13 @@
2741
2741
  ]
2742
2742
  },
2743
2743
  "src/features/system-status/pages/runtime-config-page.tsx": {
2744
- "file": "assets/runtime-config-page-BHTKwgDi.js",
2744
+ "file": "assets/runtime-config-page-BH9uF4u_.js",
2745
2745
  "name": "runtime-config-page",
2746
2746
  "src": "src/features/system-status/pages/runtime-config-page.tsx",
2747
2747
  "isDynamicEntry": true,
2748
2748
  "imports": [
2749
2749
  "_chunk-DF37yw5_.js",
2750
- "_app-presenter-provider-V0xnU_Wb.js",
2750
+ "_app-presenter-provider-CBZ_-ewx.js",
2751
2751
  "_select-CG5YWnwe.js",
2752
2752
  "_api-DqzQ-_3w.js",
2753
2753
  "_mcp-marketplace-page-FfIfEo6w.js",
@@ -2756,7 +2756,7 @@
2756
2756
  "_plus-LA8-jpxP.js",
2757
2757
  "_rotate-cw-B6xm41Wn.js",
2758
2758
  "_save-fff_WpY2.js",
2759
- "_pwa-D_nZUwG0.js",
2759
+ "_pwa-CzqfYjFx.js",
2760
2760
  "_trash-2-BPPYt2NV.js",
2761
2761
  "_form-actions-BRESe-m_.js",
2762
2762
  "_use-config-BEdbtpD4.js",
Binary file
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n}from"./utils-CBZPzC_b.js";import{Gt as r,Wt as i,Yt as a}from"./api-DqzQ-_3w.js";import{S as o}from"./mcp-marketplace-page-FfIfEo6w.js";import{W as s,ft as c,nt as l,r as u}from"./app-presenter-provider-V0xnU_Wb.js";import{n as d,s as f}from"./i18n-20rSH40D.js";import{t as p}from"./createLucideIcon-BNKf0_kc.js";import{i as m}from"./use-viewport-layout-BS18drMT.js";import{a as h,n as g,o as _,r as v,t as y}from"./dialog-Xe73hpQz.js";var b=p(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),x=e(n(),1),S=t();function C({label:e,value:t}){return(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,S.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,S.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function w(e){let{email:t,username:n,role:s,canSubmitUsername:c,savingUsername:u,usernameDraft:d,onUsernameDraftChange:p,onSubmitUsername:m,onOpenDeviceList:h,onLogout:g}=e;return(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(o,{tone:`success`,title:f(`accountPanelSignedInTitle`),description:f(`accountPanelSignedInDescription`)}),(0,S.jsxs)(o,{tone:`neutral`,children:[(0,S.jsx)(C,{label:f(`remoteAccountEmail`),value:t}),(0,S.jsx)(C,{label:f(`remoteAccountUsername`),value:n}),(0,S.jsx)(C,{label:f(`remoteAccountRole`),value:s})]}),n?(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:f(`remoteAccountUsernameLockedHelp`)}):(0,S.jsxs)(o,{tone:`warning`,title:f(`remoteAccountUsernameRequiredTitle`),description:f(`remoteAccountUsernameRequiredDescription`),children:[(0,S.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,S.jsx)(i,{htmlFor:`account-panel-username`,children:f(`remoteAccountUsername`)}),(0,S.jsx)(r,{id:`account-panel-username`,value:d,onChange:e=>p(e.target.value),placeholder:f(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,S.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,S.jsx)(a,{disabled:!c,onClick:()=>void m(),children:f(u?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,S.jsxs)(a,{onClick:()=>void h(),children:[(0,S.jsx)(l,{className:`mr-2 h-4 w-4`}),f(`remoteOpenDeviceList`)]}),(0,S.jsxs)(a,{variant:`outline`,onClick:()=>void g(),children:[(0,S.jsx)(b,{className:`mr-2 h-4 w-4`}),f(`remoteLogout`)]})]})]})}function T(e){let{authSessionId:t,authExpiresAt:n,authStatusMessage:r,authVerificationUri:i,onStartBrowserSignIn:s,onResumeBrowserSignIn:c}=e;return(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(o,{tone:`neutral`,title:f(`accountPanelSignedOutTitle`),description:f(`accountPanelSignedOutDescription`),children:t?(0,S.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,S.jsx)(C,{label:f(`remoteBrowserAuthSession`),value:t}),(0,S.jsx)(C,{label:f(`remoteBrowserAuthExpiresAt`),value:n?d(n):`-`})]}):null}),r?(0,S.jsx)(`p`,{className:`text-sm text-gray-600`,children:r}):null,(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,S.jsx)(a,{onClick:()=>void s(),children:f(t?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),i?(0,S.jsx)(a,{variant:`outline`,onClick:()=>void c(),children:f(`remoteBrowserAuthResume`)}):null]})]})}function E(){let e=u(),t=c(),n=s(e=>e.panelOpen),r=s(e=>e.authSessionId),i=s(e=>e.authVerificationUri),a=s(e=>e.authExpiresAt),o=s(e=>e.authStatusMessage),l=t.data,[d,p]=(0,x.useState)(``),[b,C]=(0,x.useState)(!1);(0,x.useEffect)(()=>{e.accountManager.syncRemoteStatus(l)},[e,l]);let E=!b&&d.trim().length>0&&!l?.account.username;return(0,S.jsx)(y,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,S.jsxs)(g,{className:`max-w-xl`,children:[(0,S.jsxs)(h,{children:[(0,S.jsxs)(_,{className:`flex items-center gap-2`,children:[(0,S.jsx)(m,{className:`h-5 w-5 text-primary`}),f(`accountPanelTitle`)]}),(0,S.jsx)(v,{children:f(`accountPanelDescription`)})]}),l?.account.loggedIn?(0,S.jsx)(w,{email:l.account.email,username:l.account.username,role:l.account.role,canSubmitUsername:E,savingUsername:b,usernameDraft:d,onUsernameDraftChange:p,onSubmitUsername:async()=>{C(!0);try{await e.accountManager.updateUsername(d)}finally{C(!1)}},onOpenDeviceList:()=>e.accountManager.openNextClawWeb(`/account`),onLogout:()=>e.accountManager.logout()}):(0,S.jsx)(T,{authSessionId:r,authExpiresAt:a,authStatusMessage:o,authVerificationUri:i,onStartBrowserSignIn:()=>e.accountManager.startBrowserSignIn(),onResumeBrowserSignIn:()=>e.accountManager.resumeBrowserSignIn()})]})})}export{E as AccountPanel};
1
+ import{i as e}from"./chunk-DF37yw5_.js";import{A as t,M as n}from"./utils-CBZPzC_b.js";import{Gt as r,Wt as i,Yt as a}from"./api-DqzQ-_3w.js";import{S as o}from"./mcp-marketplace-page-FfIfEo6w.js";import{G as s,pt as c,r as l,rt as u}from"./app-presenter-provider-CBZ_-ewx.js";import{n as d,s as f}from"./i18n-20rSH40D.js";import{t as p}from"./createLucideIcon-BNKf0_kc.js";import{i as m}from"./use-viewport-layout-BS18drMT.js";import{a as h,n as g,o as _,r as v,t as y}from"./dialog-Xe73hpQz.js";var b=p(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),x=e(n(),1),S=t();function C({label:e,value:t}){return(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,S.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,S.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function w(e){let{email:t,username:n,role:s,canSubmitUsername:c,savingUsername:l,usernameDraft:d,onUsernameDraftChange:p,onSubmitUsername:m,onOpenDeviceList:h,onLogout:g}=e;return(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(o,{tone:`success`,title:f(`accountPanelSignedInTitle`),description:f(`accountPanelSignedInDescription`)}),(0,S.jsxs)(o,{tone:`neutral`,children:[(0,S.jsx)(C,{label:f(`remoteAccountEmail`),value:t}),(0,S.jsx)(C,{label:f(`remoteAccountUsername`),value:n}),(0,S.jsx)(C,{label:f(`remoteAccountRole`),value:s})]}),n?(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:f(`remoteAccountUsernameLockedHelp`)}):(0,S.jsxs)(o,{tone:`warning`,title:f(`remoteAccountUsernameRequiredTitle`),description:f(`remoteAccountUsernameRequiredDescription`),children:[(0,S.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,S.jsx)(i,{htmlFor:`account-panel-username`,children:f(`remoteAccountUsername`)}),(0,S.jsx)(r,{id:`account-panel-username`,value:d,onChange:e=>p(e.target.value),placeholder:f(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,S.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,S.jsx)(a,{disabled:!c,onClick:()=>void m(),children:f(l?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,S.jsxs)(a,{onClick:()=>void h(),children:[(0,S.jsx)(u,{className:`mr-2 h-4 w-4`}),f(`remoteOpenDeviceList`)]}),(0,S.jsxs)(a,{variant:`outline`,onClick:()=>void g(),children:[(0,S.jsx)(b,{className:`mr-2 h-4 w-4`}),f(`remoteLogout`)]})]})]})}function T(e){let{authSessionId:t,authExpiresAt:n,authStatusMessage:r,authVerificationUri:i,onStartBrowserSignIn:s,onResumeBrowserSignIn:c}=e;return(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(o,{tone:`neutral`,title:f(`accountPanelSignedOutTitle`),description:f(`accountPanelSignedOutDescription`),children:t?(0,S.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,S.jsx)(C,{label:f(`remoteBrowserAuthSession`),value:t}),(0,S.jsx)(C,{label:f(`remoteBrowserAuthExpiresAt`),value:n?d(n):`-`})]}):null}),r?(0,S.jsx)(`p`,{className:`text-sm text-gray-600`,children:r}):null,(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,S.jsx)(a,{onClick:()=>void s(),children:f(t?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),i?(0,S.jsx)(a,{variant:`outline`,onClick:()=>void c(),children:f(`remoteBrowserAuthResume`)}):null]})]})}function E(){let e=l(),t=c(),n=s(e=>e.panelOpen),r=s(e=>e.authSessionId),i=s(e=>e.authVerificationUri),a=s(e=>e.authExpiresAt),o=s(e=>e.authStatusMessage),u=t.data,[d,p]=(0,x.useState)(``),[b,C]=(0,x.useState)(!1);(0,x.useEffect)(()=>{e.accountManager.syncRemoteStatus(u)},[e,u]);let E=!b&&d.trim().length>0&&!u?.account.username;return(0,S.jsx)(y,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,S.jsxs)(g,{className:`max-w-xl`,children:[(0,S.jsxs)(h,{children:[(0,S.jsxs)(_,{className:`flex items-center gap-2`,children:[(0,S.jsx)(m,{className:`h-5 w-5 text-primary`}),f(`accountPanelTitle`)]}),(0,S.jsx)(v,{children:f(`accountPanelDescription`)})]}),u?.account.loggedIn?(0,S.jsx)(w,{email:u.account.email,username:u.account.username,role:u.account.role,canSubmitUsername:E,savingUsername:b,usernameDraft:d,onUsernameDraftChange:p,onSubmitUsername:async()=>{C(!0);try{await e.accountManager.updateUsername(d)}finally{C(!1)}},onOpenDeviceList:()=>e.accountManager.openNextClawWeb(`/account`),onLogout:()=>e.accountManager.logout()}):(0,S.jsx)(T,{authSessionId:r,authExpiresAt:a,authStatusMessage:o,authVerificationUri:i,onStartBrowserSignIn:()=>e.accountManager.startBrowserSignIn(),onResumeBrowserSignIn:()=>e.accountManager.resumeBrowserSignIn()})]})})}export{E as AccountPanel};