@nexface/chat 0.1.9-alpha.1 → 0.1.10-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/styles.css CHANGED
@@ -1558,13 +1558,13 @@
1558
1558
  .nexface-ui .nxf-group-data-active\:opacity-100:is(:where(.nxf-group)[data-active] *) {
1559
1559
  opacity: 1;
1560
1560
  }
1561
- .nexface-ui .nxf-group-data-panel-open\/trigger\:rotate-90:is(:where(.nxf-group\/trigger)[data-panel-open] *) {
1562
- rotate: 90deg;
1563
- }
1564
1561
  .nexface-ui .nxf-group-data-\[size\=sm\]\/avatar\:text-xs:is(:where(.nxf-group\/avatar)[data-size="sm"] *) {
1565
1562
  font-size: var(--nxf-text-xs);
1566
1563
  line-height: var(--nxf-tw-leading, var(--nxf-text-xs--line-height));
1567
1564
  }
1565
+ .nexface-ui .nxf-group-data-\[state\=open\]\/trigger\:rotate-90:is(:where(.nxf-group\/trigger)[data-state="open"] *) {
1566
+ rotate: 90deg;
1567
+ }
1568
1568
  .nexface-ui .nxf-group-data-\[variant\=ghost\]\/tool-group-root\:mt-1:is(:where(.nxf-group\/tool-group-root)[data-variant="ghost"] *) {
1569
1569
  margin-top: var(--nxf-spacing);
1570
1570
  }
@@ -1629,9 +1629,6 @@
1629
1629
  .nexface-ui .nxf-group-data-open\/collapsible-content\:slide-in-from-top-4:is(:where(.nxf-group\/collapsible-content):where([data-state="open"], [data-open]:not([data-open="false"])) *) {
1630
1630
  --nxf-tw-enter-translate-y: calc(4*var(--nxf-spacing)*-1);
1631
1631
  }
1632
- .nexface-ui .nxf-group-data-open\/trigger\:rotate-90:is(:where(.nxf-group\/trigger):where([data-state="open"], [data-open]:not([data-open="false"])) *) {
1633
- rotate: 90deg;
1634
- }
1635
1632
  .nexface-ui .nxf-group-data-closed\/collapsible-content\:animate-out:is(:where(.nxf-group\/collapsible-content):where([data-state="closed"], [data-closed]:not([data-closed="false"])) *) {
1636
1633
  animation: nxf-exit var(--nxf-tw-animation-duration, var(--nxf-tw-duration, .15s))var(--nxf-tw-ease, ease)var(--nxf-tw-animation-delay, 0s)var(--nxf-tw-animation-iteration-count, 1)var(--nxf-tw-animation-direction, normal)var(--nxf-tw-animation-fill-mode, none);
1637
1634
  }
@@ -1,5 +1,5 @@
1
- import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
2
- declare const Collapsible: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/collapsible").CollapsibleRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
3
- declare function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props): import("react").JSX.Element;
4
- declare function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props): import("react").JSX.Element;
1
+ import { Collapsible as CollapsiblePrimitive } from "radix-ui";
2
+ declare const Collapsible: import("react").ForwardRefExoticComponent<Omit<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<Omit<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
4
+ declare const CollapsibleContent: import("react").ForwardRefExoticComponent<Omit<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
5
5
  export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { forwardRef } from "react";
4
- import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
4
+ import { Collapsible as CollapsiblePrimitive } from "radix-ui";
5
5
  const Collapsible = forwardRef(function Collapsible(props, ref) {
6
6
  return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ref: ref, ...props });
7
7
  });
8
- function CollapsibleTrigger({ ...props }) {
9
- return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ...props }));
10
- }
11
- function CollapsibleContent({ ...props }) {
12
- return (_jsx(CollapsiblePrimitive.Panel, { "data-slot": "collapsible-content", ...props }));
13
- }
8
+ const CollapsibleTrigger = forwardRef(function CollapsibleTrigger(props, ref) {
9
+ return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ref: ref, ...props }));
10
+ });
11
+ const CollapsibleContent = forwardRef(function CollapsibleContent(props, ref) {
12
+ return (_jsx(CollapsiblePrimitive.Content, { "data-slot": "collapsible-content", ref: ref, ...props }));
13
+ });
14
14
  export { Collapsible, CollapsibleTrigger, CollapsibleContent };
