@nextclaw/ui 0.6.8 → 0.6.9
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/CHANGELOG.md +12 -0
- package/dist/assets/{ChannelsList-DH5fzlPu.js → ChannelsList-DACqpUYZ.js} +1 -1
- package/dist/assets/{ChatPage-BrLCnJSb.js → ChatPage-iji0RkTR.js} +12 -12
- package/dist/assets/{DocBrowser-DPQHJVsZ.js → DocBrowser-D7mjKkGe.js} +1 -1
- package/dist/assets/{LogoBadge-FEb4_vSq.js → LogoBadge-BlDT-g9R.js} +1 -1
- package/dist/assets/{MarketplacePage-BAVXYeZA.js → MarketplacePage-CZq3jVgg.js} +3 -3
- package/dist/assets/{ModelConfig-BqPXe7nw.js → ModelConfig-DwRU5qrw.js} +1 -1
- package/dist/assets/{ProvidersList-vpKPuIxV.js → ProvidersList-DFxN3pjx.js} +1 -1
- package/dist/assets/{RuntimeConfig-DTYSU4_d.js → RuntimeConfig-C7BRLGSC.js} +1 -1
- package/dist/assets/{SecretsConfig-nNzs3YDm.js → SecretsConfig-D5xZh7VF.js} +1 -1
- package/dist/assets/{SessionsConfig-CHjeyqEQ.js → SessionsConfig-ovpj_otA.js} +1 -1
- package/dist/assets/{card-73MmEZi7.js → card-Bf4CtrW8.js} +1 -1
- package/dist/assets/{index-DI6BuShn.css → index-C_DhisNo.css} +1 -1
- package/dist/assets/{index-CTLvVlk8.js → index-dKTqKCJo.js} +2 -2
- package/dist/assets/{input-1MCMs6Yf.js → input-CaKJyoWZ.js} +1 -1
- package/dist/assets/{label-C4Q8RlBJ.js → label-BaXSWTKI.js} +1 -1
- package/dist/assets/{page-layout-CK0vcVmV.js → page-layout-DA6PFRtQ.js} +1 -1
- package/dist/assets/{session-run-status-BaNlKvi6.js → session-run-status-CllIZxNf.js} +1 -1
- package/dist/assets/{switch-Bf8w_cF1.js → switch-Cvd5wZs-.js} +1 -1
- package/dist/assets/{tabs-custom-B6Gw8gax.js → tabs-custom-0PybLkXs.js} +1 -1
- package/dist/assets/{useConfirmDialog-B5CZ4EDN.js → useConfirmDialog-DdtpSju1.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/api/types.ts +22 -4
- package/src/components/chat/useChatStreamController.ts +18 -3
- package/src/components/marketplace/MarketplacePage.tsx +48 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,r as N,j as n}from"./vendor-C--HHaLf.js";import{c as v}from"./index-
|
|
1
|
+
import{c as p,r as N,j as n}from"./vendor-C--HHaLf.js";import{c as v}from"./index-dKTqKCJo.js";const y=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,f=p,w=(r,t)=>e=>{var i;if((t==null?void 0:t.variants)==null)return f(r,e==null?void 0:e.class,e==null?void 0:e.className);const{variants:u,defaultVariants:o}=t,g=Object.keys(u).map(a=>{const s=e==null?void 0:e[a],d=o==null?void 0:o[a];if(s===null)return null;const l=y(s)||y(d);return u[a][l]}),m=e&&Object.entries(e).reduce((a,s)=>{let[d,l]=s;return l===void 0||(a[d]=l),a},{}),b=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((a,s)=>{let{class:d,className:l,...h}=s;return Object.entries(h).every(j=>{let[x,c]=j;return Array.isArray(c)?c.includes({...o,...m}[x]):{...o,...m}[x]===c})?[...a,d,l]:a},[]);return f(r,g,b,e==null?void 0:e.class,e==null?void 0:e.className)},V=w("inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium ring-offset-background transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-gray-200 bg-white hover:bg-gray-50 hover:text-gray-800 text-gray-600",secondary:"bg-gray-100 text-gray-700 hover:bg-gray-200/80",ghost:"hover:bg-gray-100/80 hover:text-gray-800",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm",subtle:"bg-gray-100 text-gray-600 hover:bg-gray-200/80","primary-outline":"border border-primary/30 text-primary hover:bg-primary hover:text-primary-foreground"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"h-11 px-5 text-[14px]",xl:"h-12 px-6 text-[15px]",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),k=N.forwardRef(({className:r,variant:t,size:e,...i},u)=>n.jsx("button",{className:v(V({variant:t,size:e,className:r})),ref:u,...i}));k.displayName="Button";function O({children:r,fullHeight:t=!1,className:e}){return n.jsx("div",{className:v("animate-fade-in",t?"h-[calc(100vh-80px)] w-full flex flex-col":"pb-16",e),children:r})}function B({title:r,description:t,actions:e,className:i}){return n.jsxs("div",{className:v("flex items-center justify-between mb-6 shrink-0",i),children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:r}),t&&n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:t})]}),e&&n.jsx("div",{className:"flex items-center gap-2 shrink-0",children:e})]})}export{k as B,O as P,B as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as h,_ as C}from"./vendor-C--HHaLf.js";import{t as b,c as N}from"./index-
|
|
1
|
+
import{j as h,_ as C}from"./vendor-C--HHaLf.js";import{t as b,c as N}from"./index-dKTqKCJo.js";function L({status:t,className:n}){const e=t==="running"?b("sessionsRunStatusRunning"):b("sessionsRunStatusQueued");return h.jsxs("span",{className:N("inline-flex h-3.5 w-3.5 items-center justify-center text-gray-400",n),title:e,"aria-label":e,children:[h.jsx(C,{className:"h-3 w-3 animate-spin"}),h.jsx("span",{className:"sr-only",children:e})]})}const j=["cmd","command","query","q","path","url","to","channel","agentId","sessionKey"];function d(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function x(t,n=2400){return t.length<=n?t:`${t.slice(0,n)}
|
|
2
2
|
…`}function S(t){if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t==null)return"";try{return x(JSON.stringify(t,null,2))}catch{return String(t)}}function w(t){if(d(t))return t;if(typeof t!="string")return null;const n=t.trim();if(!n.startsWith("{")&&!n.startsWith("["))return null;try{const e=JSON.parse(n);return d(e)?e:null}catch{return null}}function F(t){const n=w(t);if(!n){const s=S(t).trim();return s?x(s,120):void 0}const e=[];for(const s of j){const i=n[s];if(typeof i=="string"&&i.trim()?e.push(`${s}: ${i.trim()}`):(typeof i=="number"||typeof i=="boolean")&&e.push(`${s}: ${String(i)}`),e.length>=2)break}return e.length>0?e.join(" · "):x(S(n),140)}function T(t){return typeof t!="string"||!t.trim()?"tool":t.trim()}function q(t){return Array.isArray(t.tool_calls)&&t.tool_calls.length>0}function A(t){const n=t.role.toLowerCase().trim();return n==="user"?"user":n==="assistant"?"assistant":n==="system"?"system":n==="tool"||n==="tool_result"||n==="toolresult"||n==="function"||typeof t.tool_call_id=="string"||Array.isArray(t.tool_calls)||typeof t.name=="string"?"tool":"other"}function y(t){if(typeof t=="string")return t;if(Array.isArray(t)){const n=[];for(const e of t){if(typeof e=="string"){n.push(e);continue}if(d(e)){if(typeof e.text=="string"){n.push(e.text);continue}typeof e.content=="string"&&n.push(e.content)}}if(n.length>0)return n.join(`
|
|
3
3
|
`)}return S(t)}function k(t){const n=[],e=Array.isArray(t.tool_calls)?t.tool_calls:[];for(const s of e){if(!d(s))continue;const i=d(s.function)?s.function:null,c=T((i==null?void 0:i.name)??s.name),_=(i==null?void 0:i.arguments)??s.arguments;n.push({kind:"call",name:c,detail:F(_),callId:typeof s.id=="string"&&s.id.trim()?s.id:void 0,hasResult:!1})}return n}function z(t){var s;const n=k(t);return(A(t)==="tool"||typeof t.tool_call_id=="string")&&n.push({kind:"result",name:T(t.name??((s=n[0])==null?void 0:s.name)),text:y(t.content).trim(),callId:typeof t.tool_call_id=="string"?t.tool_call_id:void 0,hasResult:!0}),n}function M(t,n){var i;const e=Number.isFinite(t.seq)&&t.seq>0?Math.trunc(t.seq):n+1,s=typeof t.timestamp=="string"&&t.timestamp?t.timestamp:((i=t.message)==null?void 0:i.timestamp)??new Date().toISOString();return{...t,timestamp:s,_idx:n,_seq:e}}function B(t){const n=A(t);return n==="assistant"&&q(t)?"assistant.tool_call":n==="tool"?"tool.result":`message.${n}`}function P(t){return t.map((n,e)=>({seq:e+1,type:B(n),timestamp:n.timestamp,message:n}))}function O(t,n){return n?t?`${t}
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,j as i}from"./vendor-C--HHaLf.js";import{c as t}from"./index-
|
|
1
|
+
import{r as e,j as i}from"./vendor-C--HHaLf.js";import{c as t}from"./index-dKTqKCJo.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 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-C--HHaLf.js";import{U as m,c as s}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-C--HHaLf.js";import{U as m,c as s}from"./index-dKTqKCJo.js";function c({tabs:a,activeTab:i,onChange:o,className:n}){return e.jsx("div",{className:s("flex items-center gap-6 border-b border-gray-200/60 mb-6",n),children:a.map(t=>{const r=i===t.id;return e.jsxs("button",{onClick:()=>o(t.id),className:s("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:s("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,4 +1,4 @@
|
|
|
1
|
-
import{r as i,aj as b,aU as I,ad as ie,j as s,af as j,ai as le,ak as h,al as D,am as ce,an as de,ao as ue,aq as fe,ar as ge,as as me,ap as pe,aV as ve,ax as xe}from"./vendor-C--HHaLf.js";import{c as N,t as x}from"./index-
|
|
1
|
+
import{r as i,aj as b,aU as I,ad as ie,j as s,af as j,ai as le,ak as h,al as D,am as ce,an as de,ao as ue,aq as fe,ar as ge,as as me,ap as pe,aV as ve,ax as xe}from"./vendor-C--HHaLf.js";import{c as N,t as x}from"./index-dKTqKCJo.js";import{B as w}from"./page-layout-DA6PFRtQ.js";function Ne(e,t){return i.useReducer((o,a)=>t[o][a]??o,e)}var E=e=>{const{present:t,children:o}=e,a=De(t),r=typeof o=="function"?o({present:a.isPresent}):i.Children.only(o),n=b(a.ref,he(r));return typeof o=="function"||a.isPresent?i.cloneElement(r,{ref:n}):null};E.displayName="Presence";function De(e){const[t,o]=i.useState(),a=i.useRef(null),r=i.useRef(e),n=i.useRef("none"),l=e?"mounted":"unmounted",[c,u]=Ne(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const d=y(a.current);n.current=c==="mounted"?d:"none"},[c]),I(()=>{const d=a.current,f=r.current;if(f!==e){const C=n.current,p=y(d);e?u("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&C!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),I(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,m=p=>{const re=y(a.current).includes(CSS.escape(p.animationName));if(p.target===t&&re&&(u("ANIMATION_END"),!r.current)){const se=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=se)})}},C=p=>{p.target===t&&(n.current=y(a.current))};return t.addEventListener("animationstart",C),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",C),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(d=>{a.current=d?getComputedStyle(d):null,o(d)},[])}}function y(e){return(e==null?void 0:e.animationName)||"none"}function he(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var O="Dialog",[M]=ce(O),[Ce,g]=M(O),T=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:r,onOpenChange:n,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d,f]=ie({prop:a,defaultProp:r??!1,onChange:n,caller:O});return s.jsx(Ce,{scope:t,triggerRef:c,contentRef:u,contentId:j(),titleId:j(),descriptionId:j(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),modal:l,children:o})};T.displayName=O;var S="DialogTrigger",ye=i.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,r=g(S,o),n=b(t,r.triggerRef);return s.jsx(h.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":_(r.open),...a,ref:n,onClick:D(e.onClick,r.onOpenToggle)})});ye.displayName=S;var A="DialogPortal",[Re,F]=M(A,{forceMount:void 0}),L=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:r}=e,n=g(A,t);return s.jsx(Re,{scope:t,forceMount:o,children:i.Children.map(a,l=>s.jsx(E,{present:o||n.open,children:s.jsx(le,{asChild:!0,container:r,children:l})}))})};L.displayName=A;var R="DialogOverlay",k=i.forwardRef((e,t)=>{const o=F(R,e.__scopeDialog),{forceMount:a=o.forceMount,...r}=e,n=g(R,e.__scopeDialog);return n.modal?s.jsx(E,{present:a||n.open,children:s.jsx(Ee,{...r,ref:t})}):null});k.displayName=R;var be=pe("DialogOverlay.RemoveScroll"),Ee=i.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,r=g(R,o);return s.jsx(ue,{as:be,allowPinchZoom:!0,shards:[r.contentRef],children:s.jsx(h.div,{"data-state":_(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),v="DialogContent",W=i.forwardRef((e,t)=>{const o=F(v,e.__scopeDialog),{forceMount:a=o.forceMount,...r}=e,n=g(v,e.__scopeDialog);return s.jsx(E,{present:a||n.open,children:n.modal?s.jsx(Oe,{...r,ref:t}):s.jsx(je,{...r,ref:t})})});W.displayName=v;var Oe=i.forwardRef((e,t)=>{const o=g(v,e.__scopeDialog),a=i.useRef(null),r=b(t,o.contentRef,a);return i.useEffect(()=>{const n=a.current;if(n)return de(n)},[]),s.jsx(U,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:D(e.onCloseAutoFocus,n=>{var l;n.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:D(e.onPointerDownOutside,n=>{const l=n.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&n.preventDefault()}),onFocusOutside:D(e.onFocusOutside,n=>n.preventDefault())})}),je=i.forwardRef((e,t)=>{const o=g(v,e.__scopeDialog),a=i.useRef(!1),r=i.useRef(!1);return s.jsx(U,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,n),n.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),n.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:n=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,n),n.defaultPrevented||(a.current=!0,n.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const l=n.target;((d=o.triggerRef.current)==null?void 0:d.contains(l))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&r.current&&n.preventDefault()}})}),U=i.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:n,...l}=e,c=g(v,o),u=i.useRef(null),d=b(t,u);return fe(),s.jsxs(s.Fragment,{children:[s.jsx(ge,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:n,children:s.jsx(me,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":_(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Ae,{titleId:c.titleId}),s.jsx(_e,{contentRef:u,descriptionId:c.descriptionId})]})]})}),P="DialogTitle",$=i.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,r=g(P,o);return s.jsx(h.h2,{id:r.titleId,...a,ref:t})});$.displayName=P;var G="DialogDescription",B=i.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,r=g(G,o);return s.jsx(h.p,{id:r.descriptionId,...a,ref:t})});B.displayName=G;var z="DialogClose",H=i.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,r=g(z,o);return s.jsx(h.button,{type:"button",...a,ref:t,onClick:D(e.onClick,()=>r.onOpenChange(!1))})});H.displayName=z;function _(e){return e?"open":"closed"}var V="DialogTitleWarning",[$e,q]=ve(V,{contentName:v,titleName:P,docsSlug:"dialog"}),Ae=({titleId:e})=>{const t=q(V),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
4
|
|
package/dist/index.html
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>NextClaw - 系统配置</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-dKTqKCJo.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vendor-C--HHaLf.js">
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C_DhisNo.css">
|
|
12
12
|
</head>
|
|
13
13
|
|
|
14
14
|
<body>
|
package/package.json
CHANGED
package/src/api/types.ts
CHANGED
|
@@ -208,6 +208,24 @@ export type ChatCapabilitiesView = {
|
|
|
208
208
|
stopReason?: string;
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
+
export type ChatCommandOptionView = {
|
|
212
|
+
name: string;
|
|
213
|
+
description: string;
|
|
214
|
+
type: 'string' | 'boolean' | 'number';
|
|
215
|
+
required?: boolean;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export type ChatCommandView = {
|
|
219
|
+
name: string;
|
|
220
|
+
description: string;
|
|
221
|
+
options?: ChatCommandOptionView[];
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export type ChatCommandsView = {
|
|
225
|
+
commands: ChatCommandView[];
|
|
226
|
+
total: number;
|
|
227
|
+
};
|
|
228
|
+
|
|
211
229
|
export type ChatTurnStopRequest = {
|
|
212
230
|
runId: string;
|
|
213
231
|
sessionKey?: string;
|
|
@@ -550,7 +568,9 @@ export type MarketplaceItemType = 'plugin' | 'skill';
|
|
|
550
568
|
|
|
551
569
|
export type MarketplaceSort = 'relevance' | 'updated';
|
|
552
570
|
|
|
553
|
-
export type
|
|
571
|
+
export type MarketplacePluginInstallKind = 'npm';
|
|
572
|
+
export type MarketplaceSkillInstallKind = 'builtin' | 'marketplace';
|
|
573
|
+
export type MarketplaceInstallKind = MarketplacePluginInstallKind | MarketplaceSkillInstallKind;
|
|
554
574
|
|
|
555
575
|
export type MarketplaceInstallSpec = {
|
|
556
576
|
kind: MarketplaceInstallKind;
|
|
@@ -586,7 +606,7 @@ export type MarketplaceSkillContentView = {
|
|
|
586
606
|
slug: string;
|
|
587
607
|
name: string;
|
|
588
608
|
install: MarketplaceInstallSpec;
|
|
589
|
-
source: '
|
|
609
|
+
source: 'builtin' | 'marketplace' | 'remote';
|
|
590
610
|
raw: string;
|
|
591
611
|
metadataRaw?: string;
|
|
592
612
|
bodyRaw: string;
|
|
@@ -652,8 +672,6 @@ export type MarketplaceInstallRequest = {
|
|
|
652
672
|
kind?: MarketplaceInstallKind;
|
|
653
673
|
skill?: string;
|
|
654
674
|
installPath?: string;
|
|
655
|
-
version?: string;
|
|
656
|
-
registry?: string;
|
|
657
675
|
force?: boolean;
|
|
658
676
|
};
|
|
659
677
|
|
|
@@ -178,7 +178,7 @@ type ExecuteStreamRunParams = {
|
|
|
178
178
|
onReady: (event: { runId?: string; stopSupported?: boolean; stopReason?: string; sessionKey: string }) => void;
|
|
179
179
|
onDelta: (event: { delta: string }) => void;
|
|
180
180
|
onSessionEvent: (event: { data: SessionEventView }) => void;
|
|
181
|
-
}) => Promise<{ sessionKey: string }>;
|
|
181
|
+
}) => Promise<{ sessionKey: string; reply: string }>;
|
|
182
182
|
setters: StreamSetters;
|
|
183
183
|
};
|
|
184
184
|
|
|
@@ -226,6 +226,7 @@ async function executeStreamRun(params: ExecuteStreamRunParams): Promise<void> {
|
|
|
226
226
|
let streamText = '';
|
|
227
227
|
try {
|
|
228
228
|
let hasAssistantSessionEvent = false;
|
|
229
|
+
let hasUserSessionEvent = false;
|
|
229
230
|
const streamTimestamp = new Date().toISOString();
|
|
230
231
|
setters.setStreamingAssistantTimestamp(streamTimestamp);
|
|
231
232
|
|
|
@@ -269,6 +270,7 @@ async function executeStreamRun(params: ExecuteStreamRunParams): Promise<void> {
|
|
|
269
270
|
return;
|
|
270
271
|
}
|
|
271
272
|
if (event.data.message?.role === 'user') {
|
|
273
|
+
hasUserSessionEvent = true;
|
|
272
274
|
setters.setOptimisticUserEvent(null);
|
|
273
275
|
}
|
|
274
276
|
upsertStreamingEvent(setters.setStreamingSessionEvents, event.data);
|
|
@@ -288,7 +290,13 @@ async function executeStreamRun(params: ExecuteStreamRunParams): Promise<void> {
|
|
|
288
290
|
setSelectedSessionKey(result.sessionKey);
|
|
289
291
|
}
|
|
290
292
|
|
|
291
|
-
const
|
|
293
|
+
const finalReply = typeof result.reply === 'string' ? result.reply.trim() : '';
|
|
294
|
+
const localAssistantText = !hasAssistantSessionEvent ? (streamText.trim() || finalReply) : '';
|
|
295
|
+
const isSlashCommandMessage = typeof sourceMessage === 'string' && sourceMessage.trim().startsWith('/');
|
|
296
|
+
const shouldKeepLocalUserCommand =
|
|
297
|
+
!hasUserSessionEvent &&
|
|
298
|
+
optimisticUserEvent?.message?.role === 'user' &&
|
|
299
|
+
isSlashCommandMessage;
|
|
292
300
|
await refetchIfSessionVisible({
|
|
293
301
|
selectedSessionKeyRef,
|
|
294
302
|
currentSessionKey: sourceSessionKey,
|
|
@@ -297,7 +305,14 @@ async function executeStreamRun(params: ExecuteStreamRunParams): Promise<void> {
|
|
|
297
305
|
refetchHistory
|
|
298
306
|
});
|
|
299
307
|
|
|
300
|
-
|
|
308
|
+
const localEvents: SessionEventView[] = [];
|
|
309
|
+
if (shouldKeepLocalUserCommand && optimisticUserEvent) {
|
|
310
|
+
localEvents.push(optimisticUserEvent);
|
|
311
|
+
}
|
|
312
|
+
if (localAssistantText) {
|
|
313
|
+
localEvents.push(buildLocalAssistantEvent(localAssistantText));
|
|
314
|
+
}
|
|
315
|
+
setters.setStreamingSessionEvents(localEvents);
|
|
301
316
|
|
|
302
317
|
setters.setStreamingAssistantText('');
|
|
303
318
|
setters.setStreamingAssistantTimestamp(null);
|
|
@@ -824,7 +824,7 @@ export function MarketplacePage(props: MarketplacePageProps = {}) {
|
|
|
824
824
|
};
|
|
825
825
|
|
|
826
826
|
return (
|
|
827
|
-
<PageLayout>
|
|
827
|
+
<PageLayout className="flex h-full min-h-0 flex-col pb-0">
|
|
828
828
|
<PageHeader title={t(copyKeys.pageTitle)} description={t(copyKeys.pageDescription)} />
|
|
829
829
|
|
|
830
830
|
<Tabs
|
|
@@ -849,7 +849,7 @@ export function MarketplacePage(props: MarketplacePageProps = {}) {
|
|
|
849
849
|
}}
|
|
850
850
|
/>
|
|
851
851
|
|
|
852
|
-
<section>
|
|
852
|
+
<section className="flex min-h-0 flex-1 flex-col">
|
|
853
853
|
<div className="flex items-center justify-between mb-3">
|
|
854
854
|
<h3 className="text-[14px] font-semibold text-gray-900">
|
|
855
855
|
{scope === 'installed' ? t(copyKeys.sectionInstalled) : t(copyKeys.sectionCatalog)}
|
|
@@ -868,52 +868,56 @@ export function MarketplacePage(props: MarketplacePageProps = {}) {
|
|
|
868
868
|
</div>
|
|
869
869
|
)}
|
|
870
870
|
|
|
871
|
-
<div className="
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
871
|
+
<div className="min-h-0 flex-1 overflow-y-auto custom-scrollbar pr-1">
|
|
872
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-3">
|
|
873
|
+
{scope === 'all' && allItems.map((item) => (
|
|
874
|
+
<MarketplaceListCard
|
|
875
|
+
key={item.id}
|
|
876
|
+
item={item}
|
|
877
|
+
record={findInstalledRecordForItem(item, installedRecordLookup)}
|
|
878
|
+
localeFallbacks={localeFallbacks}
|
|
879
|
+
installState={installState}
|
|
880
|
+
manageState={manageState}
|
|
881
|
+
onOpen={() => void openItemDetail(item, findInstalledRecordForItem(item, installedRecordLookup))}
|
|
882
|
+
onInstall={handleInstall}
|
|
883
|
+
onManage={handleManage}
|
|
884
|
+
/>
|
|
885
|
+
))}
|
|
886
|
+
|
|
887
|
+
{scope === 'installed' && installedEntries.map((entry) => (
|
|
888
|
+
<MarketplaceListCard
|
|
889
|
+
key={entry.key}
|
|
890
|
+
item={entry.item}
|
|
891
|
+
record={entry.record}
|
|
892
|
+
localeFallbacks={localeFallbacks}
|
|
893
|
+
installState={installState}
|
|
894
|
+
manageState={manageState}
|
|
895
|
+
onOpen={() => void openItemDetail(entry.item, entry.record)}
|
|
896
|
+
onInstall={handleInstall}
|
|
897
|
+
onManage={handleManage}
|
|
898
|
+
/>
|
|
899
|
+
))}
|
|
900
|
+
</div>
|
|
900
901
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
902
|
+
{scope === 'all' && !itemsQuery.isLoading && !itemsQuery.isError && allItems.length === 0 && (
|
|
903
|
+
<div className="text-[13px] text-gray-500 py-8 text-center">{t(copyKeys.emptyData)}</div>
|
|
904
|
+
)}
|
|
905
|
+
{scope === 'installed' && !installedQuery.isLoading && !installedQuery.isError && installedEntries.length === 0 && (
|
|
906
|
+
<div className="text-[13px] text-gray-500 py-8 text-center">{t(copyKeys.emptyInstalled)}</div>
|
|
907
|
+
)}
|
|
908
|
+
</div>
|
|
907
909
|
</section>
|
|
908
910
|
|
|
909
911
|
{scope === 'all' && (
|
|
910
|
-
<
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
912
|
+
<div className="shrink-0">
|
|
913
|
+
<PaginationBar
|
|
914
|
+
page={page}
|
|
915
|
+
totalPages={totalPages}
|
|
916
|
+
busy={itemsQuery.isFetching}
|
|
917
|
+
onPrev={() => setPage((current) => Math.max(1, current - 1))}
|
|
918
|
+
onNext={() => setPage((current) => (totalPages > 0 ? Math.min(totalPages, current + 1) : current + 1))}
|
|
919
|
+
/>
|
|
920
|
+
</div>
|
|
917
921
|
)}
|
|
918
922
|
<ConfirmDialog />
|
|
919
923
|
</PageLayout>
|