@nextclaw/ui 0.9.13 → 0.9.14

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 (73) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +17 -16
  3. package/public/logos/weixin.svg +5 -0
  4. package/src/components/chat/ncp/ncp-app-client-fetch.test.ts +9 -0
  5. package/src/components/chat/ncp/ncp-app-client-fetch.ts +10 -0
  6. package/src/components/chat/ncp/ncp-session-adapter.ts +0 -1
  7. package/src/components/config/ChannelForm.tsx +1 -122
  8. package/src/components/config/ChannelsList.test.tsx +127 -0
  9. package/src/components/config/ChannelsList.tsx +2 -1
  10. package/src/components/config/channel-form-fields.ts +131 -0
  11. package/src/lib/i18n.channels.ts +52 -0
  12. package/src/lib/i18n.ts +2 -43
  13. package/src/lib/logos.ts +1 -0
  14. package/src/transport/local.transport.ts +4 -1
  15. package/src/transport/remote.transport.ts +5 -1
  16. package/src/transport/sse-stream.test.ts +68 -0
  17. package/src/transport/sse-stream.ts +48 -7
  18. package/src/transport/transport.types.ts +2 -0
  19. package/LICENSE +0 -21
  20. package/dist/assets/ChannelsList-bROKR37R.js +0 -1
  21. package/dist/assets/ChatPage-B9dHVmrV.js +0 -41
  22. package/dist/assets/DocBrowser-S-1-qnZQ.js +0 -1
  23. package/dist/assets/LogoBadge-t1JzzCtI.js +0 -1
  24. package/dist/assets/MarketplacePage-CzIHYJpM.js +0 -49
  25. package/dist/assets/McpMarketplacePage-BTJdjNQ1.js +0 -40
  26. package/dist/assets/ModelConfig-BD4o3Kna.js +0 -1
  27. package/dist/assets/ProvidersList-BOQArFRk.js +0 -1
  28. package/dist/assets/RemoteAccessPage-CYNQ53xu.js +0 -1
  29. package/dist/assets/RuntimeConfig-B0B73pye.js +0 -1
  30. package/dist/assets/SearchConfig-CKy2QkAP.js +0 -1
  31. package/dist/assets/SecretsConfig-BpZLUu88.js +0 -3
  32. package/dist/assets/SessionsConfig-CoFI6Fa2.js +0 -2
  33. package/dist/assets/chat-message-D3jZIASl.js +0 -3
  34. package/dist/assets/config-hints-CApS3K_7.js +0 -1
  35. package/dist/assets/config-layout-BHnOoweL.js +0 -1
  36. package/dist/assets/index-CmGwUgcl.js +0 -8
  37. package/dist/assets/index-SGSkQCPi.css +0 -1
  38. package/dist/assets/label-BOvIOmQx.js +0 -1
  39. package/dist/assets/marketplace-localization-Dk31LJJJ.js +0 -1
  40. package/dist/assets/page-layout-PG3cwSpz.js +0 -1
  41. package/dist/assets/popover-BB-kINz7.js +0 -1
  42. package/dist/assets/provider-models-BOeNnjk9.js +0 -1
  43. package/dist/assets/security-config-Bb6l-viE.js +0 -1
  44. package/dist/assets/skeleton-CLSc5FYO.js +0 -1
  45. package/dist/assets/status-dot-Behu7kDZ.js +0 -1
  46. package/dist/assets/switch-CvNG9775.js +0 -1
  47. package/dist/assets/tabs-custom-CUdBQO_7.js +0 -1
  48. package/dist/assets/useConfirmDialog-CLLe2uIJ.js +0 -1
  49. package/dist/assets/vendor-TJ2hy_Lv.js +0 -441
  50. package/dist/index.html +0 -18
  51. package/dist/logo.svg +0 -5
  52. package/dist/logos/aihubmix.png +0 -0
  53. package/dist/logos/anthropic.svg +0 -1
  54. package/dist/logos/dashscope.png +0 -0
  55. package/dist/logos/deepseek.png +0 -0
  56. package/dist/logos/dingtalk.svg +0 -1
  57. package/dist/logos/discord.svg +0 -1
  58. package/dist/logos/email.svg +0 -1
  59. package/dist/logos/feishu.svg +0 -12
  60. package/dist/logos/gemini.svg +0 -1
  61. package/dist/logos/groq.svg +0 -1
  62. package/dist/logos/minimax.svg +0 -1
  63. package/dist/logos/mochat.svg +0 -6
  64. package/dist/logos/moonshot.png +0 -0
  65. package/dist/logos/openai.svg +0 -1
  66. package/dist/logos/openrouter.svg +0 -1
  67. package/dist/logos/qq.svg +0 -1
  68. package/dist/logos/slack.svg +0 -1
  69. package/dist/logos/telegram.svg +0 -1
  70. package/dist/logos/vllm.svg +0 -1
  71. package/dist/logos/wecom.svg +0 -11
  72. package/dist/logos/whatsapp.svg +0 -1
  73. package/dist/logos/zhipu.svg +0 -15