15
15
  //# sourceMappingURL=collapsible.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../src/ui/collapsible.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEjF,MAAM,WAAW,GAAG,UAAU,CAAkD,SAAS,WAAW,CAAC,KAAK,EAAE,GAAG;IAC7G,OAAO,KAAC,oBAAoB,CAAC,IAAI,iBAAW,aAAa,EAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC;AACpF,CAAC,CAAC,CAAC;AAEH,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAsC;IAC1E,OAAO,CACL,KAAC,oBAAoB,CAAC,OAAO,iBAAW,qBAAqB,KAAK,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAoC;IACxE,OAAO,CACL,KAAC,oBAAoB,CAAC,KAAK,iBAAW,qBAAqB,KAAK,KAAK,GAAI,CAC1E,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { Collapsible as CollapsiblePrimitive } from \"@base-ui/react/collapsible\";\n\nconst Collapsible = forwardRef<HTMLDivElement, CollapsiblePrimitive.Root.Props>(function Collapsible(props, ref) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" ref={ref} {...props} />;\n});\n\nfunction CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {\n return (\n <CollapsiblePrimitive.Trigger data-slot=\"collapsible-trigger\" {...props} />\n );\n}\n\nfunction CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {\n return (\n <CollapsiblePrimitive.Panel data-slot=\"collapsible-content\" {...props} />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"]}
