@rnsk/bot 0.0.1 → 0.0.2
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/components/bot-message-thread.d.ts.map +1 -1
- package/dist/components/bot-message-thread.js +4 -4
- package/dist/components/bot-message-thread.js.map +1 -1
- package/dist/components/bot-shell.js +1 -1
- package/dist/components/bot-shell.js.map +1 -1
- package/dist/components/bot-widget.d.ts +17 -0
- package/dist/components/bot-widget.d.ts.map +1 -0
- package/dist/components/bot-widget.js +23 -0
- package/dist/components/bot-widget.js.map +1 -0
- package/dist/components/chat/initiate-connection.d.ts.map +1 -1
- package/dist/components/chat/initiate-connection.js +1 -1
- package/dist/components/chat/initiate-connection.js.map +1 -1
- package/dist/components/chat/loading-state.js +1 -1
- package/dist/components/chat/loading-state.js.map +1 -1
- package/dist/components/chat/reasoning-state.d.ts.map +1 -1
- package/dist/components/chat/reasoning-state.js +1 -1
- package/dist/components/chat/reasoning-state.js.map +1 -1
- package/dist/components/chat/streaming-text.d.ts.map +1 -1
- package/dist/components/chat/streaming-text.js +1 -2
- package/dist/components/chat/streaming-text.js.map +1 -1
- package/dist/components/chat/tool-call-ui.d.ts.map +1 -1
- package/dist/components/chat/tool-call-ui.js +1 -1
- package/dist/components/chat/tool-call-ui.js.map +1 -1
- package/dist/components/runstack-bot.d.ts.map +1 -1
- package/dist/components/runstack-bot.js +3 -5
- package/dist/components/runstack-bot.js.map +1 -1
- package/package.json +1 -1
- package/styles/bot.css +283 -3
- package/dist/components/bot-gooey-input.d.ts +0 -12
- package/dist/components/bot-gooey-input.d.ts.map +0 -1
- package/dist/components/bot-gooey-input.js +0 -25
- package/dist/components/bot-gooey-input.js.map +0 -1
- package/dist/components/bot-gooey-stack.d.ts +0 -6
- package/dist/components/bot-gooey-stack.d.ts.map +0 -1
- package/dist/components/bot-gooey-stack.js +0 -13
- package/dist/components/bot-gooey-stack.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-message-thread.d.ts","sourceRoot":"","sources":["../../src/components/bot-message-thread.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAepC,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,WAAmB,GACpB,EAAE;IACD,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,+
|
|
1
|
+
{"version":3,"file":"bot-message-thread.d.ts","sourceRoot":"","sources":["../../src/components/bot-message-thread.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAepC,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,WAAmB,GACpB,EAAE;IACD,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,+BA+EA"}
|
|
@@ -11,16 +11,16 @@ export function BotMessageThread({ messages, isStreaming = false, }) {
|
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
endRef.current?.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
13
13
|
}, [messages, isStreaming]);
|
|
14
|
-
return (_jsxs("div", { className: "rnsk-bot-thread
|
|
14
|
+
return (_jsxs("div", { className: "rnsk-bot-thread", children: [messages.map((message, index) => {
|
|
15
15
|
const isAssistant = message.role === 'assistant';
|
|
16
16
|
const isLastMessage = index === messages.length - 1;
|
|
17
17
|
const messageContent = getMessageText(message);
|
|
18
18
|
const toolParts = parseToolParts(message);
|
|
19
19
|
const reasoningRows = getReasoningRows(message);
|
|
20
20
|
if (!isAssistant) {
|
|
21
|
-
return (_jsx("div", { className: "
|
|
21
|
+
return (_jsx("div", { className: "rnsk-bot-message rnsk-bot-message--user", children: _jsx("div", { className: "rnsk-bot-bubble rnsk-bot-bubble--user", children: messageContent }) }, message.id));
|
|
22
22
|
}
|
|
23
|
-
return (_jsxs("div", { className: "
|
|
23
|
+
return (_jsxs("div", { className: "rnsk-bot-message rnsk-bot-message--assistant", children: [isLastMessage && isStreaming && !messageContent && reasoningRows.length === 0 && toolParts.length === 0 ? (_jsx(LoadingState, {})) : null, reasoningRows.length > 0 ? (_jsx(ReasoningState, { rows: reasoningRows, isActive: isReasoningActive(message, isLastMessage, isStreaming) })) : null, toolParts.length > 0 ? _jsx(ToolCallUi, { parts: toolParts }) : null, toolParts.map((toolPart, toolIndex) => {
|
|
24
24
|
const initOutput = toolPart.output;
|
|
25
25
|
if (toolPart.type === 'initiateConnection' &&
|
|
26
26
|
toolPart.state === 'output-available' &&
|
|
@@ -29,7 +29,7 @@ export function BotMessageThread({ messages, isStreaming = false, }) {
|
|
|
29
29
|
return (_jsx(InitiateConnection, { data: { ...initOutput, provider: initOutput.provider } }, toolPart.toolCallId ?? `tool-${index}-${toolIndex}`));
|
|
30
30
|
}
|
|
31
31
|
if (toolPart.state === 'output-error') {
|
|
32
|
-
return (_jsx("div", { className: "
|
|
32
|
+
return (_jsx("div", { className: "rnsk-bot-tool-error", children: toolPart.errorText ?? 'Tool error' }, toolPart.toolCallId ?? `tool-${index}-${toolIndex}`));
|
|
33
33
|
}
|
|
34
34
|
return null;
|
|
35
35
|
}), _jsx(StreamingText, { text: messageContent, isStreaming: isLastMessage && isStreaming })] }, message.id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-message-thread.js","sourceRoot":"","sources":["../../src/components/bot-message-thread.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAA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I,EAE9D,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE;4BACrC,MAAM,UAAU,GAAG,QAAQ,CAAC,MAEf,CAAC;4BACd,IACE,QAAQ,CAAC,IAAI,KAAK,oBAAoB;gCACtC,QAAQ,CAAC,KAAK,KAAK,kBAAkB;gCACrC,UAAU,EAAE,QAAQ;gCACpB,CAAC,UAAU,CAAC,KAAK,EACjB,CAAC;gCACD,OAAO,CACL,KAAC,kBAAkB,IAEjB,IAAI,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,IADjD,QAAQ,CAAC,UAAU,IAAI,QAAQ,KAAK,IAAI,SAAS,EAAE,CAExD,CACH,CAAC;4BACJ,CAAC;4BACD,IAAI,QAAQ,CAAC,KAAK,KAAK,cAAc,EAAE,CAAC;gCACtC,OAAO,CACL,cAEE,SAAS,EAAC,qBAAqB,YAE9B,QAAQ,CAAC,SAAS,IAAI,YAAY,IAH9B,QAAQ,CAAC,UAAU,IAAI,QAAQ,KAAK,IAAI,SAAS,EAAE,CAIpD,CACP,CAAC;4BACJ,CAAC;4BACD,OAAO,IAAI,CAAC;wBACd,CAAC,CAAC,EAEF,KAAC,aAAa,IACZ,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,aAAa,IAAI,WAAW,GACzC,KA/CM,OAAO,CAAC,EAAE,CAgDd,CACP,CAAC;YACJ,CAAC,CAAC,EACF,cAAK,GAAG,EAAE,MAAM,GAAI,IAChB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../lib/cn.js';
|
|
3
3
|
export function BotShell({ position, theme, className, children, }) {
|
|
4
|
-
return (_jsx("div", { className: cn('rnsk-bot
|
|
4
|
+
return (_jsx("div", { className: cn('rnsk-bot', position === 'left' ? 'rnsk-bot--left' : 'rnsk-bot--right', theme === 'dark' ? 'rnsk-bot-dark' : 'rnsk-bot-light', className), children: children }));
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=bot-shell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-shell.js","sourceRoot":"","sources":["../../src/components/bot-shell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAGlC,MAAM,UAAU,QAAQ,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,SAAS,EACT,QAAQ,GAMT;IACC,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,
|
|
1
|
+
{"version":3,"file":"bot-shell.js","sourceRoot":"","sources":["../../src/components/bot-shell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAGlC,MAAM,UAAU,QAAQ,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,SAAS,EACT,QAAQ,GAMT;IACC,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,UAAU,EACV,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,EAC1D,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EACrD,SAAS,CACV,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { UIMessage } from 'ai';
|
|
2
|
+
export declare function BotWidget({ chatOpen, inputOpen, value, placeholder, disabled, logoUrl, brandName, messages, isStreaming, error, onValueChange, onSubmit, onToggle, }: {
|
|
3
|
+
chatOpen: boolean;
|
|
4
|
+
inputOpen: boolean;
|
|
5
|
+
value: string;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
logoUrl: string;
|
|
9
|
+
brandName: string;
|
|
10
|
+
messages: UIMessage[];
|
|
11
|
+
isStreaming: boolean;
|
|
12
|
+
error?: Error | null;
|
|
13
|
+
onValueChange: (value: string) => void;
|
|
14
|
+
onSubmit: () => void;
|
|
15
|
+
onToggle: () => void;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=bot-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-widget.d.ts","sourceRoot":"","sources":["../../src/components/bot-widget.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAQpC,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,+BA8FA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { motion } from 'motion/react';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
import { BotMessageThread } from './bot-message-thread.js';
|
|
6
|
+
const GOOEY_FILTER_ID = 'rnsk-bot-gooey';
|
|
7
|
+
export function BotWidget({ chatOpen, inputOpen, value, placeholder, disabled, logoUrl, brandName, messages, isStreaming, error, onValueChange, onSubmit, onToggle, }) {
|
|
8
|
+
const inputRef = useRef(null);
|
|
9
|
+
const useGooey = chatOpen || inputOpen;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (inputOpen) {
|
|
12
|
+
inputRef.current?.focus();
|
|
13
|
+
}
|
|
14
|
+
}, [inputOpen]);
|
|
15
|
+
const handleSubmit = (event) => {
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
if (!value.trim() || disabled)
|
|
18
|
+
return;
|
|
19
|
+
onSubmit();
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs("div", { className: cn('rnsk-bot-widget', inputOpen ? 'rnsk-bot-widget--expanded' : 'rnsk-bot-widget--collapsed', chatOpen && 'rnsk-bot-widget--chat-open'), children: [_jsx("svg", { className: "rnsk-bot-svg-defs", "aria-hidden": true, children: _jsx("defs", { children: _jsxs("filter", { id: GOOEY_FILTER_ID, children: [_jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "8", result: "blur" }), _jsx("feColorMatrix", { in: "blur", mode: "matrix", values: "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -8", result: "goo" }), _jsx("feBlend", { in: "SourceGraphic", in2: "goo" })] }) }) }), _jsxs("div", { className: "rnsk-bot-gooey-group", style: { filter: useGooey ? `url(#${GOOEY_FILTER_ID})` : undefined }, children: [chatOpen ? (_jsxs("div", { className: "rnsk-bot-panel", children: [_jsx(BotMessageThread, { messages: messages, isStreaming: isStreaming }), error ? _jsx("div", { className: "rnsk-bot-error", children: error.message }) : null] })) : null, _jsxs(motion.form, { onSubmit: handleSubmit, className: "rnsk-bot-composer", initial: false, animate: { width: inputOpen ? '100%' : 52 }, transition: { type: 'spring', stiffness: 380, damping: 32 }, children: [_jsx("button", { type: "button", onClick: onToggle, className: "rnsk-bot-trigger", "aria-label": inputOpen ? 'Collapse chat' : 'Open chat', children: _jsx("img", { src: logoUrl, alt: brandName, className: "rnsk-bot-trigger-logo" }) }), inputOpen ? (_jsxs("div", { className: "rnsk-bot-input-wrap", children: [_jsx("input", { ref: inputRef, type: "text", value: value, onChange: (event) => onValueChange(event.target.value), placeholder: placeholder, disabled: disabled, className: "rnsk-bot-input" }), _jsx("button", { type: "submit", disabled: disabled || !value.trim(), className: "rnsk-bot-send", "aria-label": "Send message", children: _jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M12 19V5" }), _jsx("path", { d: "m7 10 5-5 5 5" })] }) })] })) : null] })] })] }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=bot-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-widget.js","sourceRoot":"","sources":["../../src/components/bot-widget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAEzC,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,GAeT;IACC,MAAM,QAAQ,GAAG,MAAM,CAA0B,IAAI,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,QAAQ,IAAI,SAAS,CAAC;IAEvC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,EAAE,CAAC;YACd,QAAQ,CAAC,OAAO,EAAE,KAAK,EA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
-
{"version":3,"file":"initiate-connection.d.ts","sourceRoot":"","sources":["../../../src/components/chat/initiate-connection.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,+
|
|
1
|
+
{"version":3,"file":"initiate-connection.d.ts","sourceRoot":"","sources":["../../../src/components/chat/initiate-connection.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,+BAoB5E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export function InitiateConnection({ data }) {
|
|
3
3
|
const hasLink = Boolean(data.link) && !data.error;
|
|
4
|
-
return (_jsxs("div", { className: "rnsk-bot-connect
|
|
4
|
+
return (_jsxs("div", { className: "rnsk-bot-connect", children: [_jsxs("span", { children: ["Connect ", data.provider] }), hasLink ? (_jsx("a", { href: data.link, target: "_blank", rel: "noopener noreferrer", className: "rnsk-bot-connect-btn", children: "Connect" })) : (_jsx("span", { className: "rnsk-bot-muted", children: "Unavailable" }))] }));
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=initiate-connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiate-connection.js","sourceRoot":"","sources":["../../../src/components/chat/initiate-connection.tsx"],"names":[],"mappings":";AAMA,MAAM,UAAU,kBAAkB,CAAC,EAAE,IAAI,EAAoC;IAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAElD,OAAO,CACL,eAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"initiate-connection.js","sourceRoot":"","sources":["../../../src/components/chat/initiate-connection.tsx"],"names":[],"mappings":";AAMA,MAAM,UAAU,kBAAkB,CAAC,EAAE,IAAI,EAAoC;IAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAElD,OAAO,CACL,eAAK,SAAS,EAAC,kBAAkB,aAC/B,uCAAe,IAAI,CAAC,QAAQ,IAAQ,EACnC,OAAO,CAAC,CAAC,CAAC,CACT,YACE,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAC,sBAAsB,wBAG9B,CACL,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,gBAAgB,4BAAmB,CACpD,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
export function LoadingState({ label = 'Thinking' }) {
|
|
3
|
-
return (_jsxs("div", { className: "rnsk-bot-loading
|
|
3
|
+
return (_jsxs("div", { className: "rnsk-bot-loading", children: [_jsxs("span", { className: "rnsk-bot-loading-dots", "aria-hidden": true, children: [_jsx("span", {}), _jsx("span", {}), _jsx("span", {})] }), _jsx("span", { children: label })] }));
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=loading-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading-state.js","sourceRoot":"","sources":["../../../src/components/chat/loading-state.tsx"],"names":[],"mappings":";AAAA,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,GAAG,UAAU,EAAsB;IACrE,OAAO,CACL,eAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"loading-state.js","sourceRoot":"","sources":["../../../src/components/chat/loading-state.tsx"],"names":[],"mappings":";AAAA,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,GAAG,UAAU,EAAsB;IACrE,OAAO,CACL,eAAK,SAAS,EAAC,kBAAkB,aAC/B,gBAAM,SAAS,EAAC,uBAAuB,kCACrC,gBAAQ,EACR,gBAAQ,EACR,gBAAQ,IACH,EACP,yBAAO,KAAK,GAAQ,IAChB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-state.d.ts","sourceRoot":"","sources":["../../../src/components/chat/reasoning-state.tsx"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;CACnB,
|
|
1
|
+
{"version":3,"file":"reasoning-state.d.ts","sourceRoot":"","sources":["../../../src/components/chat/reasoning-state.tsx"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;CACnB,sCAaA"}
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
export function ReasoningState({ rows, isActive, }) {
|
|
3
3
|
if (rows.length === 0)
|
|
4
4
|
return null;
|
|
5
|
-
return (_jsxs("details", { className: "rnsk-bot-reasoning
|
|
5
|
+
return (_jsxs("details", { className: "rnsk-bot-reasoning", open: isActive, children: [_jsx("summary", { children: "Reasoning" }), _jsx("div", { children: rows.map((row, index) => (_jsx("p", { children: row.primary }, index))) })] }));
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=reasoning-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-state.js","sourceRoot":"","sources":["../../../src/components/chat/reasoning-state.tsx"],"names":[],"mappings":";AAAA,MAAM,UAAU,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,GAIT;IACC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnC,OAAO,CACL,mBAAS,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"reasoning-state.js","sourceRoot":"","sources":["../../../src/components/chat/reasoning-state.tsx"],"names":[],"mappings":";AAAA,MAAM,UAAU,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,GAIT;IACC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnC,OAAO,CACL,mBAAS,SAAS,EAAC,oBAAoB,EAAC,IAAI,EAAE,QAAQ,aACpD,0CAA4B,EAC5B,wBACG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,sBAAgB,GAAG,CAAC,OAAO,IAAnB,KAAK,CAAmB,CACjC,CAAC,GACE,IACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-text.d.ts","sourceRoot":"","sources":["../../../src/components/chat/streaming-text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streaming-text.d.ts","sourceRoot":"","sources":["../../../src/components/chat/streaming-text.tsx"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,EAC5B,IAAS,EACT,WAAmB,GACpB,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,sCASA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Streamdown } from 'streamdown';
|
|
3
|
-
import { cn } from '../../lib/cn.js';
|
|
4
3
|
export function StreamingText({ text = '', isStreaming = false, }) {
|
|
5
4
|
if (!text && !isStreaming)
|
|
6
5
|
return null;
|
|
7
|
-
return (_jsxs("div", { className:
|
|
6
|
+
return (_jsxs("div", { className: "rnsk-bot-markdown", children: [_jsx(Streamdown, { children: text }), isStreaming ? _jsx("span", { className: "rnsk-bot-cursor", "aria-hidden": true }) : null] }));
|
|
8
7
|
}
|
|
9
8
|
//# sourceMappingURL=streaming-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-text.js","sourceRoot":"","sources":["../../../src/components/chat/streaming-text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,
|
|
1
|
+
{"version":3,"file":"streaming-text.js","sourceRoot":"","sources":["../../../src/components/chat/streaming-text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,UAAU,aAAa,CAAC,EAC5B,IAAI,GAAG,EAAE,EACT,WAAW,GAAG,KAAK,GAIpB;IACC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,UAAU,cAAE,IAAI,GAAc,EAC9B,WAAW,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,iBAAiB,wBAAe,CAAC,CAAC,CAAC,IAAI,IAClE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-ui.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-call-ui.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"tool-call-ui.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-call-ui.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,sCAahE"}
|
|
@@ -2,6 +2,6 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
export function ToolCallUi({ parts }) {
|
|
3
3
|
if (parts.length === 0)
|
|
4
4
|
return null;
|
|
5
|
-
return (_jsx("div", { className: "rnsk-bot-tools
|
|
5
|
+
return (_jsx("div", { className: "rnsk-bot-tools", children: parts.map((part, index) => (_jsxs("span", { children: [part.type, part.state === 'output-error' ? ' · error' : part.state === 'output-available' ? ' · done' : ' · running'] }, part.toolCallId ?? `${part.type}-${index}`))) }));
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=tool-call-ui.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-ui.js","sourceRoot":"","sources":["../../../src/components/chat/tool-call-ui.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAA+B;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,OAAO,CACL,cAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"tool-call-ui.js","sourceRoot":"","sources":["../../../src/components/chat/tool-call-ui.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAA+B;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,OAAO,CACL,cAAK,SAAS,EAAC,gBAAgB,YAC5B,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,2BACG,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,KAAK,KAAK,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,KAFjG,IAAI,CAAC,UAAU,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAG9C,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runstack-bot.d.ts","sourceRoot":"","sources":["../../src/components/runstack-bot.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"runstack-bot.d.ts","sourceRoot":"","sources":["../../src/components/runstack-bot.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMhE,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,QAAkB,EAClB,WAAiC,EACjC,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,KAAgB,EAChB,SAAS,GACV,EAAE,gBAAgB,+BA6DlB"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useChat } from '@ai-sdk/react';
|
|
4
4
|
import { useMemo, useState } from 'react';
|
|
5
5
|
import { useBotConfig } from '../hooks/use-bot-config.js';
|
|
6
6
|
import { useBotTheme } from '../hooks/use-bot-theme.js';
|
|
7
7
|
import { resolveBrandLogo, resolveBrandName } from '../lib/branding.js';
|
|
8
8
|
import { createBotTransport } from '../lib/bot-transport.js';
|
|
9
|
-
import { BotGooeyInput } from './bot-gooey-input.js';
|
|
10
|
-
import { BotGooeyStack } from './bot-gooey-stack.js';
|
|
11
|
-
import { BotMessageThread } from './bot-message-thread.js';
|
|
12
9
|
import { BotShell } from './bot-shell.js';
|
|
10
|
+
import { BotWidget } from './bot-widget.js';
|
|
13
11
|
const DEFAULT_PLACEHOLDER = 'Ask anything…';
|
|
14
12
|
export function RunstackBot({ apiKey, position = 'right', placeholder = DEFAULT_PLACEHOLDER, agentIds, toolkits, systemPrompt, apiBase, theme = 'system', className, }) {
|
|
15
13
|
const resolvedTheme = useBotTheme(theme);
|
|
@@ -44,6 +42,6 @@ export function RunstackBot({ apiKey, position = 'right', placeholder = DEFAULT_
|
|
|
44
42
|
setUiState('chat');
|
|
45
43
|
await sendMessage({ text });
|
|
46
44
|
};
|
|
47
|
-
return (
|
|
45
|
+
return (_jsx(BotShell, { position: position, theme: resolvedTheme, className: className, children: _jsx(BotWidget, { chatOpen: chatOpen, inputOpen: inputOpen, value: input, placeholder: placeholder, disabled: isStreaming, logoUrl: brandLogo, brandName: brandName, messages: messages, isStreaming: isStreaming, error: error, onValueChange: setInput, onSubmit: () => void handleSubmit(), onToggle: handleToggle }) }));
|
|
48
46
|
}
|
|
49
47
|
//# sourceMappingURL=runstack-bot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runstack-bot.js","sourceRoot":"","sources":["../../src/components/runstack-bot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,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,EAClB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,QAAQ,EACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,YAAY,EAAE,EACnC,QAAQ,EAAE,YAAY,GACtB,GACO,CACZ,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/styles/bot.css
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.rnsk-bot {
|
|
2
|
+
--rnsk-bot-width: min(380px, calc(100vw - 3rem));
|
|
2
3
|
--rnsk-background: #ffffff;
|
|
3
4
|
--rnsk-foreground: #111827;
|
|
4
5
|
--rnsk-card: #ffffff;
|
|
@@ -7,9 +8,21 @@
|
|
|
7
8
|
--rnsk-muted-foreground: #6b7280;
|
|
8
9
|
--rnsk-primary: #111827;
|
|
9
10
|
--rnsk-primary-foreground: #ffffff;
|
|
11
|
+
position: fixed;
|
|
12
|
+
bottom: 1.5rem;
|
|
13
|
+
z-index: 9999;
|
|
14
|
+
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
10
15
|
color: var(--rnsk-foreground);
|
|
11
16
|
}
|
|
12
17
|
|
|
18
|
+
.rnsk-bot--right {
|
|
19
|
+
right: 1.5rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rnsk-bot--left {
|
|
23
|
+
left: 1.5rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
.rnsk-bot-dark {
|
|
14
27
|
--rnsk-background: #0b0f17;
|
|
15
28
|
--rnsk-foreground: #f9fafb;
|
|
@@ -36,6 +49,195 @@
|
|
|
36
49
|
box-sizing: border-box;
|
|
37
50
|
}
|
|
38
51
|
|
|
52
|
+
.rnsk-bot-svg-defs {
|
|
53
|
+
position: absolute;
|
|
54
|
+
width: 0;
|
|
55
|
+
height: 0;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Widget shell */
|
|
60
|
+
.rnsk-bot-widget {
|
|
61
|
+
width: var(--rnsk-bot-width);
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: stretch;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.rnsk-bot-widget--collapsed {
|
|
68
|
+
width: 52px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.rnsk-bot-gooey-group {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
align-items: stretch;
|
|
75
|
+
width: 100%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Chat panel */
|
|
79
|
+
.rnsk-bot-panel {
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
border: 1px solid var(--rnsk-border);
|
|
82
|
+
border-bottom: none;
|
|
83
|
+
border-radius: 22px 22px 14px 14px;
|
|
84
|
+
background: var(--rnsk-card);
|
|
85
|
+
box-shadow: 0 16px 48px rgb(0 0 0 / 0.12);
|
|
86
|
+
margin-bottom: -14px;
|
|
87
|
+
position: relative;
|
|
88
|
+
z-index: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Composer row */
|
|
92
|
+
.rnsk-bot-composer {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
min-height: 52px;
|
|
96
|
+
border: 1px solid var(--rnsk-border);
|
|
97
|
+
border-radius: 22px;
|
|
98
|
+
background: var(--rnsk-card);
|
|
99
|
+
box-shadow: 0 10px 36px rgb(0 0 0 / 0.12);
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
position: relative;
|
|
102
|
+
z-index: 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.rnsk-bot-trigger {
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
width: 52px;
|
|
111
|
+
height: 52px;
|
|
112
|
+
padding: 0;
|
|
113
|
+
border: none;
|
|
114
|
+
background: transparent;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.rnsk-bot-trigger-logo {
|
|
119
|
+
width: 28px;
|
|
120
|
+
height: 28px;
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
object-fit: cover;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.rnsk-bot-input-wrap {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
min-width: 0;
|
|
129
|
+
flex: 1;
|
|
130
|
+
position: relative;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.rnsk-bot-input {
|
|
135
|
+
width: 100%;
|
|
136
|
+
height: 52px;
|
|
137
|
+
padding: 0 44px 0 4px;
|
|
138
|
+
border: none;
|
|
139
|
+
background: transparent;
|
|
140
|
+
color: var(--rnsk-foreground);
|
|
141
|
+
font-size: 0.875rem;
|
|
142
|
+
outline: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.rnsk-bot-input::placeholder {
|
|
146
|
+
color: var(--rnsk-muted-foreground);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.rnsk-bot-send {
|
|
150
|
+
position: absolute;
|
|
151
|
+
right: 8px;
|
|
152
|
+
top: 50%;
|
|
153
|
+
transform: translateY(-50%);
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
width: 32px;
|
|
158
|
+
height: 32px;
|
|
159
|
+
padding: 0;
|
|
160
|
+
border: none;
|
|
161
|
+
border-radius: 9999px;
|
|
162
|
+
background: var(--rnsk-primary);
|
|
163
|
+
color: var(--rnsk-primary-foreground);
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.rnsk-bot-send:disabled {
|
|
168
|
+
opacity: 0.4;
|
|
169
|
+
cursor: not-allowed;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.rnsk-bot-send svg {
|
|
173
|
+
width: 16px;
|
|
174
|
+
height: 16px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Messages */
|
|
178
|
+
.rnsk-bot-thread {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
gap: 1rem;
|
|
182
|
+
max-height: min(360px, 45vh);
|
|
183
|
+
overflow-x: hidden;
|
|
184
|
+
overflow-y: auto;
|
|
185
|
+
padding: 1rem 1rem 1.25rem;
|
|
186
|
+
scrollbar-width: thin;
|
|
187
|
+
scrollbar-color: var(--rnsk-border) transparent;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.rnsk-bot-message {
|
|
191
|
+
display: flex;
|
|
192
|
+
width: 100%;
|
|
193
|
+
min-width: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.rnsk-bot-message--user {
|
|
197
|
+
justify-content: flex-end;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.rnsk-bot-message--assistant {
|
|
201
|
+
flex-direction: column;
|
|
202
|
+
gap: 0.5rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.rnsk-bot-bubble--user {
|
|
206
|
+
max-width: 85%;
|
|
207
|
+
padding: 0.625rem 0.875rem;
|
|
208
|
+
border-radius: 1rem;
|
|
209
|
+
border-bottom-right-radius: 0.375rem;
|
|
210
|
+
background: var(--rnsk-primary);
|
|
211
|
+
color: var(--rnsk-primary-foreground);
|
|
212
|
+
font-size: 0.875rem;
|
|
213
|
+
line-height: 1.45;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.rnsk-bot-error {
|
|
217
|
+
border-top: 1px solid var(--rnsk-border);
|
|
218
|
+
padding: 0.5rem 1rem;
|
|
219
|
+
font-size: 0.75rem;
|
|
220
|
+
color: #dc2626;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.rnsk-bot-tool-error {
|
|
224
|
+
border-radius: 0.5rem;
|
|
225
|
+
border: 1px solid rgb(239 68 68 / 0.3);
|
|
226
|
+
background: rgb(239 68 68 / 0.05);
|
|
227
|
+
padding: 0.5rem 0.75rem;
|
|
228
|
+
font-size: 0.875rem;
|
|
229
|
+
color: #dc2626;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* Loading */
|
|
233
|
+
.rnsk-bot-loading {
|
|
234
|
+
display: flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
gap: 0.5rem;
|
|
237
|
+
font-size: 0.875rem;
|
|
238
|
+
color: var(--rnsk-muted-foreground);
|
|
239
|
+
}
|
|
240
|
+
|
|
39
241
|
.rnsk-bot-loading-dots {
|
|
40
242
|
display: inline-flex;
|
|
41
243
|
gap: 4px;
|
|
@@ -70,6 +272,14 @@
|
|
|
70
272
|
}
|
|
71
273
|
}
|
|
72
274
|
|
|
275
|
+
/* Markdown */
|
|
276
|
+
.rnsk-bot-markdown {
|
|
277
|
+
width: 100%;
|
|
278
|
+
font-size: 0.875rem;
|
|
279
|
+
line-height: 1.6;
|
|
280
|
+
color: var(--rnsk-foreground);
|
|
281
|
+
}
|
|
282
|
+
|
|
73
283
|
.rnsk-bot-cursor {
|
|
74
284
|
display: inline-block;
|
|
75
285
|
width: 0.45rem;
|
|
@@ -106,15 +316,85 @@
|
|
|
106
316
|
font-size: 0.85em;
|
|
107
317
|
}
|
|
108
318
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
319
|
+
/* Reasoning */
|
|
320
|
+
.rnsk-bot-reasoning {
|
|
321
|
+
border-radius: 0.5rem;
|
|
322
|
+
border: 1px solid var(--rnsk-border);
|
|
323
|
+
background: rgb(243 244 246 / 0.4);
|
|
324
|
+
padding: 0.5rem 0.75rem;
|
|
325
|
+
font-size: 0.75rem;
|
|
326
|
+
color: var(--rnsk-muted-foreground);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.rnsk-bot-dark .rnsk-bot-reasoning {
|
|
330
|
+
background: rgb(31 41 55 / 0.4);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.rnsk-bot-reasoning summary {
|
|
334
|
+
cursor: pointer;
|
|
335
|
+
font-weight: 500;
|
|
336
|
+
color: var(--rnsk-foreground);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.rnsk-bot-reasoning > div {
|
|
340
|
+
margin-top: 0.5rem;
|
|
341
|
+
white-space: pre-wrap;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* Tools */
|
|
345
|
+
.rnsk-bot-tools {
|
|
346
|
+
display: flex;
|
|
347
|
+
flex-wrap: wrap;
|
|
348
|
+
gap: 0.5rem;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.rnsk-bot-tools span {
|
|
352
|
+
display: inline-flex;
|
|
353
|
+
align-items: center;
|
|
354
|
+
border-radius: 9999px;
|
|
355
|
+
border: 1px solid var(--rnsk-border);
|
|
356
|
+
background: var(--rnsk-muted);
|
|
357
|
+
padding: 0.25rem 0.625rem;
|
|
358
|
+
font-size: 0.75rem;
|
|
359
|
+
color: var(--rnsk-muted-foreground);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* OAuth connect */
|
|
363
|
+
.rnsk-bot-connect {
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
justify-content: space-between;
|
|
367
|
+
gap: 0.75rem;
|
|
368
|
+
border-radius: 0.75rem;
|
|
369
|
+
border: 1px solid var(--rnsk-border);
|
|
370
|
+
background: var(--rnsk-card);
|
|
371
|
+
padding: 0.75rem 1rem;
|
|
372
|
+
font-size: 0.875rem;
|
|
373
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.rnsk-bot-connect-btn {
|
|
377
|
+
display: inline-flex;
|
|
378
|
+
flex-shrink: 0;
|
|
379
|
+
align-items: center;
|
|
380
|
+
border-radius: 9999px;
|
|
381
|
+
background: var(--rnsk-primary);
|
|
382
|
+
padding: 0.375rem 0.75rem;
|
|
383
|
+
font-size: 0.75rem;
|
|
384
|
+
font-weight: 500;
|
|
385
|
+
color: var(--rnsk-primary-foreground);
|
|
386
|
+
text-decoration: none;
|
|
112
387
|
}
|
|
113
388
|
|
|
114
389
|
.rnsk-bot-connect-btn:hover {
|
|
115
390
|
opacity: 0.92;
|
|
116
391
|
}
|
|
117
392
|
|
|
393
|
+
.rnsk-bot-muted {
|
|
394
|
+
color: var(--rnsk-muted-foreground);
|
|
395
|
+
font-size: 0.875rem;
|
|
396
|
+
}
|
|
397
|
+
|
|
118
398
|
@media (prefers-reduced-motion: reduce) {
|
|
119
399
|
.rnsk-bot-loading-dots span,
|
|
120
400
|
.rnsk-bot-cursor {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare function BotGooeyInput({ open, value, placeholder, disabled, logoUrl, brandName, onValueChange, onSubmit, onToggle, }: {
|
|
2
|
-
open: boolean;
|
|
3
|
-
value: string;
|
|
4
|
-
placeholder: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
logoUrl: string;
|
|
7
|
-
brandName: string;
|
|
8
|
-
onValueChange: (value: string) => void;
|
|
9
|
-
onSubmit: () => void;
|
|
10
|
-
onToggle: () => void;
|
|
11
|
-
}): import("react").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=bot-gooey-input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bot-gooey-input.d.ts","sourceRoot":"","sources":["../../src/components/bot-gooey-input.tsx"],"names":[],"mappings":"AAOA,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,aAAa,EACb,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,+BAqFA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { motion } from 'motion/react';
|
|
3
|
-
import { useEffect, useRef } from 'react';
|
|
4
|
-
import { cn } from '../lib/cn.js';
|
|
5
|
-
const GOOEY_FILTER_ID = 'rnsk-bot-gooey-input';
|
|
6
|
-
export function BotGooeyInput({ open, value, placeholder, disabled, logoUrl, brandName, onValueChange, onSubmit, onToggle, }) {
|
|
7
|
-
const inputRef = useRef(null);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (open) {
|
|
10
|
-
inputRef.current?.focus();
|
|
11
|
-
}
|
|
12
|
-
}, [open]);
|
|
13
|
-
const handleSubmit = (event) => {
|
|
14
|
-
event.preventDefault();
|
|
15
|
-
if (!value.trim() || disabled)
|
|
16
|
-
return;
|
|
17
|
-
onSubmit();
|
|
18
|
-
};
|
|
19
|
-
return (_jsxs("div", { className: "rnsk-bot-gooey-input relative", children: [_jsx("svg", { className: "pointer-events-none absolute h-0 w-0", "aria-hidden": true, children: _jsx("defs", { children: _jsxs("filter", { id: GOOEY_FILTER_ID, children: [_jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "5", result: "blur" }), _jsx("feColorMatrix", { in: "blur", mode: "matrix", values: "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10", result: "goo" }), _jsx("feBlend", { in: "SourceGraphic", in2: "goo" })] }) }) }), _jsxs(motion.form, { onSubmit: handleSubmit, className: "relative flex items-center gap-0", style: { filter: open ? `url(#${GOOEY_FILTER_ID})` : undefined }, initial: false, animate: { width: open ? 320 : 52 }, transition: { type: 'spring', stiffness: 380, damping: 32 }, children: [_jsx("button", { type: "button", onClick: onToggle, className: cn('rnsk-bot-trigger relative z-10 flex size-[52px] shrink-0 items-center justify-center overflow-hidden rounded-2xl border border-[var(--rnsk-border)] bg-[var(--rnsk-card)] shadow-lg'), "aria-label": open ? 'Collapse chat' : 'Open chat', children: _jsx("img", { src: logoUrl, alt: brandName, className: "size-7 rounded-lg object-cover" }) }), _jsxs(motion.div, { className: "relative z-0 flex min-w-0 flex-1 items-center overflow-hidden rounded-2xl border border-[var(--rnsk-border)] bg-[var(--rnsk-card)] shadow-lg", initial: false, animate: {
|
|
20
|
-
opacity: open ? 1 : 0,
|
|
21
|
-
width: open ? 268 : 0,
|
|
22
|
-
marginLeft: open ? -8 : 0,
|
|
23
|
-
}, transition: { type: 'spring', stiffness: 380, damping: 32 }, children: [_jsx("input", { ref: inputRef, type: "text", value: value, onChange: (event) => onValueChange(event.target.value), placeholder: placeholder, disabled: disabled, className: "h-[52px] w-full bg-transparent px-4 pr-12 text-sm text-[var(--rnsk-foreground)] outline-none placeholder:text-[var(--rnsk-muted-foreground)]" }), _jsx("button", { type: "submit", disabled: disabled || !value.trim(), className: "absolute right-2 inline-flex size-8 items-center justify-center rounded-full bg-[var(--rnsk-primary)] text-[var(--rnsk-primary-foreground)] disabled:opacity-40", "aria-label": "Send message", children: _jsxs("svg", { viewBox: "0 0 24 24", className: "size-4", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M12 19V5" }), _jsx("path", { d: "m7 10 5-5 5 5" })] }) })] })] })] }));
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=bot-gooey-input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bot-goo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,CAAC,EACtD,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAC,8IAA8I,GACxJ,EACF,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EACnC,SAAS,EAAC,iKAAiK,gBAChK,cAAc,YAEzB,eAAK,OAAO,EAAC,WAAW,EAAC,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,aAC3F,eAAM,CAAC,EAAC,UAAU,GAAG,EACrB,eAAM,CAAC,EAAC,eAAe,GAAG,IACtB,GACC,IACE,IACD,IACV,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bot-gooey-stack.d.ts","sourceRoot":"","sources":["../../src/components/bot-gooey-stack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAoCA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { motion } from 'motion/react';
|
|
3
|
-
import { cn } from '../lib/cn.js';
|
|
4
|
-
const GOOEY_FILTER_ID = 'rnsk-bot-gooey-stack';
|
|
5
|
-
export function BotGooeyStack({ open, children, }) {
|
|
6
|
-
return (_jsxs("div", { className: cn('rnsk-bot-gooey-stack relative', open ? 'mb-2' : 'mb-0'), children: [_jsx("svg", { className: "pointer-events-none absolute h-0 w-0", "aria-hidden": true, children: _jsx("defs", { children: _jsxs("filter", { id: GOOEY_FILTER_ID, children: [_jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "10", result: "blur" }), _jsx("feColorMatrix", { in: "blur", mode: "matrix", values: "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10", result: "goo" }), _jsx("feBlend", { in: "SourceGraphic", in2: "goo" })] }) }) }), _jsx(motion.div, { initial: false, animate: {
|
|
7
|
-
opacity: open ? 1 : 0,
|
|
8
|
-
y: open ? 0 : 24,
|
|
9
|
-
scale: open ? 1 : 0.96,
|
|
10
|
-
height: open ? 'auto' : 0,
|
|
11
|
-
}, transition: { type: 'spring', stiffness: 320, damping: 30 }, className: "overflow-hidden", style: { filter: open ? `url(#${GOOEY_FILTER_ID})` : undefined }, children: _jsx("div", { className: "w-[min(360px,calc(100vw-3rem))] overflow-hidden rounded-[22px] border border-[var(--rnsk-border)] bg-[var(--rnsk-card)] shadow-2xl", children: children }) })] }));
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=bot-gooey-stack.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bot-gooey-stack.js","sourceRoot":"","sources":["../../src/components/bot-gooey-stack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,EAC5B,IAAI,EACJ,QAAQ,GAIT;IACC,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,aACzE,cAAK,SAAS,EAAC,sCAAsC,iCACnD,yBACE,kBAAQ,EAAE,EAAE,eAAe,aACzB,yBAAgB,EAAE,EAAC,eAAe,EAAC,YAAY,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,GAAG,EACrE,wBACE,EAAE,EAAC,MAAM,EACT,IAAI,EAAC,QAAQ,EACb,M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