@lssm/module.ai-chat 0.0.0-canary-20251217080011 → 1.41.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/ai-chat.feature.js +1 -93
- package/dist/context/context-builder.js +2 -147
- package/dist/context/file-operations.js +1 -174
- package/dist/context/index.js +1 -5
- package/dist/context/workspace-context.js +2 -123
- package/dist/core/chat-service.js +2 -211
- package/dist/core/conversation-store.js +1 -108
- package/dist/core/index.js +1 -4
- package/dist/index.js +1 -22
- package/dist/presentation/components/ChatContainer.js +1 -62
- package/dist/presentation/components/ChatInput.js +1 -149
- package/dist/presentation/components/ChatMessage.js +1 -135
- package/dist/presentation/components/CodePreview.js +2 -126
- package/dist/presentation/components/ContextIndicator.js +1 -96
- package/dist/presentation/components/ModelPicker.js +1 -197
- package/dist/presentation/components/index.js +1 -8
- package/dist/presentation/hooks/index.js +1 -4
- package/dist/presentation/hooks/useChat.js +1 -171
- package/dist/presentation/hooks/useProviders.js +1 -42
- package/dist/presentation/index.js +1 -12
- package/dist/providers/chat-utilities.js +1 -16
- package/dist/providers/index.js +1 -7
- package/package.json +17 -18
- package/dist/ai-chat.feature.d.ts +0 -11
- package/dist/context/context-builder.d.ts +0 -56
- package/dist/context/file-operations.d.ts +0 -99
- package/dist/context/index.d.ts +0 -4
- package/dist/context/workspace-context.d.ts +0 -116
- package/dist/core/chat-service.d.ts +0 -72
- package/dist/core/conversation-store.d.ts +0 -73
- package/dist/core/index.d.ts +0 -4
- package/dist/core/message-types.d.ts +0 -149
- package/dist/index.d.ts +0 -16
- package/dist/libs/ai-providers/dist/factory.js +0 -225
- package/dist/libs/ai-providers/dist/index.js +0 -4
- package/dist/libs/ai-providers/dist/legacy.js +0 -2
- package/dist/libs/ai-providers/dist/models.js +0 -299
- package/dist/libs/ai-providers/dist/validation.js +0 -60
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +0 -5
- package/dist/libs/design-system/dist/components/atoms/Button.js +0 -33
- package/dist/libs/design-system/dist/components/atoms/Textarea.js +0 -35
- package/dist/libs/design-system/dist/lib/keyboard.js +0 -193
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +0 -55
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/textarea.js +0 -16
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +0 -13
- package/dist/libs/ui-kit-web/dist/ui/avatar.js +0 -25
- package/dist/libs/ui-kit-web/dist/ui/badge.js +0 -26
- package/dist/libs/ui-kit-web/dist/ui/scroll-area.js +0 -39
- package/dist/libs/ui-kit-web/dist/ui/select.js +0 -79
- package/dist/libs/ui-kit-web/dist/ui/skeleton.js +0 -14
- package/dist/libs/ui-kit-web/dist/ui/tooltip.js +0 -39
- package/dist/libs/ui-kit-web/dist/ui/utils.js +0 -10
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +0 -10
- package/dist/presentation/components/ChatContainer.d.ts +0 -20
- package/dist/presentation/components/ChatInput.d.ts +0 -34
- package/dist/presentation/components/ChatMessage.d.ts +0 -23
- package/dist/presentation/components/CodePreview.d.ts +0 -39
- package/dist/presentation/components/ContextIndicator.d.ts +0 -25
- package/dist/presentation/components/ModelPicker.d.ts +0 -38
- package/dist/presentation/components/index.d.ts +0 -7
- package/dist/presentation/hooks/index.d.ts +0 -3
- package/dist/presentation/hooks/useChat.d.ts +0 -66
- package/dist/presentation/hooks/useProviders.d.ts +0 -37
- package/dist/presentation/index.d.ts +0 -10
- package/dist/providers/chat-utilities.d.ts +0 -14
- package/dist/providers/index.d.ts +0 -3
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { __esmMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
|
|
5
|
-
//#region ../../libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js
|
|
6
|
-
function cn(...inputs) {
|
|
7
|
-
return twMerge(clsx(inputs));
|
|
8
|
-
}
|
|
9
|
-
var init_utils = __esmMin((() => {}));
|
|
10
|
-
init_utils();
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { cn, init_utils };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from "./utils.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
7
|
-
|
|
8
|
-
//#region ../../libs/ui-kit-web/dist/ui/avatar.js
|
|
9
|
-
function Avatar({ className, ...props }) {
|
|
10
|
-
return /* @__PURE__ */ jsx(AvatarPrimitive.Root, {
|
|
11
|
-
"data-slot": "avatar",
|
|
12
|
-
className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
|
|
13
|
-
...props
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function AvatarFallback({ className, ...props }) {
|
|
17
|
-
return /* @__PURE__ */ jsx(AvatarPrimitive.Fallback, {
|
|
18
|
-
"data-slot": "avatar-fallback",
|
|
19
|
-
className: cn("bg-muted flex size-full items-center justify-center rounded-full", className),
|
|
20
|
-
...props
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { Avatar, AvatarFallback };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { cn } from "../ui-kit-core/dist/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
-
|
|
7
|
-
//#region ../../libs/ui-kit-web/dist/ui/badge.js
|
|
8
|
-
const badgeVariants = cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden", {
|
|
9
|
-
variants: { variant: {
|
|
10
|
-
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
11
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
12
|
-
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
13
|
-
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
14
|
-
} },
|
|
15
|
-
defaultVariants: { variant: "default" }
|
|
16
|
-
});
|
|
17
|
-
function Badge({ className, variant, asChild = false, ...props }) {
|
|
18
|
-
return /* @__PURE__ */ jsx(asChild ? Slot : "span", {
|
|
19
|
-
"data-slot": "badge",
|
|
20
|
-
className: cn(badgeVariants({ variant }), className),
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
export { Badge };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from "../ui-kit-core/dist/utils.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
7
|
-
|
|
8
|
-
//#region ../../libs/ui-kit-web/dist/ui/scroll-area.js
|
|
9
|
-
function ScrollArea({ className, children, ...props }) {
|
|
10
|
-
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
11
|
-
"data-slot": "scroll-area",
|
|
12
|
-
className: cn("relative", className),
|
|
13
|
-
...props,
|
|
14
|
-
children: [
|
|
15
|
-
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
|
|
16
|
-
"data-slot": "scroll-area-viewport",
|
|
17
|
-
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] outline-hidden transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1",
|
|
18
|
-
children
|
|
19
|
-
}),
|
|
20
|
-
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
21
|
-
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
22
|
-
]
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
26
|
-
return /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, {
|
|
27
|
-
"data-slot": "scroll-area-scrollbar",
|
|
28
|
-
orientation,
|
|
29
|
-
className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", className),
|
|
30
|
-
...props,
|
|
31
|
-
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, {
|
|
32
|
-
"data-slot": "scroll-area-thumb",
|
|
33
|
-
className: "bg-border relative flex-1 rounded-full"
|
|
34
|
-
})
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { ScrollArea };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from "../ui-kit-core/dist/utils.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
7
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
8
|
-
|
|
9
|
-
//#region ../../libs/ui-kit-web/dist/ui/select.js
|
|
10
|
-
function Select({ ...props }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
|
|
12
|
-
"data-slot": "select",
|
|
13
|
-
...props
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function SelectValue({ ...props }) {
|
|
17
|
-
return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
|
|
18
|
-
"data-slot": "select-value",
|
|
19
|
-
...props
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
23
|
-
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
24
|
-
"data-slot": "select-trigger",
|
|
25
|
-
"data-size": size,
|
|
26
|
-
className: cn("aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-input focus-visible:border-ring focus-visible:ring-ring/50 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-2xs outline-hidden transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
27
|
-
...props,
|
|
28
|
-
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
29
|
-
asChild: true,
|
|
30
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" })
|
|
31
|
-
})]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function SelectContent({ className, children, position = "popper", ...props }) {
|
|
35
|
-
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
36
|
-
"data-slot": "select-content",
|
|
37
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
38
|
-
position,
|
|
39
|
-
...props,
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
42
|
-
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
43
|
-
className: cn("p-1", position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"),
|
|
44
|
-
children
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
47
|
-
]
|
|
48
|
-
}) });
|
|
49
|
-
}
|
|
50
|
-
function SelectItem({ className, children, ...props }) {
|
|
51
|
-
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
52
|
-
"data-slot": "select-item",
|
|
53
|
-
className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-xs py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
54
|
-
...props,
|
|
55
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
56
|
-
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
57
|
-
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
58
|
-
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function SelectScrollUpButton({ className, ...props }) {
|
|
62
|
-
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
63
|
-
"data-slot": "select-scroll-up-button",
|
|
64
|
-
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
65
|
-
...props,
|
|
66
|
-
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
function SelectScrollDownButton({ className, ...props }) {
|
|
70
|
-
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
71
|
-
"data-slot": "select-scroll-down-button",
|
|
72
|
-
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
73
|
-
...props,
|
|
74
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
//#endregion
|
|
79
|
-
export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { cn } from "./utils.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region ../../libs/ui-kit-web/dist/ui/skeleton.js
|
|
5
|
-
function Skeleton({ className, ...props }) {
|
|
6
|
-
return /* @__PURE__ */ jsx("div", {
|
|
7
|
-
"data-slot": "skeleton",
|
|
8
|
-
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
9
|
-
...props
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Skeleton };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from "../ui-kit-core/dist/utils.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
7
|
-
|
|
8
|
-
//#region ../../libs/ui-kit-web/dist/ui/tooltip.js
|
|
9
|
-
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
10
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, {
|
|
11
|
-
"data-slot": "tooltip-provider",
|
|
12
|
-
delayDuration,
|
|
13
|
-
...props
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function Tooltip({ ...props }) {
|
|
17
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, {
|
|
18
|
-
"data-slot": "tooltip",
|
|
19
|
-
...props
|
|
20
|
-
}) });
|
|
21
|
-
}
|
|
22
|
-
function TooltipTrigger({ ...props }) {
|
|
23
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, {
|
|
24
|
-
"data-slot": "tooltip-trigger",
|
|
25
|
-
...props
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
29
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(TooltipPrimitive.Content, {
|
|
30
|
-
"data-slot": "tooltip-content",
|
|
31
|
-
sideOffset,
|
|
32
|
-
className: cn("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", className),
|
|
33
|
-
...props,
|
|
34
|
-
children: [children, /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]" })]
|
|
35
|
-
}) });
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/presentation/components/ChatContainer.d.ts
|
|
5
|
-
interface ChatContainerProps {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
/** Show scroll-to-bottom button when scrolled up */
|
|
9
|
-
showScrollButton?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Container component for chat messages with scrolling
|
|
13
|
-
*/
|
|
14
|
-
declare function ChatContainer({
|
|
15
|
-
children,
|
|
16
|
-
className,
|
|
17
|
-
showScrollButton
|
|
18
|
-
}: ChatContainerProps): react_jsx_runtime0.JSX.Element;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { ChatContainer };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ChatAttachment } from "../../core/message-types.js";
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/presentation/components/ChatInput.d.ts
|
|
5
|
-
interface ChatInputProps {
|
|
6
|
-
/** Called when a message is sent */
|
|
7
|
-
onSend: (content: string, attachments?: ChatAttachment[]) => void;
|
|
8
|
-
/** Whether input is disabled (e.g., during streaming) */
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
/** Whether currently loading/streaming */
|
|
11
|
-
isLoading?: boolean;
|
|
12
|
-
/** Placeholder text */
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
/** Additional class name */
|
|
15
|
-
className?: string;
|
|
16
|
-
/** Show attachment button */
|
|
17
|
-
showAttachments?: boolean;
|
|
18
|
-
/** Max attachments allowed */
|
|
19
|
-
maxAttachments?: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Chat input component with attachment support
|
|
23
|
-
*/
|
|
24
|
-
declare function ChatInput({
|
|
25
|
-
onSend,
|
|
26
|
-
disabled,
|
|
27
|
-
isLoading,
|
|
28
|
-
placeholder,
|
|
29
|
-
className,
|
|
30
|
-
showAttachments,
|
|
31
|
-
maxAttachments
|
|
32
|
-
}: ChatInputProps): react_jsx_runtime0.JSX.Element;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { ChatInput };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ChatMessage } from "../../core/message-types.js";
|
|
2
|
-
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/presentation/components/ChatMessage.d.ts
|
|
5
|
-
interface ChatMessageProps {
|
|
6
|
-
message: ChatMessage;
|
|
7
|
-
className?: string;
|
|
8
|
-
/** Show copy button */
|
|
9
|
-
showCopy?: boolean;
|
|
10
|
-
/** Show avatar */
|
|
11
|
-
showAvatar?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Chat message component
|
|
15
|
-
*/
|
|
16
|
-
declare function ChatMessage$1({
|
|
17
|
-
message,
|
|
18
|
-
className,
|
|
19
|
-
showCopy,
|
|
20
|
-
showAvatar
|
|
21
|
-
}: ChatMessageProps): react_jsx_runtime1.JSX.Element;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { ChatMessage$1 as ChatMessage };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
//#region src/presentation/components/CodePreview.d.ts
|
|
4
|
-
interface CodePreviewProps {
|
|
5
|
-
/** Code content */
|
|
6
|
-
code: string;
|
|
7
|
-
/** Programming language */
|
|
8
|
-
language?: string;
|
|
9
|
-
/** File name */
|
|
10
|
-
filename?: string;
|
|
11
|
-
/** Additional class name */
|
|
12
|
-
className?: string;
|
|
13
|
-
/** Show copy button */
|
|
14
|
-
showCopy?: boolean;
|
|
15
|
-
/** Show execute button (for applicable languages) */
|
|
16
|
-
showExecute?: boolean;
|
|
17
|
-
/** Called when execute is clicked */
|
|
18
|
-
onExecute?: (code: string) => void;
|
|
19
|
-
/** Show download button */
|
|
20
|
-
showDownload?: boolean;
|
|
21
|
-
/** Max height before scroll */
|
|
22
|
-
maxHeight?: number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Code preview component with syntax highlighting placeholder
|
|
26
|
-
*/
|
|
27
|
-
declare function CodePreview({
|
|
28
|
-
code,
|
|
29
|
-
language,
|
|
30
|
-
filename,
|
|
31
|
-
className,
|
|
32
|
-
showCopy,
|
|
33
|
-
showExecute,
|
|
34
|
-
onExecute,
|
|
35
|
-
showDownload,
|
|
36
|
-
maxHeight
|
|
37
|
-
}: CodePreviewProps): react_jsx_runtime2.JSX.Element;
|
|
38
|
-
//#endregion
|
|
39
|
-
export { CodePreview };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { WorkspaceSummary } from "../../context/workspace-context.js";
|
|
2
|
-
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/presentation/components/ContextIndicator.d.ts
|
|
5
|
-
interface ContextIndicatorProps {
|
|
6
|
-
/** Workspace summary */
|
|
7
|
-
summary?: WorkspaceSummary;
|
|
8
|
-
/** Whether context is active */
|
|
9
|
-
active?: boolean;
|
|
10
|
-
/** Additional class name */
|
|
11
|
-
className?: string;
|
|
12
|
-
/** Show details */
|
|
13
|
-
showDetails?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Indicator showing active workspace context
|
|
17
|
-
*/
|
|
18
|
-
declare function ContextIndicator({
|
|
19
|
-
summary,
|
|
20
|
-
active,
|
|
21
|
-
className,
|
|
22
|
-
showDetails
|
|
23
|
-
}: ContextIndicatorProps): react_jsx_runtime3.JSX.Element;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { ContextIndicator };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
2
|
-
import { ProviderMode, ProviderName } from "@lssm/lib.ai-providers";
|
|
3
|
-
|
|
4
|
-
//#region src/presentation/components/ModelPicker.d.ts
|
|
5
|
-
interface ModelSelection {
|
|
6
|
-
provider: ProviderName;
|
|
7
|
-
model: string;
|
|
8
|
-
mode: ProviderMode;
|
|
9
|
-
}
|
|
10
|
-
interface ModelPickerProps {
|
|
11
|
-
/** Currently selected provider/model */
|
|
12
|
-
value: ModelSelection;
|
|
13
|
-
/** Called when selection changes */
|
|
14
|
-
onChange: (value: ModelSelection) => void;
|
|
15
|
-
/** Available providers (with availability info) */
|
|
16
|
-
availableProviders?: Array<{
|
|
17
|
-
provider: ProviderName;
|
|
18
|
-
available: boolean;
|
|
19
|
-
mode: ProviderMode;
|
|
20
|
-
reason?: string;
|
|
21
|
-
}>;
|
|
22
|
-
/** Additional class name */
|
|
23
|
-
className?: string;
|
|
24
|
-
/** Compact mode (smaller) */
|
|
25
|
-
compact?: boolean;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Model picker component for selecting AI provider and model
|
|
29
|
-
*/
|
|
30
|
-
declare function ModelPicker({
|
|
31
|
-
value,
|
|
32
|
-
onChange,
|
|
33
|
-
availableProviders,
|
|
34
|
-
className,
|
|
35
|
-
compact
|
|
36
|
-
}: ModelPickerProps): react_jsx_runtime4.JSX.Element;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { ModelPicker };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ChatContainer } from "./ChatContainer.js";
|
|
2
|
-
import { ChatMessage } from "./ChatMessage.js";
|
|
3
|
-
import { ChatInput } from "./ChatInput.js";
|
|
4
|
-
import { ModelPicker } from "./ModelPicker.js";
|
|
5
|
-
import { ContextIndicator } from "./ContextIndicator.js";
|
|
6
|
-
import { CodePreview } from "./CodePreview.js";
|
|
7
|
-
export { ChatContainer, ChatInput, ChatMessage, CodePreview, ContextIndicator, ModelPicker };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ChatAttachment, ChatConversation, ChatMessage } from "../../core/message-types.js";
|
|
2
|
-
import { ProviderMode, ProviderName } from "@lssm/lib.ai-providers";
|
|
3
|
-
|
|
4
|
-
//#region src/presentation/hooks/useChat.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Options for useChat hook
|
|
8
|
-
*/
|
|
9
|
-
interface UseChatOptions {
|
|
10
|
-
/** Provider to use */
|
|
11
|
-
provider?: ProviderName;
|
|
12
|
-
/** Provider mode */
|
|
13
|
-
mode?: ProviderMode;
|
|
14
|
-
/** Model to use */
|
|
15
|
-
model?: string;
|
|
16
|
-
/** API key for BYOK mode */
|
|
17
|
-
apiKey?: string;
|
|
18
|
-
/** API proxy URL for managed mode */
|
|
19
|
-
proxyUrl?: string;
|
|
20
|
-
/** Initial conversation ID to resume */
|
|
21
|
-
conversationId?: string;
|
|
22
|
-
/** System prompt override */
|
|
23
|
-
systemPrompt?: string;
|
|
24
|
-
/** Enable streaming */
|
|
25
|
-
streaming?: boolean;
|
|
26
|
-
/** Called when a message is sent */
|
|
27
|
-
onSend?: (message: ChatMessage) => void;
|
|
28
|
-
/** Called when a response is received */
|
|
29
|
-
onResponse?: (message: ChatMessage) => void;
|
|
30
|
-
/** Called on error */
|
|
31
|
-
onError?: (error: Error) => void;
|
|
32
|
-
/** Called when usage is recorded */
|
|
33
|
-
onUsage?: (usage: {
|
|
34
|
-
inputTokens: number;
|
|
35
|
-
outputTokens: number;
|
|
36
|
-
}) => void;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Return type for useChat hook
|
|
40
|
-
*/
|
|
41
|
-
interface UseChatReturn {
|
|
42
|
-
/** Current messages */
|
|
43
|
-
messages: ChatMessage[];
|
|
44
|
-
/** Current conversation */
|
|
45
|
-
conversation: ChatConversation | null;
|
|
46
|
-
/** Whether currently loading/streaming */
|
|
47
|
-
isLoading: boolean;
|
|
48
|
-
/** Current error */
|
|
49
|
-
error: Error | null;
|
|
50
|
-
/** Send a message */
|
|
51
|
-
sendMessage: (content: string, attachments?: ChatAttachment[]) => Promise<void>;
|
|
52
|
-
/** Clear conversation and start fresh */
|
|
53
|
-
clearConversation: () => void;
|
|
54
|
-
/** Set conversation ID to resume */
|
|
55
|
-
setConversationId: (id: string | null) => void;
|
|
56
|
-
/** Regenerate last response */
|
|
57
|
-
regenerate: () => Promise<void>;
|
|
58
|
-
/** Stop current generation */
|
|
59
|
-
stop: () => void;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Hook for managing AI chat state
|
|
63
|
-
*/
|
|
64
|
-
declare function useChat(options?: UseChatOptions): UseChatReturn;
|
|
65
|
-
//#endregion
|
|
66
|
-
export { UseChatOptions, UseChatReturn, useChat };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ModelInfo, ProviderMode, ProviderName } from "@lssm/lib.ai-providers";
|
|
2
|
-
|
|
3
|
-
//#region src/presentation/hooks/useProviders.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Provider availability info
|
|
7
|
-
*/
|
|
8
|
-
interface ProviderInfo {
|
|
9
|
-
provider: ProviderName;
|
|
10
|
-
available: boolean;
|
|
11
|
-
mode: ProviderMode;
|
|
12
|
-
reason?: string;
|
|
13
|
-
models: ModelInfo[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Return type for useProviders hook
|
|
17
|
-
*/
|
|
18
|
-
interface UseProvidersReturn {
|
|
19
|
-
/** All providers with availability info */
|
|
20
|
-
providers: ProviderInfo[];
|
|
21
|
-
/** Available providers only */
|
|
22
|
-
availableProviders: ProviderInfo[];
|
|
23
|
-
/** Check if a provider is available */
|
|
24
|
-
isAvailable: (provider: ProviderName) => boolean;
|
|
25
|
-
/** Get models for a provider */
|
|
26
|
-
getModels: (provider: ProviderName) => ModelInfo[];
|
|
27
|
-
/** Loading state */
|
|
28
|
-
isLoading: boolean;
|
|
29
|
-
/** Refresh provider availability */
|
|
30
|
-
refresh: () => Promise<void>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Hook for managing AI provider information
|
|
34
|
-
*/
|
|
35
|
-
declare function useProviders(): UseProvidersReturn;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { UseProvidersReturn, useProviders };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ChatContainer } from "./components/ChatContainer.js";
|
|
2
|
-
import { ChatMessage } from "./components/ChatMessage.js";
|
|
3
|
-
import { ChatInput } from "./components/ChatInput.js";
|
|
4
|
-
import { ModelPicker } from "./components/ModelPicker.js";
|
|
5
|
-
import { ContextIndicator } from "./components/ContextIndicator.js";
|
|
6
|
-
import { CodePreview } from "./components/CodePreview.js";
|
|
7
|
-
import "./components/index.js";
|
|
8
|
-
import { UseChatOptions, UseChatReturn, useChat } from "./hooks/useChat.js";
|
|
9
|
-
import { UseProvidersReturn, useProviders } from "./hooks/useProviders.js";
|
|
10
|
-
export { ChatContainer, ChatInput, ChatMessage, CodePreview, ContextIndicator, ModelPicker, UseChatOptions, UseChatReturn, UseProvidersReturn, useChat, useProviders };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ProviderName } from "@lssm/lib.ai-providers";
|
|
2
|
-
|
|
3
|
-
//#region src/providers/chat-utilities.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Check if a provider supports local mode
|
|
7
|
-
*/
|
|
8
|
-
declare function supportsLocalMode(provider: ProviderName): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Check if a provider is available in Studio (cloud only)
|
|
11
|
-
*/
|
|
12
|
-
declare function isStudioAvailable(provider: ProviderName): boolean;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { isStudioAvailable, supportsLocalMode };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { isStudioAvailable, supportsLocalMode } from "./chat-utilities.js";
|
|
2
|
-
import { DEFAULT_MODELS, MODELS, ModelCapabilities, ModelInfo as ChatModelInfo, Provider as ChatProvider, ProviderAvailability, ProviderConfig as ChatProviderConfig, ProviderMode as ChatProviderMode, ProviderName as ChatProviderName, createProvider, createProviderFromEnv, getAvailableProviders, getDefaultModel, getEnvVarName, getModelInfo, getModelsForProvider, getRecommendedModels, hasCredentials, isOllamaRunning, listOllamaModels, validateProvider } from "@lssm/lib.ai-providers";
|
|
3
|
-
export { type ChatModelInfo, type ChatProvider, type ChatProviderConfig, type ChatProviderMode, type ChatProviderName, DEFAULT_MODELS, MODELS, type ModelCapabilities, type ProviderAvailability, createProvider, createProviderFromEnv, getAvailableProviders, getDefaultModel, getEnvVarName, getModelInfo, getModelsForProvider, getRecommendedModels, hasCredentials, isOllamaRunning, isStudioAvailable, listOllamaModels, supportsLocalMode, validateProvider };
|