1
+ {"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../src/ui/collapsible.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAiC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,GAAG,UAAU,CAA6E,SAAS,WAAW,CAAC,KAAK,EAAE,GAAG;IACxI,OAAO,KAAC,oBAAoB,CAAC,IAAI,iBAAW,aAAa,EAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC;AACpF,CAAC,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,UAAU,CAAmF,SAAS,kBAAkB,CAAC,KAAK,EAAE,GAAG;IAC5J,OAAO,CACL,KAAC,oBAAoB,CAAC,OAAO,iBAAW,qBAAqB,EAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CACtF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,UAAU,CAAgF,SAAS,kBAAkB,CAAC,KAAK,EAAE,GAAG;IACzJ,OAAO,CACL,KAAC,oBAAoB,CAAC,OAAO,iBAAW,qBAAqB,EAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CACtF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["\"use client\";\n\nimport { forwardRef, type ComponentPropsWithoutRef } from \"react\";\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\n\nconst Collapsible = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>>(function Collapsible(props, ref) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" ref={ref} {...props} />;\n});\n\nconst CollapsibleTrigger = forwardRef<HTMLButtonElement, ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>>(function CollapsibleTrigger(props, ref) {\n return (\n <CollapsiblePrimitive.Trigger data-slot=\"collapsible-trigger\" ref={ref} {...props} />\n );\n});\n\nconst CollapsibleContent = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>>(function CollapsibleContent(props, ref) {\n return (\n <CollapsiblePrimitive.Content data-slot=\"collapsible-content\" ref={ref} {...props} />\n );\n});\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"]}
@@ -7,7 +7,7 @@ import { CollapsibleTrigger } from "../collapsible.js";
7
7
  import { TraceLine, TraceMarker, useToolDuration, formatDuration, } from "./trace-line.js";
8
8
  export const disclosureContentClass = "border-foreground/10 ms-[5px] border-s ps-4";
9
9
  export function DisclosureTrigger({ live, label, detail, }) {
10
- return (_jsxs(CollapsibleTrigger, { "data-slot": "tool-group-trigger", className: cn("group/trigger my-1 flex max-w-full items-baseline gap-2 text-left font-mono text-[12px] outline-none [font-variant-ligatures:none] focus-visible:underline"), children: [_jsx(TraceMarker, { live: live, className: cn("group-data-open/trigger:rotate-90 group-data-panel-open/trigger:rotate-90") }), _jsx("span", { className: cn("text-muted-foreground group-hover/trigger:text-foreground min-w-0 truncate transition-colors"), children: live ? (_jsxs(ShimmerLabel, { children: [label, detail ? ` ${detail}` : null] })) : (_jsxs(_Fragment, { children: [label, detail ? ` ${detail}` : null] })) })] }));
10
+ return (_jsxs(CollapsibleTrigger, { "data-slot": "tool-group-trigger", className: cn("group/trigger my-1 flex max-w-full items-baseline gap-2 text-left font-mono text-[12px] outline-none [font-variant-ligatures:none] focus-visible:underline"), children: [_jsx(TraceMarker, { live: live, className: cn("group-data-[state=open]/trigger:rotate-90") }), _jsx("span", { className: cn("text-muted-foreground group-hover/trigger:text-foreground min-w-0 truncate transition-colors"), children: live ? (_jsxs(ShimmerLabel, { children: [label, detail ? ` ${detail}` : null] })) : (_jsxs(_Fragment, { children: [label, detail ? ` ${detail}` : null] })) })] }));
11
11
  }
12
12
  export function ToolCall({ toolName, args, argsText, result, status, isError, showDetails, presentation }) {
13
13
  const tool = presentation?.type === "tool" ? presentation : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/ui/home-demo/trace.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,CAAC;AAGb,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,SAAS,EACT,WAAW,EACX,eAAe,EACf,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,sBAAsB,GACjC,6CAA6C,CAAC;AAEhD,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,KAAK,EACL,MAAM,GAKP;IACC,OAAO,CACL,MAAC,kBAAkB,iBAAW,oBAAoB,EAAC,SAAS,EAAE,EAAE,CAAC,4JAA4J,C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C,CAAC,IAAI,EAAE,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,CAAC,CAAC,CAAC,IAAI,IACtU,IAAc,IAAG,CAAC;AACzC,CAAC","sourcesContent":["import type { UIMessagePart } from \"../../messages.js\";\nimport { cn } from \"../utils.js\";\nimport { Collapsible, CollapsibleContent } from \"../collapsible.js\";\n\"use client\";\n\nimport type { ToolCallMessagePartProps } from \"@assistant-ui/react\";\nimport { ShimmerLabel } from \"./surfaces.js\";\nimport { CollapsibleTrigger } from \"../collapsible.js\";\nimport {\n TraceLine,\n TraceMarker,\n useToolDuration,\n formatDuration,\n} from \"./trace-line.js\";\n\nexport const disclosureContentClass =\n \"border-foreground/10 ms-[5px] border-s ps-4\";\n\nexport function DisclosureTrigger({\n live,\n label,\n detail,\n}: {\n live: boolean;\n label: string;\n detail?: string;\n}) {\n return (\n <CollapsibleTrigger data-slot=\"tool-group-trigger\" className={cn(\"group/trigger my-1 flex max-w-full items-baseline gap-2 text-left font-mono text-[12px] outline-none [font-variant-ligatures:none] focus-visible:underline\")}>\n <TraceMarker\n live={live}\n className={cn(\"group-data-open/trigger:rotate-90 group-data-panel-open/trigger:rotate-90\")}\n />\n <span className={cn(\"text-muted-foreground group-hover/trigger:text-foreground min-w-0 truncate transition-colors\")}>\n {live ? (\n <ShimmerLabel>\n {label}\n {detail ? ` ${detail}` : null}\n </ShimmerLabel>\n ) : (\n <>\n {label}\n {detail ? ` ${detail}` : null}\n </>\n )}\n </span>\n </CollapsibleTrigger>\n );\n}\n\nexport function ToolCall({ toolName, args, argsText, result, status, isError, showDetails, presentation }: ToolCallMessagePartProps & { showDetails: boolean; presentation?: UIMessagePart | undefined }) {\n const tool = presentation?.type === \"tool\" ? presentation : undefined;\n const error = tool?.error;\n const label = tool?.toolState === \"unknown\" ? \"Result unknown\" : tool?.toolState === \"rejected\" ? \"Rejected\" : tool?.toolState === \"cancelled\" ? \"Stopped\" : tool?.toolState === \"not_started\" ? \"Not started\" : tool?.toolState === \"failed\" || isError ? \"Failed\" : undefined;\n const live = !label && status?.type === \"running\";\n const duration = useToolDuration(live);\n const line = <TraceLine live={live} label={label ?? (live ? \"running\" : \"ran\")} detail={toolName} {...(duration === null ? {} : { meta: formatDuration(duration) })} />;\n const reason = error && !error.parentErrorId && error.scope === \"tool\" && error.execution !== \"unknown\" ? <p role=\"alert\" className={cn(\"mt-2 border-l-2 pl-3 text-[13px] border-destructive/60 text-destructive\")}>{error.userMessage}</p> : null;\n if (!showDetails) return <>{line}{reason}</>;\n return <>{line}{reason}<Collapsible><DisclosureTrigger live={false} label=\"操作明细\" /><CollapsibleContent className={cn(disclosureContentClass)}>\n <pre className={cn(\"overflow-x-auto text-xs\")} aria-label=\"操作输入\">{argsText || JSON.stringify(args, null, 2)}</pre>\n {result !== undefined ? <pre className={cn(\"overflow-x-auto text-xs\")} aria-label=\"操作输出\">{error ? error.userMessage : tool?.toolState === \"cancelled\" ? \"Stopped\" : tool?.toolState === \"rejected\" ? \"Rejected\" : tool?.toolState === \"not_started\" ? \"Not started\" : typeof result === \"string\" ? result : JSON.stringify(result, null, 2)}</pre> : null}\n </CollapsibleContent></Collapsible></>;\n}\n"]}
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/ui/home-demo/trace.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,CAAC;A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,EAAC,0BAAM,GAAG,EAAA,MAAC,kBAAkB,IAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,aAC1I,cAAK,SAAS,EAAE,EAAE,CAAC,yBAAyB,CAAC,gBAAa,0BAAM,YAAE,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,EACjH,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,EAAE,CAAC,yBAAyB,CAAC,gBAAa,0BAAM,YAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,CAAC,CAAC,CAAC,IAAI,IACtU,IAAc,IAAG,CAAC;AACzC,CAAC","sourcesContent":["import type { UIMessagePart } from \"../../messages.js\";\nimport { cn } from \"../utils.js\";\nimport { Collapsible, CollapsibleContent } from \"../collapsible.js\";\n\"use client\";\n\nimport type { ToolCallMessagePartProps } from \"@assistant-ui/react\";\nimport { ShimmerLabel } from \"./surfaces.js\";\nimport { CollapsibleTrigger } from \"../collapsible.js\";\nimport {\n TraceLine,\n TraceMarker,\n useToolDuration,\n formatDuration,\n} from \"./trace-line.js\";\n\nexport const disclosureContentClass =\n \"border-foreground/10 ms-[5px] border-s ps-4\";\n\nexport function DisclosureTrigger({\n live,\n label,\n detail,\n}: {\n live: boolean;\n label: string;\n detail?: string;\n}) {\n return (\n <CollapsibleTrigger data-slot=\"tool-group-trigger\" className={cn(\"group/trigger my-1 flex max-w-full items-baseline gap-2 text-left font-mono text-[12px] outline-none [font-variant-ligatures:none] focus-visible:underline\")}>\n <TraceMarker\n live={live}\n className={cn(\"group-data-[state=open]/trigger:rotate-90\")}\n />\n <span className={cn(\"text-muted-foreground group-hover/trigger:text-foreground min-w-0 truncate transition-colors\")}>\n {live ? (\n <ShimmerLabel>\n {label}\n {detail ? ` ${detail}` : null}\n </ShimmerLabel>\n ) : (\n <>\n {label}\n {detail ? ` ${detail}` : null}\n </>\n )}\n </span>\n </CollapsibleTrigger>\n );\n}\n\nexport function ToolCall({ toolName, args, argsText, result, status, isError, showDetails, presentation }: ToolCallMessagePartProps & { showDetails: boolean; presentation?: UIMessagePart | undefined }) {\n const tool = presentation?.type === \"tool\" ? presentation : undefined;\n const error = tool?.error;\n const label = tool?.toolState === \"unknown\" ? \"Result unknown\" : tool?.toolState === \"rejected\" ? \"Rejected\" : tool?.toolState === \"cancelled\" ? \"Stopped\" : tool?.toolState === \"not_started\" ? \"Not started\" : tool?.toolState === \"failed\" || isError ? \"Failed\" : undefined;\n const live = !label && status?.type === \"running\";\n const duration = useToolDuration(live);\n const line = <TraceLine live={live} label={label ?? (live ? \"running\" : \"ran\")} detail={toolName} {...(duration === null ? {} : { meta: formatDuration(duration) })} />;\n const reason = error && !error.parentErrorId && error.scope === \"tool\" && error.execution !== \"unknown\" ? <p role=\"alert\" className={cn(\"mt-2 border-l-2 pl-3 text-[13px] border-destructive/60 text-destructive\")}>{error.userMessage}</p> : null;\n if (!showDetails) return <>{line}{reason}</>;\n return <>{line}{reason}<Collapsible><DisclosureTrigger live={false} label=\"操作明细\" /><CollapsibleContent className={cn(disclosureContentClass)}>\n <pre className={cn(\"overflow-x-auto text-xs\")} aria-label=\"操作输入\">{argsText || JSON.stringify(args, null, 2)}</pre>\n {result !== undefined ? <pre className={cn(\"overflow-x-auto text-xs\")} aria-label=\"操作输出\">{error ? error.userMessage : tool?.toolState === \"cancelled\" ? \"Stopped\" : tool?.toolState === \"rejected\" ? \"Rejected\" : tool?.toolState === \"not_started\" ? \"Not started\" : typeof result === \"string\" ? result : JSON.stringify(result, null, 2)}</pre> : null}\n </CollapsibleContent></Collapsible></>;\n}\n"]}
package/dist/ui/input.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { Input as InputPrimitive } from "@base-ui/react/input";
4
3
  import { cn } from "./utils.js";