@@ -1 +0,0 @@
1
- import{r as c,j as e,e as M}from"./vendor-TJ2hy_Lv.js";import{a5 as O,a6 as R,a7 as I,a8 as B,a9 as _,C as u,a2 as h,a3 as x,t as s,a4 as m,E as p,B as j,I as l}from"./index-CmGwUgcl.js";import{L as o}from"./label-BOvIOmQx.js";import{S as G}from"./switch-CvNG9775.js";import{P as V,a as W}from"./page-layout-PG3cwSpz.js";const q=8;function A(r){return r.trim().length>=q}function L(r,n){return r!==n?(M.error(s("authPasswordMismatch")),!1):!0}function z(){const r=O(),n=R(),S=I(),g=B(),y=_(),[f,U]=c.useState(""),[i,N]=c.useState(""),[w,b]=c.useState(""),[d,v]=c.useState(""),[P,C]=c.useState(""),t=r.data,E=f.trim().length>0&&A(i)&&i===w&&!n.isPending,D=A(d)&&d===P&&!g.isPending,T=async()=>{if(L(i,w))try{await n.mutateAsync({username:f.trim(),password:i}),N(""),b("")}catch{}},F=async()=>{if(L(d,P))try{await g.mutateAsync({password:d}),v(""),C("")}catch{}},H=async a=>{try{await S.mutateAsync({enabled:a})}catch{}},k=async()=>{try{await y.mutateAsync()}catch{}};return r.isLoading&&!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsx(p,{className:"text-sm text-gray-500",children:s("loading")})]}):r.isError||!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:s("authStatusLoadFailed")}),e.jsx(j,{variant:"outline",onClick:()=>{r.refetch()},children:s("authRetryStatus")})]})]}):t.configured?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authStatusLabel")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("authStatusConfiguredUser").replace("{username}",t.username??"")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authUsernameFixedHelp")})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700",children:t.enabled?s("enabled"):s("disabled")})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authEnableLabel")}),e.jsx("p",{className:"text-xs text-gray-500",children:t.enabled?s("authEnableOnHelp"):s("authEnableOffHelp")})]}),e.jsx(G,{checked:t.enabled,disabled:S.isPending,onCheckedChange:a=>{H(a)}})]})]}),e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4 space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authPasswordSectionTitle")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordSectionDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-next",children:s("authPassword")}),e.jsx(l,{id:"auth-password-next",type:"password",value:d,onChange:a=>v(a.target.value),placeholder:s("authPasswordPlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-password-confirm",type:"password",value:P,onChange:a=>C(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(j,{type:"button",disabled:!D,onClick:()=>void F(),children:g.isPending?s("authPasswordUpdating"):s("authPasswordAction")}),t.enabled&&t.authenticated?e.jsx(j,{type:"button",variant:"outline",disabled:y.isPending,onClick:()=>void k(),children:y.isPending?s("authLoggingOut"):s("authLogoutAction")}):null]}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authSessionMemoryNotice")})]})]})]}):e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-5",children:[e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authSetupTitle")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s("authSetupDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-username",children:s("authUsername")}),e.jsx(l,{id:"auth-setup-username",value:f,onChange:a=>U(a.target.value),placeholder:s("authUsernamePlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-password",children:s("authPassword")}),e.jsx(l,{id:"auth-setup-password",type:"password",value:i,onChange:a=>N(a.target.value),placeholder:s("authPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-setup-confirm",type:"password",value:w,onChange:a=>b(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordMinLengthHint")})]}),e.jsx(j,{type:"button",disabled:!E,onClick:()=>void T(),children:n.isPending?s("authSettingUp"):s("authSetupAction")})]})]})}function Z(){return e.jsxs(V,{className:"space-y-6",children:[e.jsx(W,{title:s("authSecurityTitle"),description:s("authSecurityDescription")}),e.jsx(z,{})]})}export{Z as SecurityConfig};
@@ -1 +0,0 @@
1
- import{j as t}from"./vendor-TJ2hy_Lv.js";import{c as o}from"./index-CmGwUgcl.js";function m({className:e,...s}){return t.jsx("div",{className:o("animate-pulse rounded-md bg-slate-200",e),...s})}export{m as S};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-TJ2hy_Lv.js";import{c as a}from"./index-CmGwUgcl.js";const n={active:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},ready:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},inactive:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},setup:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},warning:{dot:"bg-amber-400",text:"text-amber-600",bg:"bg-amber-50"}};function m({status:r,label:s,className:g}){const t=n[r];return e.jsxs("div",{className:a("inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5",t.bg,g),children:[e.jsx("span",{className:a("h-1.5 w-1.5 rounded-full",t.dot)}),e.jsx("span",{className:a("text-[11px] font-medium",t.text),children:s})]})}export{m as S};
@@ -1 +0,0 @@
1
- import{r as e,j as i}from"./vendor-TJ2hy_Lv.js";import{c as t}from"./index-CmGwUgcl.js";const l=e.forwardRef(({className:o,checked:r=!1,onCheckedChange:s,...a},n)=>i.jsx("button",{type:"button",role:"switch","aria-checked":r,ref:n,className:t("peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",r?"bg-primary":"bg-gray-200/80 hover:bg-gray-300/80",o),onClick:()=>s==null?void 0:s(!r),...a,children:i.jsx("span",{className:t("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast",r?"translate-x-5":"translate-x-0")})}));l.displayName="Switch";export{l as S};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-TJ2hy_Lv.js";import{ap as m,c as a}from"./index-CmGwUgcl.js";function c({tabs:s,activeTab:i,onChange:o,className:n}){return e.jsx("div",{className:a("flex items-center gap-6 border-b border-gray-200/60 mb-6",n),children:s.map(t=>{const r=i===t.id;return e.jsxs("button",{onClick:()=>o(t.id),className:a("relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5",r?"text-gray-900":"text-gray-600 hover:text-gray-900"),children:[t.label,t.count!==void 0&&e.jsx("span",{className:a("text-[11px] font-medium","text-gray-500"),children:m(t.count)}),r&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full"})]},t.id)})})}export{c as T};
@@ -1 +0,0 @@
1
- import{j as a,r as t}from"./vendor-TJ2hy_Lv.js";import{aj as C,ak as p,al as h,am as x,an as g,ao as j,B as d,t as r}from"./index-CmGwUgcl.js";const D=({open:l,onOpenChange:i,title:c,description:o,confirmLabel:s=r("confirm"),cancelLabel:e=r("cancel"),variant:n="default",onConfirm:u,onCancel:f})=>{const m=()=>{u(),i(!1)},v=()=>{f(),i(!1)};return a.jsx(C,{open:l,onOpenChange:i,children:a.jsxs(p,{className:"[&>:last-child]:hidden",onCloseAutoFocus:b=>b.preventDefault(),children:[a.jsxs(h,{children:[a.jsx(x,{children:c}),o?a.jsx(g,{children:o}):null]}),a.jsxs(j,{className:"gap-2 sm:gap-0",children:[a.jsx(d,{type:"button",variant:"outline",onClick:v,children:e}),a.jsx(d,{type:"button",variant:n==="destructive"?"destructive":"default",onClick:m,children:s})]})]})})},L={open:!1,title:"",description:"",confirmLabel:r("confirm"),cancelLabel:r("cancel"),variant:"default",resolve:null};function y(){const[l,i]=t.useState(L),c=t.useCallback(e=>new Promise(n=>{i({open:!0,title:e.title,description:e.description??"",confirmLabel:e.confirmLabel??r("confirm"),cancelLabel:e.cancelLabel??r("cancel"),variant:e.variant??"default",resolve:u=>{n(u),i(f=>({...f,open:!1,resolve:null}))}})}),[]),o=t.useCallback(e=>{i(n=>(!e&&n.resolve&&n.resolve(!1),{...n,open:e,resolve:e?n.resolve:null}))},[]),s=t.useCallback(()=>a.jsx(D,{open:l.open,onOpenChange:o,title:l.title,description:l.description||void 0,confirmLabel:l.confirmLabel,cancelLabel:l.cancelLabel,variant:l.variant,onConfirm:()=>{var e;return(e=l.resolve)==null?void 0:e.call(l,!0)},onCancel:()=>{var e;return(e=l.resolve)==null?void 0:e.call(l,!1)}}),[l,o]);return{confirm:c,ConfirmDialog:s}}export{y as u};