@chatsdk-dev/elements 0.0.1 → 0.1.3
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/README.md +3 -3
- package/dist/api-CIYPz72L.d.ts +10 -0
- package/dist/api-CIYPz72L.d.ts.map +1 -0
- package/dist/callbacks-PIvHXeEI.d.ts +24 -0
- package/dist/callbacks-PIvHXeEI.d.ts.map +1 -0
- package/dist/chat-element-CCsDDFif.js +441 -0
- package/dist/chat-element-CCsDDFif.js.map +1 -0
- package/dist/chat-element-CSpa62Te.d.ts +53 -0
- package/dist/chat-element-CSpa62Te.d.ts.map +1 -0
- package/dist/chatsdk-provider-BhlChLFd.d.ts +15 -0
- package/dist/chatsdk-provider-BhlChLFd.d.ts.map +1 -0
- package/dist/common/utils.d.ts +14 -0
- package/dist/common/utils.d.ts.map +1 -0
- package/dist/common/utils.js +26 -0
- package/dist/common/utils.js.map +1 -0
- package/dist/components/info-card.d.ts +20 -11
- package/dist/components/info-card.d.ts.map +1 -0
- package/dist/components/info-card.js +38 -1
- package/dist/components/info-card.js.map +1 -0
- package/dist/config-BigIL6TQ.js +29 -0
- package/dist/config-BigIL6TQ.js.map +1 -0
- package/dist/config-CqihvSgz.d.ts +150 -0
- package/dist/config-CqihvSgz.d.ts.map +1 -0
- package/dist/config-D_jVTH_D.d.ts +58 -0
- package/dist/config-D_jVTH_D.d.ts.map +1 -0
- package/dist/context-aSaHw-ac.d.ts +13 -0
- package/dist/context-aSaHw-ac.d.ts.map +1 -0
- package/dist/element-provider-C_nBsftD.d.ts +40 -0
- package/dist/element-provider-C_nBsftD.d.ts.map +1 -0
- package/dist/features/chat/chat-card.d.ts +5 -3
- package/dist/features/chat/chat-card.d.ts.map +1 -0
- package/dist/features/chat/chat-card.js +2 -14
- package/dist/features/chat/chat-element.d.ts +2 -0
- package/dist/features/chat/chat-element.js +2 -0
- package/dist/features/chat/chat-header/chat-header.d.ts +8 -4
- package/dist/features/chat/chat-header/chat-header.d.ts.map +1 -0
- package/dist/features/chat/chat-header/chat-header.js +2 -14
- package/dist/features/chat/chat-header/chat-menu.d.ts +5 -3
- package/dist/features/chat/chat-header/chat-menu.d.ts.map +1 -0
- package/dist/features/chat/chat-header/chat-menu.js +29 -2
- package/dist/features/chat/chat-header/chat-menu.js.map +1 -0
- package/dist/features/chat/chat-history/chat-history-empty.d.ts +5 -3
- package/dist/features/chat/chat-history/chat-history-empty.d.ts.map +1 -0
- package/dist/features/chat/chat-history/chat-history-empty.js +24 -1
- package/dist/features/chat/chat-history/chat-history-empty.js.map +1 -0
- package/dist/features/chat/chat-history/chat-history.d.ts +5 -3
- package/dist/features/chat/chat-history/chat-history.d.ts.map +1 -0
- package/dist/features/chat/chat-history/chat-history.js +2 -14
- package/dist/features/chat/chat-main/chat-main.d.ts +10 -0
- package/dist/features/chat/chat-main/chat-main.d.ts.map +1 -0
- package/dist/features/chat/chat-main/chat-main.js +3 -0
- package/dist/features/chat/chat-main/use-chat.d.ts +23 -0
- package/dist/features/chat/chat-main/use-chat.d.ts.map +1 -0
- package/dist/features/chat/chat-main/use-chat.js +3 -0
- package/dist/features/chat/chat-main/use-initial-messages.d.ts +22 -0
- package/dist/features/chat/chat-main/use-initial-messages.d.ts.map +1 -0
- package/dist/features/chat/chat-main/use-initial-messages.js +2 -0
- package/dist/features/chat/chat-prompt-input.d.ts +20 -12
- package/dist/features/chat/chat-prompt-input.d.ts.map +1 -0
- package/dist/features/chat/chat-prompt-input.js +3 -14
- package/dist/features/chat/chat.context.d.ts +17 -15
- package/dist/features/chat/chat.context.d.ts.map +1 -0
- package/dist/features/chat/chat.context.js +9 -12
- package/dist/features/chat/chat.context.js.map +1 -0
- package/dist/features/chat/index.d.ts +2 -14
- package/dist/features/chat/index.js +2 -14
- package/dist/features/chat/queries/query-keys.d.ts +7 -5
- package/dist/features/chat/queries/query-keys.d.ts.map +1 -0
- package/dist/features/chat/queries/query-keys.js +19 -1
- package/dist/features/chat/queries/query-keys.js.map +1 -0
- package/dist/features/chat/queries/use-create-conversation-mutation.d.ts +27 -23
- package/dist/features/chat/queries/use-create-conversation-mutation.d.ts.map +1 -0
- package/dist/features/chat/queries/use-create-conversation-mutation.js +17 -36
- package/dist/features/chat/queries/use-create-conversation-mutation.js.map +1 -0
- package/dist/features/chat/queries/use-get-chat-query.d.ts +9 -5
- package/dist/features/chat/queries/use-get-chat-query.d.ts.map +1 -0
- package/dist/features/chat/queries/use-get-chat-query.js +2 -14
- package/dist/features/chat/queries/use-get-conversation-query.d.ts +56 -46
- package/dist/features/chat/queries/use-get-conversation-query.d.ts.map +1 -0
- package/dist/features/chat/queries/use-get-conversation-query.js +2 -14
- package/dist/features/chat/queries/use-list-conversations-query.d.ts +27 -23
- package/dist/features/chat/queries/use-list-conversations-query.d.ts.map +1 -0
- package/dist/features/chat/queries/use-list-conversations-query.js +2 -14
- package/dist/features/chat/store.d.ts +10 -8
- package/dist/features/chat/store.d.ts.map +1 -0
- package/dist/features/chat/store.js +15 -1
- package/dist/features/chat/store.js.map +1 -0
- package/dist/features/chat/utils.d.ts +4 -2
- package/dist/features/chat/utils.d.ts.map +1 -0
- package/dist/features/chat/utils.js +15 -1
- package/dist/features/chat/utils.js.map +1 -0
- package/dist/features/data-fetching/use-api-client.d.ts +5 -3
- package/dist/features/data-fetching/use-api-client.d.ts.map +1 -0
- package/dist/features/data-fetching/use-api-client.js +2 -14
- package/dist/features/element/chatsdk-provider.d.ts +2 -0
- package/dist/features/element/chatsdk-provider.js +23 -0
- package/dist/features/element/chatsdk-provider.js.map +1 -0
- package/dist/features/element/constants.d.ts +5 -0
- package/dist/features/element/constants.d.ts.map +1 -0
- package/dist/features/element/constants.js +6 -0
- package/dist/features/element/constants.js.map +1 -0
- package/dist/features/element/element-provider.d.ts +2 -0
- package/dist/features/element/element-provider.js +83 -0
- package/dist/features/element/element-provider.js.map +1 -0
- package/dist/features/element/store.d.ts +2 -0
- package/dist/features/element/store.js +112 -0
- package/dist/features/element/store.js.map +1 -0
- package/dist/features/element/types/api.d.ts +2 -0
- package/dist/features/element/types/api.js +1 -0
- package/dist/features/element/types/callbacks.d.ts +2 -0
- package/dist/features/element/types/callbacks.js +1 -0
- package/dist/features/element/types/config.d.ts +2 -0
- package/dist/features/element/types/config.js +1 -0
- package/dist/features/element/types/context.d.ts +2 -0
- package/dist/features/element/types/context.js +1 -0
- package/dist/features/element/types/locale.d.ts +2 -0
- package/dist/features/element/types/locale.js +1 -0
- package/dist/features/element/types/theme.d.ts +2 -0
- package/dist/features/element/types/theme.js +1 -0
- package/dist/features/element/types/translations.d.ts +2 -0
- package/dist/features/element/types/translations.js +1 -0
- package/dist/features/element/use-element-config.d.ts +40 -0
- package/dist/features/element/use-element-config.d.ts.map +1 -0
- package/dist/features/element/use-element-config.js +39 -0
- package/dist/features/element/use-element-config.js.map +1 -0
- package/dist/features/element/use-merge-global-config.d.ts +20 -0
- package/dist/features/element/use-merge-global-config.d.ts.map +1 -0
- package/dist/features/element/use-merge-global-config.js +34 -0
- package/dist/features/element/use-merge-global-config.js.map +1 -0
- package/dist/features/element/utils.d.ts +2 -0
- package/dist/features/element/utils.js +86 -0
- package/dist/features/element/utils.js.map +1 -0
- package/dist/features/logger/logger.d.ts +2 -9
- package/dist/features/logger/logger.js +15 -1
- package/dist/features/logger/logger.js.map +1 -0
- package/dist/i18n/config.d.ts +2 -61
- package/dist/i18n/config.js +2 -1
- package/dist/i18n/i18next.d.ts +1382 -10
- package/dist/i18n/i18next.d.ts.map +1 -0
- package/dist/i18n/i18next.js +27 -2
- package/dist/i18n/i18next.js.map +1 -0
- package/dist/i18n/utils.d.ts +4 -3
- package/dist/i18n/utils.d.ts.map +1 -0
- package/dist/i18n/utils.js +10 -3
- package/dist/i18n/utils.js.map +1 -0
- package/dist/index.d.ts +5 -20
- package/dist/index.js +68 -20
- package/dist/index.js.map +1 -0
- package/dist/locale-W5Kyyi4X.d.ts +11 -0
- package/dist/locale-W5Kyyi4X.d.ts.map +1 -0
- package/dist/logger-BvmhODdq.d.ts +11 -0
- package/dist/logger-BvmhODdq.d.ts.map +1 -0
- package/dist/store-CGX9oRlE.d.ts +46 -0
- package/dist/store-CGX9oRlE.d.ts.map +1 -0
- package/dist/styles.css +1954 -1963
- package/dist/theme-Cb-RBWbR.d.ts +38 -0
- package/dist/theme-Cb-RBWbR.d.ts.map +1 -0
- package/package.json +18 -50
- package/dist/chunk-2LHKM7RD.js +0 -14
- package/dist/chunk-5UMYP6MD.js +0 -10
- package/dist/chunk-AP4MG32M.js +0 -36
- package/dist/chunk-CFM57HOS.js +0 -358
- package/dist/chunk-EGIUE7H2.js +0 -37
- package/dist/chunk-M5OONVIO.js +0 -90
- package/dist/chunk-MXTBCHYC.js +0 -31
- package/dist/chunk-NIC3MOMY.js +0 -55
- package/dist/chunk-QTRMNIG3.js +0 -83
- package/dist/chunk-R7G3RQLU.js +0 -36
- package/dist/chunk-RJG5D2TM.js +0 -113
- package/dist/chunk-SLJNKQ2G.js +0 -125
- package/dist/chunk-TDEFIW2L.js +0 -9
- package/dist/chunk-TDP6D7U7.js +0 -551
- package/dist/chunk-V2ITXC65.js +0 -24
- package/dist/chunk-VS55HRUS.js +0 -16
- package/dist/chunk-VYDYCGJL.js +0 -25
- package/dist/chunk-X5YUF2YM.js +0 -113
- package/dist/chunk-YX46JVQN.js +0 -78
- package/dist/chunk-YXAMLTTT.js +0 -16
- package/dist/chunk-YXFVHSY4.js +0 -51
- package/dist/chunk-ZCSZX3OI.js +0 -4
- package/dist/common/use-copy-to-clipboard.d.ts +0 -3
- package/dist/common/use-copy-to-clipboard.js +0 -33
- package/dist/common/utilts.d.ts +0 -8
- package/dist/common/utilts.js +0 -28
- package/dist/components/ai-elements/actions.d.ts +0 -13
- package/dist/components/ai-elements/actions.js +0 -42
- package/dist/components/ai-elements/agent.d.ts +0 -31
- package/dist/components/ai-elements/agent.js +0 -77
- package/dist/components/ai-elements/artifact.d.ts +0 -27
- package/dist/components/ai-elements/artifact.js +0 -108
- package/dist/components/ai-elements/attachments.d.ts +0 -57
- package/dist/components/ai-elements/attachments.js +0 -258
- package/dist/components/ai-elements/audio-player.d.ts +0 -33
- package/dist/components/ai-elements/audio-player.js +0 -199
- package/dist/components/ai-elements/canvas.d.ts +0 -10
- package/dist/components/ai-elements/canvas.js +0 -24
- package/dist/components/ai-elements/chain-of-thought.d.ts +0 -34
- package/dist/components/ai-elements/chain-of-thought.js +0 -159
- package/dist/components/ai-elements/checkpoint.d.ts +0 -16
- package/dist/components/ai-elements/checkpoint.js +0 -47
- package/dist/components/ai-elements/code-block.d.ts +0 -48
- package/dist/components/ai-elements/code-block.js +0 -1
- package/dist/components/ai-elements/commit.d.ts +0 -68
- package/dist/components/ai-elements/commit.js +0 -314
- package/dist/components/ai-elements/confirmation.d.ts +0 -52
- package/dist/components/ai-elements/confirmation.js +0 -76
- package/dist/components/ai-elements/connection.d.ts +0 -5
- package/dist/components/ai-elements/connection.js +0 -34
- package/dist/components/ai-elements/context.d.ts +0 -36
- package/dist/components/ai-elements/context.js +0 -320
- package/dist/components/ai-elements/controls.d.ts +0 -8
- package/dist/components/ai-elements/controls.js +0 -17
- package/dist/components/ai-elements/conversation.d.ts +0 -27
- package/dist/components/ai-elements/conversation.js +0 -119
- package/dist/components/ai-elements/edge.d.ts +0 -9
- package/dist/components/ai-elements/edge.js +0 -111
- package/dist/components/ai-elements/environment-variables.d.ts +0 -42
- package/dist/components/ai-elements/environment-variables.js +0 -208
- package/dist/components/ai-elements/file-tree.d.ts +0 -30
- package/dist/components/ai-elements/file-tree.js +0 -212
- package/dist/components/ai-elements/image.d.ts +0 -10
- package/dist/components/ai-elements/image.js +0 -23
- package/dist/components/ai-elements/inline-citation.d.ts +0 -42
- package/dist/components/ai-elements/inline-citation.js +0 -203
- package/dist/components/ai-elements/jsx-preview.d.ts +0 -33
- package/dist/components/ai-elements/jsx-preview.js +0 -206
- package/dist/components/ai-elements/loader.d.ts +0 -9
- package/dist/components/ai-elements/loader.js +0 -115
- package/dist/components/ai-elements/message.d.ts +0 -42
- package/dist/components/ai-elements/message.js +0 -259
- package/dist/components/ai-elements/mic-selector.d.ts +0 -49
- package/dist/components/ai-elements/mic-selector.js +0 -252
- package/dist/components/ai-elements/model-selector.d.ts +0 -39
- package/dist/components/ai-elements/model-selector.js +0 -73
- package/dist/components/ai-elements/node.d.ts +0 -25
- package/dist/components/ai-elements/node.js +0 -41
- package/dist/components/ai-elements/open-in-chat.d.ts +0 -32
- package/dist/components/ai-elements/open-in-chat.js +0 -366
- package/dist/components/ai-elements/package-info.d.ts +0 -32
- package/dist/components/ai-elements/package-info.js +0 -162
- package/dist/components/ai-elements/panel.d.ts +0 -8
- package/dist/components/ai-elements/panel.js +0 -17
- package/dist/components/ai-elements/persona.d.ts +0 -50
- package/dist/components/ai-elements/persona.js +0 -209
- package/dist/components/ai-elements/plan.d.ts +0 -29
- package/dist/components/ai-elements/plan.js +0 -95
- package/dist/components/ai-elements/prompt-input.d.ts +0 -153
- package/dist/components/ai-elements/prompt-input.js +0 -939
- package/dist/components/ai-elements/queue.d.ts +0 -65
- package/dist/components/ai-elements/queue.js +0 -179
- package/dist/components/ai-elements/reasoning.d.ts +0 -30
- package/dist/components/ai-elements/reasoning.js +0 -161
- package/dist/components/ai-elements/response.d.ts +0 -9
- package/dist/components/ai-elements/response.js +0 -33
- package/dist/components/ai-elements/sandbox.d.ts +0 -28
- package/dist/components/ai-elements/sandbox.js +0 -98
- package/dist/components/ai-elements/schema-display.d.ts +0 -58
- package/dist/components/ai-elements/schema-display.js +0 -313
- package/dist/components/ai-elements/shimmer.d.ts +0 -14
- package/dist/components/ai-elements/shimmer.js +0 -1
- package/dist/components/ai-elements/snippet.d.ts +0 -22
- package/dist/components/ai-elements/snippet.js +0 -90
- package/dist/components/ai-elements/sources.d.ts +0 -16
- package/dist/components/ai-elements/sources.js +0 -62
- package/dist/components/ai-elements/speech-input.d.ts +0 -57
- package/dist/components/ai-elements/speech-input.js +0 -206
- package/dist/components/ai-elements/stack-trace.d.ts +0 -42
- package/dist/components/ai-elements/stack-trace.js +0 -377
- package/dist/components/ai-elements/suggestion.d.ts +0 -14
- package/dist/components/ai-elements/suggestion.js +0 -41
- package/dist/components/ai-elements/task.d.ts +0 -18
- package/dist/components/ai-elements/task.js +0 -60
- package/dist/components/ai-elements/terminal.d.ts +0 -31
- package/dist/components/ai-elements/terminal.js +0 -203
- package/dist/components/ai-elements/test-results.d.ts +0 -61
- package/dist/components/ai-elements/test-results.js +0 -349
- package/dist/components/ai-elements/tool.d.ts +0 -35
- package/dist/components/ai-elements/tool.js +0 -2
- package/dist/components/ai-elements/toolbar.d.ts +0 -8
- package/dist/components/ai-elements/toolbar.js +0 -18
- package/dist/components/ai-elements/transcription.d.ts +0 -19
- package/dist/components/ai-elements/transcription.js +0 -90
- package/dist/components/ai-elements/voice-selector.d.ts +0 -66
- package/dist/components/ai-elements/voice-selector.js +0 -332
- package/dist/components/ai-elements/web-preview.d.ts +0 -38
- package/dist/components/ai-elements/web-preview.js +0 -214
- package/dist/components/responsive-alert-dialog.d.ts +0 -19
- package/dist/components/responsive-alert-dialog.js +0 -1
- package/dist/components/responsive-dialog.d.ts +0 -14
- package/dist/components/responsive-dialog.js +0 -1
- package/dist/config-IcWUmjwj.d.ts +0 -239
- package/dist/features/chat/chat-element/chat-element.d.ts +0 -8
- package/dist/features/chat/chat-element/chat-element.js +0 -14
- package/dist/features/chat/chat-element/use-chat.d.ts +0 -21
- package/dist/features/chat/chat-element/use-chat.js +0 -14
- package/dist/features/chat/chat-element/use-initial-messages.d.ts +0 -20
- package/dist/features/chat/chat-element/use-initial-messages.js +0 -14
- package/dist/features/chat/chat-message.d.ts +0 -10
- package/dist/features/chat/chat-message.js +0 -1
- package/dist/features/chat/chat-molecule.d.ts +0 -35
- package/dist/features/chat/chat-molecule.js +0 -14
- package/dist/features/molecule/chatsdk-provider.d.ts +0 -19
- package/dist/features/molecule/chatsdk-provider.js +0 -26
- package/dist/features/molecule/constants.d.ts +0 -3
- package/dist/features/molecule/constants.js +0 -1
- package/dist/features/molecule/molecule-provider.d.ts +0 -39
- package/dist/features/molecule/molecule-provider.js +0 -1
- package/dist/features/molecule/store.d.ts +0 -53
- package/dist/features/molecule/store.js +0 -3
- package/dist/features/molecule/types/api.d.ts +0 -8
- package/dist/features/molecule/types/api.js +0 -1
- package/dist/features/molecule/types/callbacks.d.ts +0 -22
- package/dist/features/molecule/types/callbacks.js +0 -1
- package/dist/features/molecule/types/config.d.ts +0 -10
- package/dist/features/molecule/types/config.js +0 -1
- package/dist/features/molecule/types/context.d.ts +0 -11
- package/dist/features/molecule/types/context.js +0 -1
- package/dist/features/molecule/types/locale.d.ts +0 -9
- package/dist/features/molecule/types/locale.js +0 -1
- package/dist/features/molecule/types/theme.d.ts +0 -38
- package/dist/features/molecule/types/theme.js +0 -1
- package/dist/features/molecule/types/translations.d.ts +0 -10
- package/dist/features/molecule/types/translations.js +0 -1
- package/dist/features/molecule/use-merge-global-config.d.ts +0 -22
- package/dist/features/molecule/use-merge-global-config.js +0 -5
- package/dist/features/molecule/use-molecule-config.d.ts +0 -41
- package/dist/features/molecule/use-molecule-config.js +0 -6
- package/dist/features/molecule/utils.d.ts +0 -10
- package/dist/features/molecule/utils.js +0 -1
package/dist/chunk-X5YUF2YM.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { CodeBlock } from './chunk-CFM57HOS.js';
|
|
2
|
-
import { Badge } from '@chatsdk-dev/ui/components/badge';
|
|
3
|
-
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '@chatsdk-dev/ui/components/collapsible';
|
|
4
|
-
import { cn } from '@chatsdk-dev/ui/lib/utils';
|
|
5
|
-
import { WrenchIcon, ChevronDownIcon, XCircleIcon, CheckCircleIcon, CircleIcon, ClockIcon } from 'lucide-react';
|
|
6
|
-
import { isValidElement } from 'react';
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
var Tool = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
10
|
-
Collapsible,
|
|
11
|
-
{
|
|
12
|
-
className: cn("group not-prose mb-4 w-full rounded-md border", className),
|
|
13
|
-
...props
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
var statusLabels = {
|
|
17
|
-
"approval-requested": "Awaiting Approval",
|
|
18
|
-
"approval-responded": "Responded",
|
|
19
|
-
"input-available": "Running",
|
|
20
|
-
"input-streaming": "Pending",
|
|
21
|
-
"output-available": "Completed",
|
|
22
|
-
"output-denied": "Denied",
|
|
23
|
-
"output-error": "Error"
|
|
24
|
-
};
|
|
25
|
-
var statusIcons = {
|
|
26
|
-
"approval-requested": /* @__PURE__ */ jsx(ClockIcon, { className: "size-4 text-yellow-600" }),
|
|
27
|
-
"approval-responded": /* @__PURE__ */ jsx(CheckCircleIcon, { className: "size-4 text-blue-600" }),
|
|
28
|
-
"input-available": /* @__PURE__ */ jsx(ClockIcon, { className: "size-4 animate-pulse" }),
|
|
29
|
-
"input-streaming": /* @__PURE__ */ jsx(CircleIcon, { className: "size-4" }),
|
|
30
|
-
"output-available": /* @__PURE__ */ jsx(CheckCircleIcon, { className: "size-4 text-green-600" }),
|
|
31
|
-
"output-denied": /* @__PURE__ */ jsx(XCircleIcon, { className: "size-4 text-orange-600" }),
|
|
32
|
-
"output-error": /* @__PURE__ */ jsx(XCircleIcon, { className: "size-4 text-red-600" })
|
|
33
|
-
};
|
|
34
|
-
var getStatusBadge = (status) => /* @__PURE__ */ jsxs(Badge, { className: "gap-1.5 rounded-full text-xs", variant: "secondary", children: [
|
|
35
|
-
statusIcons[status],
|
|
36
|
-
statusLabels[status]
|
|
37
|
-
] });
|
|
38
|
-
var ToolHeader = ({
|
|
39
|
-
className,
|
|
40
|
-
title,
|
|
41
|
-
type,
|
|
42
|
-
state,
|
|
43
|
-
toolName,
|
|
44
|
-
...props
|
|
45
|
-
}) => {
|
|
46
|
-
const derivedName = type === "dynamic-tool" ? toolName : type.split("-").slice(1).join("-");
|
|
47
|
-
return /* @__PURE__ */ jsxs(
|
|
48
|
-
CollapsibleTrigger,
|
|
49
|
-
{
|
|
50
|
-
className: cn(
|
|
51
|
-
"flex w-full items-center justify-between gap-4 p-3",
|
|
52
|
-
className
|
|
53
|
-
),
|
|
54
|
-
...props,
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
57
|
-
/* @__PURE__ */ jsx(WrenchIcon, { className: "size-4 text-muted-foreground" }),
|
|
58
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: title ?? derivedName }),
|
|
59
|
-
getStatusBadge(state)
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
var ToolContent = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
67
|
-
CollapsibleContent,
|
|
68
|
-
{
|
|
69
|
-
className: cn(
|
|
70
|
-
"data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
71
|
-
className
|
|
72
|
-
),
|
|
73
|
-
...props
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
var ToolInput = ({ className, input, ...props }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-2 overflow-hidden", className), ...props, children: [
|
|
77
|
-
/* @__PURE__ */ jsx("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: "Parameters" }),
|
|
78
|
-
/* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50", children: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(input, null, 2), language: "json" }) })
|
|
79
|
-
] });
|
|
80
|
-
var ToolOutput = ({
|
|
81
|
-
className,
|
|
82
|
-
output,
|
|
83
|
-
errorText,
|
|
84
|
-
...props
|
|
85
|
-
}) => {
|
|
86
|
-
if (!(output || errorText)) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
let Output = /* @__PURE__ */ jsx("div", { children: output });
|
|
90
|
-
if (typeof output === "object" && !isValidElement(output)) {
|
|
91
|
-
Output = /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(output, null, 2), language: "json" });
|
|
92
|
-
} else if (typeof output === "string") {
|
|
93
|
-
Output = /* @__PURE__ */ jsx(CodeBlock, { code: output, language: "json" });
|
|
94
|
-
}
|
|
95
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), ...props, children: [
|
|
96
|
-
/* @__PURE__ */ jsx("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: errorText ? "Error" : "Result" }),
|
|
97
|
-
/* @__PURE__ */ jsxs(
|
|
98
|
-
"div",
|
|
99
|
-
{
|
|
100
|
-
className: cn(
|
|
101
|
-
"overflow-x-auto rounded-md text-xs [&_table]:w-full",
|
|
102
|
-
errorText ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground"
|
|
103
|
-
),
|
|
104
|
-
children: [
|
|
105
|
-
errorText && /* @__PURE__ */ jsx("div", { children: errorText }),
|
|
106
|
-
Output
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
] });
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, getStatusBadge };
|
package/dist/chunk-YX46JVQN.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { deepMerge } from './chunk-RJG5D2TM.js';
|
|
2
|
-
import { LOCAL_STORAGE_PREFIX } from './chunk-ZCSZX3OI.js';
|
|
3
|
-
import { create } from 'zustand';
|
|
4
|
-
import { persist, createJSONStorage } from 'zustand/middleware';
|
|
5
|
-
|
|
6
|
-
var defaultInitialState = {
|
|
7
|
-
context: { actor: { id: crypto.randomUUID() } },
|
|
8
|
-
api: {
|
|
9
|
-
version: "v1",
|
|
10
|
-
baseUrl: "/api/proxy",
|
|
11
|
-
credentials: "include"
|
|
12
|
-
},
|
|
13
|
-
locale: { language: "en" }
|
|
14
|
-
};
|
|
15
|
-
var createChatSDKStore = (customInitialState) => {
|
|
16
|
-
const initialState = { ...defaultInitialState, ...customInitialState };
|
|
17
|
-
return create()(
|
|
18
|
-
persist(
|
|
19
|
-
(set) => ({
|
|
20
|
-
...initialState,
|
|
21
|
-
setContext: (context) => set((state) => ({
|
|
22
|
-
...state,
|
|
23
|
-
context: deepMerge({ ...state.context, ...context })
|
|
24
|
-
})),
|
|
25
|
-
setLogger: (logger) => set((state) => ({ ...state, logger })),
|
|
26
|
-
setTheme: (theme) => set((state) => ({ ...state, theme: { ...state.theme, ...theme } })),
|
|
27
|
-
setApi: (api) => set((state) => ({
|
|
28
|
-
...state,
|
|
29
|
-
api: {
|
|
30
|
-
...state.api,
|
|
31
|
-
...api,
|
|
32
|
-
headers: state.api?.headers || api?.headers ? { ...state.api?.headers, ...api?.headers } : void 0
|
|
33
|
-
}
|
|
34
|
-
})),
|
|
35
|
-
setTranslations: (translations, merge = true) => set((state) => ({
|
|
36
|
-
...state,
|
|
37
|
-
translations: merge ? { ...state.translations, ...translations } : translations
|
|
38
|
-
})),
|
|
39
|
-
setLocale: (locale) => {
|
|
40
|
-
set((state) => ({ ...state, locale }));
|
|
41
|
-
},
|
|
42
|
-
setConfig: (newConfig, merge = true) => {
|
|
43
|
-
set((state) => {
|
|
44
|
-
const config = merge ? state : initialState;
|
|
45
|
-
return {
|
|
46
|
-
...config,
|
|
47
|
-
...newConfig,
|
|
48
|
-
api: { ...config.api, ...newConfig.api },
|
|
49
|
-
context: deepMerge({
|
|
50
|
-
...config.context,
|
|
51
|
-
...newConfig.context
|
|
52
|
-
}),
|
|
53
|
-
theme: { ...config.theme, ...newConfig.theme },
|
|
54
|
-
translations: {
|
|
55
|
-
...config.translations,
|
|
56
|
-
...newConfig.translations
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
reset: (config) => {
|
|
62
|
-
set({ ...initialState, theme: {}, ...config });
|
|
63
|
-
},
|
|
64
|
-
setOptions: (options) => set((state) => ({ ...state, options }))
|
|
65
|
-
}),
|
|
66
|
-
{
|
|
67
|
-
partialize: (state) => {
|
|
68
|
-
return { context: { actor: state.context?.actor } };
|
|
69
|
-
},
|
|
70
|
-
name: LOCAL_STORAGE_PREFIX + "elements-store",
|
|
71
|
-
storage: createJSONStorage(() => localStorage)
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
var useChatSDKStore = createChatSDKStore();
|
|
77
|
-
|
|
78
|
-
export { createChatSDKStore, useChatSDKStore };
|
package/dist/chunk-YXAMLTTT.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FolderCode } from 'lucide-react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription } from '@chatsdk-dev/ui/components/empty';
|
|
4
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
// src/features/chat/chat-history/chat-history-empty.tsx
|
|
7
|
-
function ChatHistoryEmpty() {
|
|
8
|
-
const { t } = useTranslation("chat", { keyPrefix: "history.empty" });
|
|
9
|
-
return /* @__PURE__ */ jsx(Empty, { className: "w-full h-full hover:bg-blue pb-32", children: /* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
10
|
-
/* @__PURE__ */ jsx(EmptyMedia, { className: "size-8", variant: "icon", children: /* @__PURE__ */ jsx(FolderCode, { className: "size-4.5" }) }),
|
|
11
|
-
/* @__PURE__ */ jsx(EmptyTitle, { children: t("title") }),
|
|
12
|
-
/* @__PURE__ */ jsx(EmptyDescription, { children: t("description") })
|
|
13
|
-
] }) });
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { ChatHistoryEmpty };
|
package/dist/chunk-YXFVHSY4.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { cloneElement } from 'react';
|
|
2
|
-
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@chatsdk-dev/ui/components/dialog';
|
|
3
|
-
import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerFooter } from '@chatsdk-dev/ui/components/drawer';
|
|
4
|
-
import { useBreakpoint } from '@chatsdk-dev/ui/hooks/use-breakpoint';
|
|
5
|
-
import { useControllableState } from '@chatsdk-dev/ui/hooks/use-controllable-state';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
// src/components/responsive-dialog.tsx
|
|
9
|
-
function ResponsiveDialog({
|
|
10
|
-
open,
|
|
11
|
-
onOpenChange,
|
|
12
|
-
trigger,
|
|
13
|
-
children,
|
|
14
|
-
title,
|
|
15
|
-
description,
|
|
16
|
-
footer
|
|
17
|
-
}) {
|
|
18
|
-
const [openState, setOpenState] = useControllableState({
|
|
19
|
-
value: open,
|
|
20
|
-
defaultValue: false,
|
|
21
|
-
onChange: onOpenChange
|
|
22
|
-
});
|
|
23
|
-
const sm = useBreakpoint("sm");
|
|
24
|
-
if (sm) {
|
|
25
|
-
const renderTrigger = trigger ? (triggerProps) => cloneElement(trigger, triggerProps) : void 0;
|
|
26
|
-
return /* @__PURE__ */ jsxs(Dialog, { open: openState, onOpenChange: setOpenState, children: [
|
|
27
|
-
trigger && /* @__PURE__ */ jsx(DialogTrigger, { render: renderTrigger }),
|
|
28
|
-
/* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-106 px-6", children: [
|
|
29
|
-
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
30
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
31
|
-
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
32
|
-
] }),
|
|
33
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto min-h-0 -mx-6 px-6 pb-1", children }),
|
|
34
|
-
footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer })
|
|
35
|
-
] })
|
|
36
|
-
] });
|
|
37
|
-
}
|
|
38
|
-
return /* @__PURE__ */ jsxs(Drawer, { open: openState, onOpenChange: setOpenState, children: [
|
|
39
|
-
/* @__PURE__ */ jsx(DrawerTrigger, { asChild: true, children: trigger }),
|
|
40
|
-
/* @__PURE__ */ jsxs(DrawerContent, { className: "p-6", children: [
|
|
41
|
-
/* @__PURE__ */ jsxs(DrawerHeader, { className: "text-left", children: [
|
|
42
|
-
/* @__PURE__ */ jsx(DrawerTitle, { children: title }),
|
|
43
|
-
/* @__PURE__ */ jsx(DrawerDescription, { children: description })
|
|
44
|
-
] }),
|
|
45
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-y-auto -mx-6 px-6 pb-1", children }),
|
|
46
|
-
footer && /* @__PURE__ */ jsx(DrawerFooter, { children: footer })
|
|
47
|
-
] })
|
|
48
|
-
] });
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { ResponsiveDialog };
|
package/dist/chunk-ZCSZX3OI.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
// src/common/use-copy-to-clipboard.ts
|
|
4
|
-
function oldSchoolCopy(text) {
|
|
5
|
-
const tempTextArea = document.createElement("textarea");
|
|
6
|
-
tempTextArea.value = text;
|
|
7
|
-
document.body.appendChild(tempTextArea);
|
|
8
|
-
tempTextArea.select();
|
|
9
|
-
document.execCommand("copy");
|
|
10
|
-
document.body.removeChild(tempTextArea);
|
|
11
|
-
}
|
|
12
|
-
function useCopyToClipboard() {
|
|
13
|
-
const [state, setState] = useState(null);
|
|
14
|
-
const copyToClipboard = useCallback((value) => {
|
|
15
|
-
const handleCopy = async () => {
|
|
16
|
-
try {
|
|
17
|
-
if (navigator?.clipboard?.writeText) {
|
|
18
|
-
await navigator.clipboard.writeText(value);
|
|
19
|
-
setState(value);
|
|
20
|
-
} else {
|
|
21
|
-
throw new Error("writeText not supported");
|
|
22
|
-
}
|
|
23
|
-
} catch (error) {
|
|
24
|
-
oldSchoolCopy(value);
|
|
25
|
-
setState(value);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
handleCopy();
|
|
29
|
-
}, []);
|
|
30
|
-
return [state, copyToClipboard];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { useCopyToClipboard };
|
package/dist/common/utilts.d.ts
DELETED
package/dist/common/utilts.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// src/common/utilts.ts
|
|
2
|
-
function renderRelativeTime({
|
|
3
|
-
date,
|
|
4
|
-
now,
|
|
5
|
-
locale
|
|
6
|
-
}) {
|
|
7
|
-
const _date = date instanceof Date ? date : new Date(date);
|
|
8
|
-
const _now = now ?? /* @__PURE__ */ new Date();
|
|
9
|
-
const diffMs = _date.getTime() - _now.getTime();
|
|
10
|
-
const diffSec = Math.round(diffMs / 1e3);
|
|
11
|
-
const diffMin = Math.round(diffSec / 60);
|
|
12
|
-
const diffHr = Math.round(diffMin / 60);
|
|
13
|
-
const diffDay = Math.round(diffHr / 24);
|
|
14
|
-
const diffWeek = Math.round(diffDay / 7);
|
|
15
|
-
const diffMonth = Math.round(diffDay / 30);
|
|
16
|
-
const diffYear = Math.round(diffDay / 365);
|
|
17
|
-
const _locale = locale ?? "en";
|
|
18
|
-
const rtf = new Intl.RelativeTimeFormat(_locale, { numeric: "auto" });
|
|
19
|
-
if (Math.abs(diffSec) < 60) return rtf.format(diffSec, "second");
|
|
20
|
-
if (Math.abs(diffMin) < 60) return rtf.format(diffMin, "minute");
|
|
21
|
-
if (Math.abs(diffHr) < 24) return rtf.format(diffHr, "hour");
|
|
22
|
-
if (Math.abs(diffDay) < 7) return rtf.format(diffDay, "day");
|
|
23
|
-
if (Math.abs(diffWeek) < 4) return rtf.format(diffWeek, "week");
|
|
24
|
-
if (Math.abs(diffMonth) < 12) return rtf.format(diffMonth, "month");
|
|
25
|
-
return rtf.format(diffYear, "year");
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { renderRelativeTime };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
import { ButtonProps } from '@chatsdk-dev/ui/components/button';
|
|
4
|
-
|
|
5
|
-
type ActionsProps = ComponentProps<"div">;
|
|
6
|
-
declare const Actions: ({ className, children, ...props }: ActionsProps) => react_jsx_runtime.JSX.Element;
|
|
7
|
-
type ActionProps = ButtonProps & {
|
|
8
|
-
tooltip?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
};
|
|
11
|
-
declare const Action: ({ tooltip, children, label, className, variant, size, ...props }: ActionProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { Action, type ActionProps, Actions, type ActionsProps };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Button } from '@chatsdk-dev/ui/components/button';
|
|
2
|
-
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '@chatsdk-dev/ui/components/tooltip';
|
|
3
|
-
import { cn } from '@chatsdk-dev/ui/lib/utils';
|
|
4
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var Actions = ({ className, children, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-", className), ...props, children });
|
|
7
|
-
var Action = ({
|
|
8
|
-
tooltip,
|
|
9
|
-
children,
|
|
10
|
-
label,
|
|
11
|
-
className,
|
|
12
|
-
variant = "ghost",
|
|
13
|
-
size = "sm",
|
|
14
|
-
...props
|
|
15
|
-
}) => {
|
|
16
|
-
const button = /* @__PURE__ */ jsxs(
|
|
17
|
-
Button,
|
|
18
|
-
{
|
|
19
|
-
className: cn(
|
|
20
|
-
"size-9 p-1.5 bg-transparent text-muted-foreground hover:text-foreground hover:bg-transparent relative",
|
|
21
|
-
className
|
|
22
|
-
),
|
|
23
|
-
size,
|
|
24
|
-
type: "button",
|
|
25
|
-
variant,
|
|
26
|
-
...props,
|
|
27
|
-
children: [
|
|
28
|
-
children,
|
|
29
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: label || tooltip })
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
if (tooltip) {
|
|
34
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
35
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { children: button }),
|
|
36
|
-
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: tooltip }) })
|
|
37
|
-
] }) });
|
|
38
|
-
}
|
|
39
|
-
return button;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { Action, Actions };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { AccordionItem, Accordion } from '@chatsdk-dev/ui/components/accordion';
|
|
5
|
-
import { Tool } from 'ai';
|
|
6
|
-
|
|
7
|
-
type AgentProps = ComponentProps<"div">;
|
|
8
|
-
declare const Agent: react.MemoExoticComponent<({ className, ...props }: AgentProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
-
type AgentHeaderProps = ComponentProps<"div"> & {
|
|
10
|
-
name: string;
|
|
11
|
-
model?: string;
|
|
12
|
-
};
|
|
13
|
-
declare const AgentHeader: react.MemoExoticComponent<({ className, name, model, ...props }: AgentHeaderProps) => react_jsx_runtime.JSX.Element>;
|
|
14
|
-
type AgentContentProps = ComponentProps<"div">;
|
|
15
|
-
declare const AgentContent: react.MemoExoticComponent<({ className, ...props }: AgentContentProps) => react_jsx_runtime.JSX.Element>;
|
|
16
|
-
type AgentInstructionsProps = ComponentProps<"div"> & {
|
|
17
|
-
children: string;
|
|
18
|
-
};
|
|
19
|
-
declare const AgentInstructions: react.MemoExoticComponent<({ className, children, ...props }: AgentInstructionsProps) => react_jsx_runtime.JSX.Element>;
|
|
20
|
-
type AgentToolsProps = ComponentProps<typeof Accordion>;
|
|
21
|
-
declare const AgentTools: react.MemoExoticComponent<({ className, ...props }: AgentToolsProps) => react_jsx_runtime.JSX.Element>;
|
|
22
|
-
type AgentToolProps = ComponentProps<typeof AccordionItem> & {
|
|
23
|
-
tool: Tool;
|
|
24
|
-
};
|
|
25
|
-
declare const AgentTool: react.MemoExoticComponent<({ className, tool, value, ...props }: AgentToolProps) => react_jsx_runtime.JSX.Element>;
|
|
26
|
-
type AgentOutputProps = ComponentProps<"div"> & {
|
|
27
|
-
schema: string;
|
|
28
|
-
};
|
|
29
|
-
declare const AgentOutput: react.MemoExoticComponent<({ className, schema, ...props }: AgentOutputProps) => react_jsx_runtime.JSX.Element>;
|
|
30
|
-
|
|
31
|
-
export { Agent, AgentContent, type AgentContentProps, AgentHeader, type AgentHeaderProps, AgentInstructions, type AgentInstructionsProps, AgentOutput, type AgentOutputProps, type AgentProps, AgentTool, type AgentToolProps, AgentTools, type AgentToolsProps };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { CodeBlock } from '../../chunk-CFM57HOS.js';
|
|
2
|
-
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '@chatsdk-dev/ui/components/accordion';
|
|
3
|
-
import { Badge } from '@chatsdk-dev/ui/components/badge';
|
|
4
|
-
import { cn } from '@chatsdk-dev/ui/lib/utils';
|
|
5
|
-
import { BotIcon } from 'lucide-react';
|
|
6
|
-
import { memo } from 'react';
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
var Agent = memo(({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
10
|
-
"div",
|
|
11
|
-
{
|
|
12
|
-
className: cn("not-prose w-full rounded-md border", className),
|
|
13
|
-
...props
|
|
14
|
-
}
|
|
15
|
-
));
|
|
16
|
-
var AgentHeader = memo(
|
|
17
|
-
({ className, name, model, ...props }) => /* @__PURE__ */ jsx(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
className: cn(
|
|
21
|
-
"flex w-full items-center justify-between gap-4 p-3",
|
|
22
|
-
className
|
|
23
|
-
),
|
|
24
|
-
...props,
|
|
25
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
26
|
-
/* @__PURE__ */ jsx(BotIcon, { className: "size-4 text-muted-foreground" }),
|
|
27
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: name }),
|
|
28
|
-
model && /* @__PURE__ */ jsx(Badge, { className: "font-mono text-xs", variant: "secondary", children: model })
|
|
29
|
-
] })
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
);
|
|
33
|
-
var AgentContent = memo(
|
|
34
|
-
({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("space-y-4 p-4 pt-0", className), ...props })
|
|
35
|
-
);
|
|
36
|
-
var AgentInstructions = memo(
|
|
37
|
-
({ className, children, ...props }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), ...props, children: [
|
|
38
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground text-sm", children: "Instructions" }),
|
|
39
|
-
/* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50 p-3 text-muted-foreground text-sm", children: /* @__PURE__ */ jsx("p", { children }) })
|
|
40
|
-
] })
|
|
41
|
-
);
|
|
42
|
-
var AgentTools = memo(({ className, ...props }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), children: [
|
|
43
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground text-sm", children: "Tools" }),
|
|
44
|
-
/* @__PURE__ */ jsx(Accordion, { className: "rounded-md border", ...props })
|
|
45
|
-
] }));
|
|
46
|
-
var AgentTool = memo(
|
|
47
|
-
({ className, tool, value, ...props }) => {
|
|
48
|
-
const schema = "jsonSchema" in tool && tool.jsonSchema ? tool.jsonSchema : tool.inputSchema;
|
|
49
|
-
return /* @__PURE__ */ jsxs(
|
|
50
|
-
AccordionItem,
|
|
51
|
-
{
|
|
52
|
-
className: cn("border-b last:border-b-0", className),
|
|
53
|
-
value,
|
|
54
|
-
...props,
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ jsx(AccordionTrigger, { className: "px-3 py-2 text-sm hover:no-underline", children: tool.description ?? "No description" }),
|
|
57
|
-
/* @__PURE__ */ jsx(AccordionContent, { className: "px-3 pb-3", children: /* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50", children: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(schema, null, 2), language: "json" }) }) })
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
var AgentOutput = memo(
|
|
64
|
-
({ className, schema, ...props }) => /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), ...props, children: [
|
|
65
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground text-sm", children: "Output Schema" }),
|
|
66
|
-
/* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/50", children: /* @__PURE__ */ jsx(CodeBlock, { code: schema, language: "typescript" }) })
|
|
67
|
-
] })
|
|
68
|
-
);
|
|
69
|
-
Agent.displayName = "Agent";
|
|
70
|
-
AgentHeader.displayName = "AgentHeader";
|
|
71
|
-
AgentContent.displayName = "AgentContent";
|
|
72
|
-
AgentInstructions.displayName = "AgentInstructions";
|
|
73
|
-
AgentTools.displayName = "AgentTools";
|
|
74
|
-
AgentTool.displayName = "AgentTool";
|
|
75
|
-
AgentOutput.displayName = "AgentOutput";
|
|
76
|
-
|
|
77
|
-
export { Agent, AgentContent, AgentHeader, AgentInstructions, AgentOutput, AgentTool, AgentTools };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Button } from '@chatsdk-dev/ui/components/button';
|
|
3
|
-
import { LucideIcon } from 'lucide-react';
|
|
4
|
-
import { HTMLAttributes, ComponentProps } from 'react';
|
|
5
|
-
|
|
6
|
-
type ArtifactProps = HTMLAttributes<HTMLDivElement>;
|
|
7
|
-
declare const Artifact: ({ className, ...props }: ArtifactProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
-
type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
9
|
-
declare const ArtifactHeader: ({ className, ...props }: ArtifactHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
-
type ArtifactCloseProps = ComponentProps<typeof Button>;
|
|
11
|
-
declare const ArtifactClose: ({ className, children, size, variant, ...props }: ArtifactCloseProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
-
type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;
|
|
13
|
-
declare const ArtifactTitle: ({ className, ...props }: ArtifactTitleProps) => react_jsx_runtime.JSX.Element;
|
|
14
|
-
type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
15
|
-
declare const ArtifactDescription: ({ className, ...props }: ArtifactDescriptionProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
-
type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
17
|
-
declare const ArtifactActions: ({ className, ...props }: ArtifactActionsProps) => react_jsx_runtime.JSX.Element;
|
|
18
|
-
type ArtifactActionProps = ComponentProps<typeof Button> & {
|
|
19
|
-
tooltip?: string;
|
|
20
|
-
label?: string;
|
|
21
|
-
icon?: LucideIcon;
|
|
22
|
-
};
|
|
23
|
-
declare const ArtifactAction: ({ tooltip, label, icon: Icon, children, className, size, variant, ...props }: ArtifactActionProps) => react_jsx_runtime.JSX.Element;
|
|
24
|
-
type ArtifactContentProps = HTMLAttributes<HTMLDivElement>;
|
|
25
|
-
declare const ArtifactContent: ({ className, ...props }: ArtifactContentProps) => react_jsx_runtime.JSX.Element;
|
|
26
|
-
|
|
27
|
-
export { Artifact, ArtifactAction, type ArtifactActionProps, ArtifactActions, type ArtifactActionsProps, ArtifactClose, type ArtifactCloseProps, ArtifactContent, type ArtifactContentProps, ArtifactDescription, type ArtifactDescriptionProps, ArtifactHeader, type ArtifactHeaderProps, type ArtifactProps, ArtifactTitle, type ArtifactTitleProps };
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Button } from '@chatsdk-dev/ui/components/button';
|
|
2
|
-
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '@chatsdk-dev/ui/components/tooltip';
|
|
3
|
-
import { cn } from '@chatsdk-dev/ui/lib/utils';
|
|
4
|
-
import { XIcon } from 'lucide-react';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var Artifact = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
8
|
-
"div",
|
|
9
|
-
{
|
|
10
|
-
className: cn(
|
|
11
|
-
"flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",
|
|
12
|
-
className
|
|
13
|
-
),
|
|
14
|
-
...props
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
var ArtifactHeader = ({
|
|
18
|
-
className,
|
|
19
|
-
...props
|
|
20
|
-
}) => /* @__PURE__ */ jsx(
|
|
21
|
-
"div",
|
|
22
|
-
{
|
|
23
|
-
className: cn(
|
|
24
|
-
"flex items-center justify-between border-b bg-muted/50 px-4 py-3",
|
|
25
|
-
className
|
|
26
|
-
),
|
|
27
|
-
...props
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
var ArtifactClose = ({
|
|
31
|
-
className,
|
|
32
|
-
children,
|
|
33
|
-
size = "sm",
|
|
34
|
-
variant = "ghost",
|
|
35
|
-
...props
|
|
36
|
-
}) => /* @__PURE__ */ jsxs(
|
|
37
|
-
Button,
|
|
38
|
-
{
|
|
39
|
-
className: cn(
|
|
40
|
-
"size-8 p-0 text-muted-foreground hover:text-foreground",
|
|
41
|
-
className
|
|
42
|
-
),
|
|
43
|
-
size,
|
|
44
|
-
type: "button",
|
|
45
|
-
variant,
|
|
46
|
-
...props,
|
|
47
|
-
children: [
|
|
48
|
-
children ?? /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
|
|
49
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
54
|
-
"p",
|
|
55
|
-
{
|
|
56
|
-
className: cn("font-medium text-foreground text-sm", className),
|
|
57
|
-
...props
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
var ArtifactDescription = ({
|
|
61
|
-
className,
|
|
62
|
-
...props
|
|
63
|
-
}) => /* @__PURE__ */ jsx("p", { className: cn("text-muted-foreground text-sm", className), ...props });
|
|
64
|
-
var ArtifactActions = ({
|
|
65
|
-
className,
|
|
66
|
-
...props
|
|
67
|
-
}) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-1", className), ...props });
|
|
68
|
-
var ArtifactAction = ({
|
|
69
|
-
tooltip,
|
|
70
|
-
label,
|
|
71
|
-
icon: Icon,
|
|
72
|
-
children,
|
|
73
|
-
className,
|
|
74
|
-
size = "sm",
|
|
75
|
-
variant = "ghost",
|
|
76
|
-
...props
|
|
77
|
-
}) => {
|
|
78
|
-
const button = /* @__PURE__ */ jsxs(
|
|
79
|
-
Button,
|
|
80
|
-
{
|
|
81
|
-
className: cn(
|
|
82
|
-
"size-8 p-0 text-muted-foreground hover:text-foreground",
|
|
83
|
-
className
|
|
84
|
-
),
|
|
85
|
-
size,
|
|
86
|
-
type: "button",
|
|
87
|
-
variant,
|
|
88
|
-
...props,
|
|
89
|
-
children: [
|
|
90
|
-
Icon ? /* @__PURE__ */ jsx(Icon, { className: "size-4" }) : children,
|
|
91
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: label || tooltip })
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
if (tooltip) {
|
|
96
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
97
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { render: button }),
|
|
98
|
-
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: tooltip }) })
|
|
99
|
-
] }) });
|
|
100
|
-
}
|
|
101
|
-
return button;
|
|
102
|
-
};
|
|
103
|
-
var ArtifactContent = ({
|
|
104
|
-
className,
|
|
105
|
-
...props
|
|
106
|
-
}) => /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-auto p-4", className), ...props });
|
|
107
|
-
|
|
108
|
-
export { Artifact, ArtifactAction, ArtifactActions, ArtifactClose, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle };
|