5
4
  const Input = React.forwardRef(function Input({ className, type, ...props }, ref) {
6
- return (_jsx(InputPrimitive, { ref: ref, type: type, "data-slot": "input", className: cn("file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 bg-muted/60 focus-visible:bg-background h-9 w-full min-w-0 rounded-lg border border-transparent px-3 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-1 md:text-sm", className), ...props }));
5
+ return (_jsx("input", { ref: ref, type: type, "data-slot": "input", className: cn("file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 bg-muted/60 focus-visible:bg-background h-9 w-full min-w-0 rounded-lg border border-transparent px-3 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-1 md:text-sm", className), ...props }));
7
6
  });
8
7
  export { Input };
9
8
  //# sourceMappingURL=input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/ui/input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAA4D,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACzI,OAAO,CACL,KAAC,cAAc,IACb,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,eACA,OAAO,EACjB,SAAS,EAAE,EAAE,CACX,ypBAAypB,EACzpB,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import * as React from \"react\";\nimport { Input as InputPrimitive } from \"@base-ui/react/input\";\n\nimport { cn } from \"./utils.js\";\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentPropsWithoutRef<\"input\">>(function Input({ className, type, ...props }, ref) {\n return (\n <InputPrimitive\n ref={ref}\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 bg-muted/60 focus-visible:bg-background h-9 w-full min-w-0 rounded-lg border border-transparent px-3 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-1 md:text-sm\",\n className,\n )}\n {...props}\n />\n );\n});\n\nexport { Input };\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/ui/input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAA4D,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACzI,OAAO,CACL,gBACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,eACA,OAAO,EACjB,SAAS,EAAE,EAAE,CACX,ypBAAypB,EACzpB,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils.js\";\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentPropsWithoutRef<\"input\">>(function Input({ className, type, ...props }, ref) {\n return (\n <input\n ref={ref}\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 bg-muted/60 focus-visible:bg-background h-9 w-full min-w-0 rounded-lg border border-transparent px-3 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-1 md:text-sm\",\n className,\n )}\n {...props}\n />\n );\n});\n\nexport { Input };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexface/chat",
3
- "version": "0.1.9-alpha.1",
3
+ "version": "0.1.10-alpha.0",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@ag-ui/core": "0.0.59",
21
- "@nexface/agent": "0.1.9-alpha.1",
21
+ "@nexface/agent": "0.1.10-alpha.0",
22
22
  "class-variance-authority": "0.7.1",
23
23
  "clsx": "2.1.1",
24
24
  "fast-json-patch": "3.1.1",
@@ -27,7 +27,7 @@
27
27
  "use-sync-external-store": "1.7.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@nexface/tools": "0.1.9-alpha.1",
30
+ "@nexface/tools": "0.1.10-alpha.0",
31
31
  "react": ">=17",
32
32
  "react-dom": ">=17"
33
33
  },