@cossistant/next 0.0.1

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.
Files changed (111) hide show
  1. package/_virtual/rolldown_runtime.js +27 -0
  2. package/avatar.d.ts +16 -0
  3. package/avatar.d.ts.map +1 -0
  4. package/bubble.d.ts +20 -0
  5. package/bubble.d.ts.map +1 -0
  6. package/button.d.ts +16 -0
  7. package/button.d.ts.map +1 -0
  8. package/config.d.ts +22 -0
  9. package/config.d.ts.map +1 -0
  10. package/conversation-timeline.d.ts +59 -0
  11. package/conversation-timeline.d.ts.map +1 -0
  12. package/fallback.d.ts +18 -0
  13. package/fallback.d.ts.map +1 -0
  14. package/hooks/index.d.ts +23 -0
  15. package/hooks/index.js +5 -0
  16. package/identify-visitor.d.ts +2 -0
  17. package/identify-visitor.js +8 -0
  18. package/identify-visitor2.d.ts +18 -0
  19. package/identify-visitor2.d.ts.map +1 -0
  20. package/image.d.ts +20 -0
  21. package/image.d.ts.map +1 -0
  22. package/index.d.ts +46 -0
  23. package/index.js +36 -0
  24. package/index.js.map +1 -0
  25. package/index2.d.ts +37 -0
  26. package/index2.d.ts.map +1 -0
  27. package/keys.d.ts +199 -0
  28. package/keys.d.ts.map +1 -0
  29. package/multimodal-input.d.ts +40 -0
  30. package/multimodal-input.d.ts.map +1 -0
  31. package/package.json +114 -0
  32. package/primitives/index.d.ts +13 -0
  33. package/primitives/index.js +8 -0
  34. package/provider.d.ts +2 -0
  35. package/provider.js +8 -0
  36. package/provider2.d.ts +93 -0
  37. package/provider2.d.ts.map +1 -0
  38. package/provider3.d.ts +56 -0
  39. package/provider3.d.ts.map +1 -0
  40. package/realtime/index.d.ts +6 -0
  41. package/realtime/index.js +8 -0
  42. package/seen-store.d.ts +17 -0
  43. package/seen-store.d.ts.map +1 -0
  44. package/support/index.d.ts +5 -0
  45. package/support/index.js +6 -0
  46. package/support-config.d.ts +2 -0
  47. package/support-config.js +8 -0
  48. package/support-config2.d.ts +18 -0
  49. package/support-config2.d.ts.map +1 -0
  50. package/support-provider.d.ts +17 -0
  51. package/support-provider.d.ts.map +1 -0
  52. package/support-store.d.ts +6 -0
  53. package/support-store.d.ts.map +1 -0
  54. package/timeline-item-group.d.ts +110 -0
  55. package/timeline-item-group.d.ts.map +1 -0
  56. package/timeline-item.d.ts +54 -0
  57. package/timeline-item.d.ts.map +1 -0
  58. package/typing-indicator.d.ts +24 -0
  59. package/typing-indicator.d.ts.map +1 -0
  60. package/typing-store.d.ts +25 -0
  61. package/typing-store.d.ts.map +1 -0
  62. package/use-client-query.d.ts +23 -0
  63. package/use-client-query.d.ts.map +1 -0
  64. package/use-composer-refocus.d.ts +20 -0
  65. package/use-composer-refocus.d.ts.map +1 -0
  66. package/use-conversation-auto-seen.d.ts +52 -0
  67. package/use-conversation-auto-seen.d.ts.map +1 -0
  68. package/use-conversation-history-page.d.ts +84 -0
  69. package/use-conversation-history-page.d.ts.map +1 -0
  70. package/use-conversation-lifecycle.d.ts +80 -0
  71. package/use-conversation-lifecycle.d.ts.map +1 -0
  72. package/use-conversation-page.d.ts +80 -0
  73. package/use-conversation-page.d.ts.map +1 -0
  74. package/use-conversation-seen.d.ts +15 -0
  75. package/use-conversation-seen.d.ts.map +1 -0
  76. package/use-conversation-timeline-items.d.ts +19 -0
  77. package/use-conversation-timeline-items.d.ts.map +1 -0
  78. package/use-conversation-typing.d.ts +11 -0
  79. package/use-conversation-typing.d.ts.map +1 -0
  80. package/use-conversation.d.ts +16 -0
  81. package/use-conversation.d.ts.map +1 -0
  82. package/use-conversations.d.ts +18 -0
  83. package/use-conversations.d.ts.map +1 -0
  84. package/use-create-conversation.d.ts +26 -0
  85. package/use-create-conversation.d.ts.map +1 -0
  86. package/use-default-messages.d.ts +16 -0
  87. package/use-default-messages.d.ts.map +1 -0
  88. package/use-grouped-messages.d.ts +51 -0
  89. package/use-grouped-messages.d.ts.map +1 -0
  90. package/use-home-page.d.ts +80 -0
  91. package/use-home-page.d.ts.map +1 -0
  92. package/use-message-composer.d.ts +86 -0
  93. package/use-message-composer.d.ts.map +1 -0
  94. package/use-multimodal-input.d.ts +40 -0
  95. package/use-multimodal-input.d.ts.map +1 -0
  96. package/use-realtime-support.d.ts +23 -0
  97. package/use-realtime-support.d.ts.map +1 -0
  98. package/use-realtime.d.ts +28 -0
  99. package/use-realtime.d.ts.map +1 -0
  100. package/use-rest-client.d.ts +15 -0
  101. package/use-rest-client.d.ts.map +1 -0
  102. package/use-send-message.d.ts +31 -0
  103. package/use-send-message.d.ts.map +1 -0
  104. package/use-visitor.d.ts +26 -0
  105. package/use-visitor.d.ts.map +1 -0
  106. package/use-window-visibility-focus.d.ts +9 -0
  107. package/use-window-visibility-focus.d.ts.map +1 -0
  108. package/websocket.d.ts +21 -0
  109. package/websocket.d.ts.map +1 -0
  110. package/window.d.ts +23 -0
  111. package/window.d.ts.map +1 -0
@@ -0,0 +1,40 @@
1
+ import * as React$1 from "react";
2
+
3
+ //#region ../react/src/primitives/multimodal-input.d.ts
4
+
5
+ /**
6
+ * Textarea tailored for support conversations. Handles keyboard submit,
7
+ * clipboard uploads and auto-resizing while remaining composable via
8
+ * `asChild`.
9
+ */
10
+ declare const MultimodalInput: React$1.ForwardRefExoticComponent<Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "value"> & {
11
+ value: string;
12
+ onChange: (value: string) => void;
13
+ onSubmit?: () => void;
14
+ onFileSelect?: (files: File[]) => void;
15
+ asChild?: boolean;
16
+ className?: string;
17
+ error?: Error | null;
18
+ disabled?: boolean;
19
+ } & React$1.RefAttributes<HTMLTextAreaElement>>;
20
+ /**
21
+ * Hidden file selector that feeds uploads back into the multimodal input when
22
+ * chat UIs want an explicit attachment button.
23
+ */
24
+ declare const FileInput: React$1.ForwardRefExoticComponent<React$1.InputHTMLAttributes<HTMLInputElement> & {
25
+ onFileSelect?: (files: File[]) => void;
26
+ asChild?: boolean;
27
+ } & React$1.RefAttributes<HTMLInputElement>>;
28
+ declare const SupportInput: React$1.ForwardRefExoticComponent<Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "value"> & {
29
+ value: string;
30
+ onChange: (value: string) => void;
31
+ onSubmit?: () => void;
32
+ onFileSelect?: (files: File[]) => void;
33
+ asChild?: boolean;
34
+ className?: string;
35
+ error?: Error | null;
36
+ disabled?: boolean;
37
+ } & React$1.RefAttributes<HTMLTextAreaElement>>;
38
+ //#endregion
39
+ export { FileInput, MultimodalInput, SupportInput };
40
+ //# sourceMappingURL=multimodal-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multimodal-input.d.ts","names":[],"sources":["../../react/src/primitives/multimodal-input.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA2IA;;AAAsB,cArHT,eAqHS,EArHM,OAAA,CAAA,yBAqHN,CArHM,IAqHN,CArHM,OAAA,CAAA,sBAqHN,CArHM,mBAqHN,CAAA,EAAA,UAAA,GAAA,OAAA,CAAA,GAAA;OAAA,EAAA,MAAA;UARE,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,IAAA;;yBAzHA;SAiIF,CAAA,EAAA,OAAA;EAAA,SAAA,CAAA,EAAA,MAAA;EAqCT,KAAA,CAAA,EAnKJ,KAmKI,GAA8B,IAAA;EAAA,QAAA,CAAA,EAAA,OAAA;yBAAlB,oBAAA,CAAA,CAAA;;;;;cArCZ,WAAS,OAAA,CAAA,0BAAA,OAAA,CAAA,oBAAA;yBARE;;;cA6CX,cAAY,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,uBAAA;;;;yBAtKD;;;UAGf"}
package/package.json ADDED
@@ -0,0 +1,114 @@
1
+ {
2
+ "name": "@cossistant/next",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "author": "Cossistant team",
6
+ "description": "Next.js-ready SDK for building AI-powered support/chat widgets. Hooks + primitives, WS-driven, TypeScript-first. Next.js-ready, Tailwind optional.",
7
+ "keywords": [
8
+ "react",
9
+ "react-hooks",
10
+ "react-components",
11
+ "headless",
12
+ "headless-ui",
13
+ "support",
14
+ "customer-support",
15
+ "helpdesk",
16
+ "support-widget",
17
+ "chat-widget",
18
+ "live-chat",
19
+ "ai",
20
+ "ai-support",
21
+ "ai-agent",
22
+ "support-agent",
23
+ "sdk",
24
+ "typescript",
25
+ "nextjs",
26
+ "websocket",
27
+ "tanstack-query",
28
+ "open-source",
29
+ "tailwind",
30
+ "shadcn",
31
+ "a11y",
32
+ "accessibility"
33
+ ],
34
+ "bugs": {
35
+ "url": "https://github.com/cossistantcom/cossistant/issues"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/cossistantcom/cossistant.git",
40
+ "directory": "packages/next"
41
+ },
42
+ "license": "MIT",
43
+ "homepage": "https://cossistant.com",
44
+ "exports": {
45
+ ".": {
46
+ "types": "./index.d.ts",
47
+ "import": "./index.js"
48
+ },
49
+ "./primitives": {
50
+ "types": "./primitives/index.d.ts",
51
+ "import": "./primitives/index.js"
52
+ },
53
+ "./support": {
54
+ "types": "./support/index.d.ts",
55
+ "import": "./support/index.js"
56
+ },
57
+ "./hooks": {
58
+ "types": "./hooks/index.d.ts",
59
+ "import": "./hooks/index.js"
60
+ },
61
+ "./hooks/*": {
62
+ "types": "./hooks/*d.ts",
63
+ "import": "./hooks/*js"
64
+ },
65
+ "./support.css": "./support/support.css",
66
+ "./realtime": {
67
+ "types": "./realtime/index.d.ts",
68
+ "import": "./realtime/index.js"
69
+ },
70
+ "./utils": {
71
+ "types": "./utils/index.d.ts",
72
+ "import": "./utils/index.js"
73
+ },
74
+ "./utils/*": {
75
+ "types": "./utils/*.d.ts",
76
+ "import": "./utils/*.js"
77
+ }
78
+ },
79
+ "main": "./index.js",
80
+ "module": "./index.js",
81
+ "types": "./index.d.ts",
82
+ "sideEffects": [
83
+ "*.css"
84
+ ],
85
+ "publishConfig": {
86
+ "access": "public"
87
+ },
88
+ "dependencies": {
89
+ "@cossistant/react": "workspace:*",
90
+ "tailwindcss": "^4.1.13"
91
+ },
92
+ "peerDependencies": {
93
+ "react": ">=18 <20",
94
+ "react-dom": ">=18 <20",
95
+ "next": ">=13.5.2 || ^14.0.0 || ^15.0.0"
96
+ },
97
+ "peerDependenciesMeta": {
98
+ "@types/react": {
99
+ "optional": true
100
+ }
101
+ },
102
+ "browserslist": {
103
+ "production": [
104
+ ">0.2%",
105
+ "not dead",
106
+ "not op_mini all"
107
+ ],
108
+ "development": [
109
+ "last 1 chrome version",
110
+ "last 1 firefox version",
111
+ "last 1 safari version"
112
+ ]
113
+ }
114
+ }
@@ -0,0 +1,13 @@
1
+ import { TypingIndicator, TypingIndicatorProps, TypingParticipant, TypingParticipantType } from "../typing-indicator.js";
2
+ import { SupportConfig } from "../support-config2.js";
3
+ import { Avatar } from "../avatar.js";
4
+ import { AvatarFallback } from "../fallback.js";
5
+ import { AvatarImage } from "../image.js";
6
+ import { SupportBubble } from "../bubble.js";
7
+ import { Button } from "../button.js";
8
+ import { ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading } from "../conversation-timeline.js";
9
+ import { FileInput, MultimodalInput, SupportInput } from "../multimodal-input.js";
10
+ import { TimelineItem, TimelineItemContent, TimelineItemTimestamp } from "../timeline-item.js";
11
+ import { TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator } from "../timeline-item-group.js";
12
+ import { SupportWindow } from "../window.js";
13
+ export { Avatar, AvatarFallback, AvatarImage, SupportBubble as Bubble, Button, SupportConfig as Config, ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading, FileInput, SupportInput as Input, MultimodalInput, TimelineItem, TimelineItemContent, TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator, TimelineItemTimestamp, TypingIndicator, TypingIndicatorProps, TypingParticipant, TypingParticipantType, SupportWindow as Window };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+
3
+
4
+ import { __reExport } from "../_virtual/rolldown_runtime.js";
5
+
6
+ export * from "@cossistant/react/primitives"
7
+
8
+ export { primitives_exports };
package/provider.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { CossistantContextValue, CossistantProviderProps, SupportProvider, SupportProviderProps, useSupport } from "./provider2.js";
2
+ export { CossistantContextValue, CossistantProviderProps, SupportProvider, SupportProviderProps, useSupport };
package/provider.js ADDED
@@ -0,0 +1,8 @@
1
+ "use client";
2
+
3
+
4
+ import { __reExport } from "./_virtual/rolldown_runtime.js";
5
+
6
+ export * from "@cossistant/react/provider"
7
+
8
+ export { provider_exports };
package/provider2.d.ts ADDED
@@ -0,0 +1,93 @@
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { QueryClient } from "@tanstack/react-query";
4
+
5
+ //#region ../react/src/provider.d.ts
6
+ type SupportProviderProps = {
7
+ children: React$1.ReactNode;
8
+ defaultOpen?: boolean;
9
+ apiUrl?: string;
10
+ wsUrl?: string;
11
+ publicKey?: string;
12
+ defaultMessages?: DefaultMessage[];
13
+ quickOptions?: string[];
14
+ autoConnect?: boolean;
15
+ onWsConnect?: () => void;
16
+ onWsDisconnect?: () => void;
17
+ onWsError?: (error: Error) => void;
18
+ queryClient?: QueryClient;
19
+ };
20
+ type CossistantProviderProps = SupportProviderProps;
21
+ type CossistantContextValue = {
22
+ website: PublicWebsiteResponse | null;
23
+ defaultMessages: DefaultMessage[];
24
+ quickOptions: string[];
25
+ setDefaultMessages: (messages: DefaultMessage[]) => void;
26
+ setQuickOptions: (options: string[]) => void;
27
+ unreadCount: number;
28
+ setUnreadCount: (count: number) => void;
29
+ isLoading: boolean;
30
+ error: Error | null;
31
+ client: CossistantClient;
32
+ };
33
+ /**
34
+ * Hosts the entire customer support widget ecosystem by handing out context
35
+ * about the current website, visitor, unread counts, realtime subscriptions
36
+ * and the REST client. Provide your Cossistant public key plus optional
37
+ * defaults to configure the widget behaviour.
38
+ */
39
+ declare function SupportProvider({
40
+ children,
41
+ apiUrl,
42
+ wsUrl,
43
+ publicKey,
44
+ defaultMessages,
45
+ quickOptions,
46
+ autoConnect,
47
+ onWsConnect,
48
+ onWsDisconnect,
49
+ onWsError,
50
+ queryClient
51
+ }: SupportProviderProps): react_jsx_runtime0.JSX.Element;
52
+ /**
53
+ * Convenience hook that exposes the aggregated support context. Throws when it
54
+ * is consumed outside of `SupportProvider` to catch integration mistakes.
55
+ */
56
+ declare function useSupport(): {
57
+ availableHumanAgents: {
58
+ id: string;
59
+ name: string;
60
+ image: string | null;
61
+ lastSeenAt: string | null;
62
+ }[];
63
+ availableAIAgents: {
64
+ id: string;
65
+ name: string;
66
+ image: string | null;
67
+ }[];
68
+ visitor: {
69
+ locale: string | null;
70
+ id: string;
71
+ isBlocked: boolean;
72
+ language: string | null;
73
+ contact: {
74
+ id: string;
75
+ name: string | null;
76
+ email: string | null;
77
+ image: string | null;
78
+ } | null;
79
+ } | undefined;
80
+ website: PublicWebsiteResponse | null;
81
+ defaultMessages: DefaultMessage[];
82
+ quickOptions: string[];
83
+ setDefaultMessages: (messages: DefaultMessage[]) => void;
84
+ setQuickOptions: (options: string[]) => void;
85
+ unreadCount: number;
86
+ setUnreadCount: (count: number) => void;
87
+ isLoading: boolean;
88
+ error: Error | null;
89
+ client: CossistantClient;
90
+ };
91
+ //#endregion
92
+ export { CossistantContextValue, CossistantProviderProps, SupportProvider, SupportProviderProps, useSupport };
93
+ //# sourceMappingURL=provider2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider2.d.ts","names":[],"sources":["../../react/src/provider.tsx"],"sourcesContent":[],"mappings":";;;;;KASY,oBAAA;EAAA,QAAA,EACD,OAAA,CAAM,SADe;EAAA,WAAA,CAAA,EAAA,OAAA;QACrB,CAAA,EAAA,MAAM;OAKE,CAAA,EAAA,MAAA;WAKE,CAAA,EAAA,MAAA;iBACN,CAAA,EANI,cAMJ,EAAA;EAAW,YAAA,CAAA,EAAA,MAAA,EAAA;EAGd,WAAA,CAAA,EAAA,OAAA;EAEA,WAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAAsB,cAAA,CAAA,EAAA,GAAA,GAAA,IAAA;WACxB,CAAA,EAAA,CAAA,KAAA,EAPW,KAOX,EAAA,GAAA,IAAA;aACQ,CAAA,EAPH,WAOG;;AAOV,KAXI,uBAAA,GAA0B,oBAW9B;AACC,KAVG,sBAAA,GAUH;EAAgB,OAAA,EATf,qBASe,GAAA,IAAA;EA+HT,eAAA,EAvIE,cAuIa,EAAA;EAAA,YAAA,EAAA,MAAA,EAAA;oBAC9B,EAAA,CAAA,QAAA,EAtI+B,cAsI/B,EAAA,EAAA,GAAA,IAAA;iBACA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,EAAA,GAAA,IAAA;aACA,EAAA,MAAA;gBACA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,IAAA;WACA,EAAA,OAAA;OACA,EAtIO,KAsIP,GAAA,IAAA;QACA,EAtIQ,gBAsIR;;;;;;;;AA4Ce,iBAnDA,eAAA,CAmDU;EAAA,QAAA;EAAA,MAAA;EAAA,KAAA;EAAA,SAAA;EAAA,eAAA;EAAA,YAAA;EAAA,WAAA;EAAA,WAAA;EAAA,cAAA;EAAA,SAAA;EAAA;AAAA,CAAA,EAvCvB,oBAuCuB,CAAA,EAvCH,kBAAA,CAAA,GAAA,CAAA,OAuCG;;;;;AAnLlB,iBAmLQ,UAAA,CAAA,CAnLR,EAAA;sBACC,EAAA;IAAgB,EAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;WATf;mBACQ;;iCAEc;;;;;SAKxB;UACC"}
package/provider3.d.ts ADDED
@@ -0,0 +1,56 @@
1
+ import React from "react";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
+
4
+ //#region ../react/src/realtime/provider.d.ts
5
+ type SubscribeHandler = (event: AnyRealtimeEvent) => void;
6
+ type VisitorAuthConfig = {
7
+ kind: "visitor";
8
+ visitorId: string | null;
9
+ websiteId?: string | null;
10
+ publicKey?: string | null;
11
+ };
12
+ type SessionAuthConfig = {
13
+ kind: "session";
14
+ sessionToken: string | null;
15
+ websiteId?: string | null;
16
+ userId?: string | null;
17
+ };
18
+ type RealtimeAuthConfig = VisitorAuthConfig | SessionAuthConfig;
19
+ type RealtimeProviderProps = {
20
+ children: React.ReactNode;
21
+ wsUrl?: string;
22
+ auth: RealtimeAuthConfig | null;
23
+ autoConnect?: boolean;
24
+ onConnect?: () => void;
25
+ onDisconnect?: () => void;
26
+ onError?: (error: Error) => void;
27
+ };
28
+ type RealtimeConnectionState = {
29
+ isConnected: boolean;
30
+ isConnecting: boolean;
31
+ error: Error | null;
32
+ send: (event: AnyRealtimeEvent) => void;
33
+ sendRaw: (data: string) => void;
34
+ subscribe: (handler: SubscribeHandler) => () => void;
35
+ lastEvent: AnyRealtimeEvent | null;
36
+ connectionId: string | null;
37
+ reconnect: () => void;
38
+ };
39
+ type RealtimeContextValue = RealtimeConnectionState & {
40
+ visitorId: string | null;
41
+ websiteId: string | null;
42
+ userId: string | null;
43
+ };
44
+ declare function RealtimeProvider({
45
+ children,
46
+ wsUrl,
47
+ auth,
48
+ autoConnect,
49
+ onConnect,
50
+ onDisconnect,
51
+ onError
52
+ }: RealtimeProviderProps): react_jsx_runtime2.JSX.Element;
53
+ declare function useRealtimeConnection(): RealtimeContextValue;
54
+ //#endregion
55
+ export { type RealtimeAuthConfig, type RealtimeContextValue, RealtimeProvider, type RealtimeProviderProps, useRealtimeConnection };
56
+ //# sourceMappingURL=provider3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider3.d.ts","names":[],"sources":["../../react/src/realtime/provider.tsx"],"sourcesContent":[],"mappings":";;;;KAuBK,gBAAA,WAA2B;KA+B3B,iBAAA;EA/BA,IAAA,EAAA,SAAA;EA+BA,SAAA,EAAA,MAAA,GAAiB,IAAA;EAOjB,SAAA,CAAA,EAAA,MAAA,GAAiB,IAAA;EAOjB,SAAA,CAAA,EAAA,MAAA,GAAkB,IAAA;CAAA;KAPlB,iBAAA,GAOqB;MAAoB,EAAA,SAAA;EAAiB,YAAA,EAAA,MAAA,GAAA,IAAA;EAW1D,SAAA,CAAA,EAAA,MAAA,GAAA,IAAqB;EAAA,MAAA,CAAA,EAAA,MAAA,GAAA,IAAA;;KAXrB,kBAAA,GAAqB,iBAcnB,GAduC,iBAcvC;KAHF,qBAAA,GAOc;EAAK,QAAA,EANb,KAAA,CAAM,SAMO;EAGnB,KAAA,CAAA,EAAA,MAAA;EAAuB,IAAA,EAPrB,kBAOqB,GAAA,IAAA;aAGpB,CAAA,EAAA,OAAA;WACO,CAAA,EAAA,GAAA,GAAA,IAAA;cAEO,CAAA,EAAA,GAAA,GAAA,IAAA;SACV,CAAA,EAAA,CAAA,KAAA,EAVO,KAUP,EAAA,GAAA,IAAA;CAAgB;AAAA,KAPvB,uBAAA,GAYoB;EA2QT,WAAA,EAAA,OAAgB;EAAA,YAAA,EAAA,OAAA;OAC/B,EArRO,KAqRP,GAAA,IAAA;MACA,EAAA,CAAA,KAAA,EArRc,gBAqRd,EAAA,GAAA,IAAA;SACA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA,IAAA;WACA,EAAA,CAAA,OAAA,EArRqB,gBAqRrB,EAAA,GAAA,GAAA,GAAA,IAAA;WACA,EArRW,gBAqRX,GAAA,IAAA;cACA,EAAA,MAAA,GAAA,IAAA;WACA,EAAA,GAAA,GAAA,IAAA;;KAlRI,oBAAA,GAAuB,uBAmRJ,GAAA;EAAA,SAAA,EAAA,MAAA,GAAA,IAAA;EAmPR,SAAA,EAAA,MAAA,GAAA,IAAqB;;;iBA3PrB,gBAAA;;;;;;;;GAQb,wBAAqB,kBAAA,CAAA,GAAA,CAAA;iBAmPR,qBAAA,CAAA,GAAyB"}
@@ -0,0 +1,6 @@
1
+ import { RealtimeAuthConfig, RealtimeContextValue, RealtimeProvider, RealtimeProviderProps, useRealtimeConnection } from "../provider3.js";
2
+ import { applyConversationSeenEvent, hydrateConversationSeen, upsertConversationSeen } from "../seen-store.js";
3
+ import { SupportRealtimeProvider } from "../support-provider.js";
4
+ import { applyConversationTypingEvent, clearTypingFromTimelineItem, clearTypingState, setTypingState } from "../typing-store.js";
5
+ import { RealtimeEventHandler, RealtimeEventHandlerEntry, RealtimeEventHandlersMap, RealtimeEventMeta, useRealtime } from "../use-realtime.js";
6
+ export { RealtimeAuthConfig, RealtimeContextValue, RealtimeEventHandler, RealtimeEventHandlerEntry, RealtimeEventHandlersMap, RealtimeEventMeta, RealtimeProvider, RealtimeProviderProps, SupportRealtimeProvider, applyConversationSeenEvent, applyConversationTypingEvent, clearTypingFromTimelineItem, clearTypingState, hydrateConversationSeen, setTypingState, upsertConversationSeen, useRealtime, useRealtimeConnection };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+
3
+
4
+ import { __reExport } from "../_virtual/rolldown_runtime.js";
5
+
6
+ export * from "@cossistant/react/realtime"
7
+
8
+ export { realtime_exports };
@@ -0,0 +1,17 @@
1
+ //#region ../react/src/realtime/seen-store.d.ts
2
+
3
+ declare function hydrateConversationSeen(conversationId: string, entries: ConversationSeen[]): void;
4
+ declare function upsertConversationSeen(options: {
5
+ conversationId: string;
6
+ actorType: SeenActorType;
7
+ actorId: string;
8
+ lastSeenAt: Date;
9
+ }): void;
10
+ declare function applyConversationSeenEvent(event: RealtimeEvent<"conversationSeen">, options?: {
11
+ ignoreVisitorId?: string | null;
12
+ ignoreUserId?: string | null;
13
+ ignoreAiAgentId?: string | null;
14
+ }): void;
15
+ //#endregion
16
+ export { applyConversationSeenEvent, hydrateConversationSeen, upsertConversationSeen };
17
+ //# sourceMappingURL=seen-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seen-store.d.ts","names":[],"sources":["../../react/src/realtime/seen-store.ts"],"sourcesContent":[],"mappings":";;AAkEiB,iBAXD,uBAAA,CAWC,cAAA,EAAA,MAAA,EAAA,OAAA,EATP,gBASO,EAAA,CAAA,EAAA,IAAA;AAQD,iBAZA,sBAAA,CAaR,OAAA,EAAA;;aAXI;;cAEC;;iBAQG,0BAAA,QACR"}
@@ -0,0 +1,5 @@
1
+ import { useSupportConfig } from "../config.js";
2
+ import { WebSocketContextValue, WebSocketProvider, useWebSocket } from "../websocket.js";
3
+ import { useSupportStore } from "../support-store.js";
4
+ import { Support, SupportProps } from "../index2.js";
5
+ export { Support, type SupportProps, type WebSocketContextValue, WebSocketProvider, useSupportConfig, useSupportStore, useWebSocket };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+
3
+
4
+ import { Support, WebSocketProvider, useSupportConfig, useSupportStore, useWebSocket } from "@cossistant/react/support";
5
+
6
+ export { Support, WebSocketProvider, useSupportConfig, useSupportStore, useWebSocket };
@@ -0,0 +1,2 @@
1
+ import { SupportConfig, SupportConfigProps } from "./support-config2.js";
2
+ export { SupportConfig, SupportConfigProps };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+
3
+
4
+ import { __reExport } from "./_virtual/rolldown_runtime.js";
5
+
6
+ export * from "@cossistant/react/support-config"
7
+
8
+ export { support_config_exports };
@@ -0,0 +1,18 @@
1
+ //#region ../react/src/support-config.d.ts
2
+ type SupportConfigProps = {
3
+ defaultMessages?: DefaultMessage[];
4
+ quickOptions?: string[];
5
+ };
6
+ /**
7
+ * Component exposed by Cossistant allowing you to change the support widget default messages and quick response whenever rendered.
8
+ */
9
+ declare const SupportConfig: {
10
+ ({
11
+ defaultMessages,
12
+ quickOptions
13
+ }: SupportConfigProps): null;
14
+ displayName: string;
15
+ };
16
+ //#endregion
17
+ export { SupportConfig, SupportConfigProps };
18
+ //# sourceMappingURL=support-config2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-config2.d.ts","names":[],"sources":["../../react/src/support-config.tsx"],"sourcesContent":[],"mappings":";AAMY,KAAA,kBAAA,GAAkB;EAQjB,eAAA,CAoBZ,EA3BkB,cA2BlB,EAAA;EAAA,YAAA,CAAA,EAAA,MAAA,EAAA;;;;;cApBY;;;;KAGV"}
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
+
4
+ //#region ../react/src/realtime/support-provider.d.ts
5
+ type SupportRealtimeProviderProps = {
6
+ children: React.ReactNode;
7
+ };
8
+ /**
9
+ * Bridges websocket events into the core client stores so support hooks stay
10
+ * in sync without forcing refetches.
11
+ */
12
+ declare function SupportRealtimeProvider({
13
+ children
14
+ }: SupportRealtimeProviderProps): react_jsx_runtime1.JSX.Element;
15
+ //#endregion
16
+ export { SupportRealtimeProvider };
17
+ //# sourceMappingURL=support-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-provider.d.ts","names":[],"sources":["../../react/src/realtime/support-provider.tsx"],"sourcesContent":[],"mappings":";;;;KAkBK,4BAAA;YACM,KAAA,CAAM;;AAjBc;AAwB/B;;;AAEG,iBAFa,uBAAA,CAEb;EAAA;AAAA,CAAA,EAAA,4BAAA,CAAA,EAA4B,kBAAA,CAAA,GAAA,CAAA,OAA5B"}
@@ -0,0 +1,6 @@
1
+ //#region ../react/src/support/store/support-store.d.ts
2
+ type UseSupportStoreResult = SupportStoreState & Pick<SupportStore, "navigate" | "replace" | "goBack" | "open" | "close" | "toggle" | "updateConfig" | "reset">;
3
+ declare function useSupportStore(): UseSupportStoreResult;
4
+ //#endregion
5
+ export { useSupportStore };
6
+ //# sourceMappingURL=support-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-store.d.ts","names":[],"sources":["../../react/src/support/store/support-store.ts"],"sourcesContent":[],"mappings":";AA8CY,KAAA,qBAAA,GAAwB,iBAAH,GAChC,IADgC,CAE/B,YAF+B,EAAA,UAAA,GAAA,SAAA,GAAA,QAAA,GAAA,MAAA,GAAA,OAAA,GAAA,QAAA,GAAA,cAAA,GAAA,OAAA,CAAA;AAAA,iBAajB,eAAA,CAAA,CAbiB,EAaE,qBAbF"}
@@ -0,0 +1,110 @@
1
+ import * as React$1 from "react";
2
+
3
+ //#region ../react/src/primitives/timeline-item-group.d.ts
4
+
5
+ /**
6
+ * Shape returned to render-prop children describing the grouped timeline items state
7
+ * and viewer specific flags.
8
+ */
9
+ type TimelineItemGroupRenderProps = {
10
+ senderType: SenderType;
11
+ senderId: string;
12
+ viewerType?: SenderType;
13
+ isSentByViewer: boolean;
14
+ isReceivedByViewer: boolean;
15
+ isVisitor: boolean;
16
+ isAI: boolean;
17
+ isTeamMember: boolean;
18
+ itemCount: number;
19
+ firstItemId: string | undefined;
20
+ lastItemId: string | undefined;
21
+ hasBeenSeenByViewer?: boolean;
22
+ seenByIds?: string[];
23
+ };
24
+ /**
25
+ * Groups sequential timeline items from the same sender and exposes render helpers
26
+ * that describe who sent the batch and whether the active viewer has seen it.
27
+ * Consumers can either render their own layout via a render prop or rely on
28
+ * slotted children. Typically used for MESSAGE-type items; EVENT items are usually rendered separately.
29
+ */
30
+ declare const TimelineItemGroup: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
31
+ children?: React$1.ReactNode | ((props: TimelineItemGroupRenderProps) => React$1.ReactNode);
32
+ asChild?: boolean;
33
+ className?: string;
34
+ items: TimelineItemType[];
35
+ viewerId?: string;
36
+ viewerType?: SenderType;
37
+ seenByIds?: string[];
38
+ lastReadItemIds?: Map<string, string>;
39
+ } & React$1.RefAttributes<HTMLDivElement>>;
40
+ /**
41
+ * Optional slot rendered next to a grouped batch to display an avatar, agent
42
+ * badge or any other sender metadata supplied by the consumer UI.
43
+ */
44
+ declare const TimelineItemGroupAvatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
45
+ children?: React$1.ReactNode;
46
+ asChild?: boolean;
47
+ className?: string;
48
+ } & React$1.RefAttributes<HTMLDivElement>>;
49
+ /**
50
+ * Decorative or semantic wrapper rendered above a timeline item batch. Useful for
51
+ * injecting agent names, timestamps or custom status labels tied to the sender
52
+ * metadata supplied by `TimelineItemGroup`.
53
+ */
54
+ declare const TimelineItemGroupHeader: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
55
+ children?: React$1.ReactNode | ((props: {
56
+ name?: string;
57
+ senderId?: string;
58
+ senderType?: SenderType;
59
+ }) => React$1.ReactNode);
60
+ asChild?: boolean;
61
+ className?: string;
62
+ name?: string;
63
+ senderId?: string;
64
+ senderType?: SenderType;
65
+ } & React$1.RefAttributes<HTMLDivElement>>;
66
+ /**
67
+ * Container for the actual timeline items within a batch. Consumers can
68
+ * override the structure while inheriting layout props passed down from the
69
+ * parent group.
70
+ */
71
+ declare const TimelineItemGroupContent: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
72
+ children?: React$1.ReactNode;
73
+ asChild?: boolean;
74
+ className?: string;
75
+ } & React$1.RefAttributes<HTMLDivElement>>;
76
+ /**
77
+ * Utility slot for showing who has viewed the most recent timeline item in the
78
+ * group. Works with simple text children or a render prop for advanced
79
+ * displays.
80
+ */
81
+ declare const TimelineItemGroupSeenIndicator: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
82
+ children?: React$1.ReactNode | ((props: {
83
+ seenByIds: string[];
84
+ hasBeenSeen: boolean;
85
+ }) => React$1.ReactNode);
86
+ asChild?: boolean;
87
+ className?: string;
88
+ seenByIds?: string[];
89
+ } & React$1.RefAttributes<HTMLDivElement>>;
90
+ /**
91
+ * Renders read receipts for the tail timeline item in a group. It surfaces the list
92
+ * of readers and callers can decide whether to render avatars, tooltips or a
93
+ * basic label.
94
+ */
95
+ declare const TimelineItemGroupReadIndicator: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
96
+ children?: React$1.ReactNode | ((props: {
97
+ readers: Array<{
98
+ userId: string;
99
+ isLastRead: boolean;
100
+ }>;
101
+ lastReaderIds: string[];
102
+ }) => React$1.ReactNode);
103
+ asChild?: boolean;
104
+ className?: string;
105
+ itemId: string;
106
+ lastReadItemIds?: Map<string, string>;
107
+ } & React$1.RefAttributes<HTMLDivElement>>;
108
+ //#endregion
109
+ export { TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator };
110
+ //# sourceMappingURL=timeline-item-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-item-group.d.ts","names":[],"sources":["../../react/src/primitives/timeline-item-group.tsx"],"sourcesContent":[],"mappings":";;;;AASA;;;;AAIwB,KAJZ,4BAAA,GAIY;EA+CX,UAAA,EAjDA,UAyJT;EAAA,QAAA,EAAA,MAAA;YAxG0B,CAAA,EA/ChB,UA+CgB;gBAAA,EAAA,OAAA;oBAAA,EAAA,OAAA;WArB1B,EAAM,OAAA;MACG,EAAA,OAAA;cAAuC,EAAA,OAAA;WAG5C,EAAA,MAAA;aAIM,EAAA,MAAA,GAAA,SAAA;YAIK,EAAA,MAAA,GAAA,SAAA;;;;;AAgLnB;;;;;AAlBI,cArJS,iBAqJH,EArJoB,OAAA,CAAA,yBAqJpB,CArJoB,IAqJpB,CArJoB,OAAA,CAAA,cAqJpB,CArJoB,cAqJpB,CAAA,EAAA,UAAA,CAAA,GAAA;UAIO,CAAA,EA9Kb,OAAA,CAAM,SA8KO,GAAA,CAAA,CAAA,KAAA,EA7KJ,4BA6KI,EAAA,GA7K6B,OAAA,CAAM,SA6KnC,CAAA;SACP,CAAA,EAAA,OAAM;WAKF,CAAA,EAAA,MAAA;SAhLN;;YAwL4B,CAAA,EApLtB,UAoLsB;EAAA,SAAA,CAAA,EAAA,MAAA,EAAA;EAyDvB,eAAA,CAAA,EAzOM,GAyON,CAAA,MAuBT,EAAA,MAAA,CAAA;CAAA,wBAAA,eAAA,CAAA,CAAA;;;;AAsBJ;AAkCI,cAxLS,uBAwLT,EAxLgC,OAAA,CAAA,yBAwLhC,CAxLgC,IAwLhC,CAxLgC,OAAA,CAAA,cAwLhC,CAxLgC,cAwLhC,CAAA,EAAA,UAAA,CAAA,GAAA;UAlCuC,CAAA,EA/J/B,OAAA,CAAM,SA+JyB;SAAA,CAAA,EAAA,OAAA;WAAA,CAAA,EAAA,MAAA;yBAfjC,eAAA,CAAA,CAAA;;;;;;AAwEiC,cA/J9B,uBA+J8B,EA/JP,OAAA,CAAA,yBA+JO,CA/JP,IA+JO,CA/JP,OAAA,CAAA,cA+JO,CA/JP,cA+JO,CAAA,EAAA,UAAA,CAAA,GAAA;aAjLvC,OAAA,CAAM;;;iBAIO;QACP,OAAA,CAAM;;;;;eAKF;;;;;;;cAiED,0BAAwB,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAVzB,OAAA,CAAM;;;;;;;;;cAuDL,gCAA8B,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAfvC,OAAA,CAAM;;;QAIA,OAAA,CAAM;;;;;;;;;;cAoEH,gCAA8B,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAhBvC,OAAA,CAAM;aAEG;;;;;QAEH,OAAA,CAAM;;;;oBAIG"}
@@ -0,0 +1,54 @@
1
+ import * as React$1 from "react";
2
+
3
+ //#region ../react/src/primitives/timeline-item.d.ts
4
+
5
+ /**
6
+ * Metadata describing the origin of a timeline item and pre-parsed content that can
7
+ * be consumed by render-prop children.
8
+ */
9
+ type TimelineItemRenderProps = {
10
+ isVisitor: boolean;
11
+ isAI: boolean;
12
+ isHuman: boolean;
13
+ timestamp: Date;
14
+ text: string | null;
15
+ senderType: "visitor" | "ai" | "human";
16
+ itemType: "message" | "event";
17
+ };
18
+ /**
19
+ * Generic timeline item wrapper that adds accessibility attributes and resolves the
20
+ * sender type into convenient render props for custom layouts. Works with
21
+ * both MESSAGE and EVENT timeline item types.
22
+ */
23
+ declare const TimelineItem: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
24
+ children?: React$1.ReactNode | ((props: TimelineItemRenderProps) => React$1.ReactNode);
25
+ asChild?: boolean;
26
+ className?: string;
27
+ item: TimelineItemType;
28
+ } & React$1.RefAttributes<HTMLDivElement>>;
29
+ /**
30
+ * Renders the content of a timeline item, optionally piping Markdown content through a
31
+ * memoised renderer or handing the raw text to a render prop for custom
32
+ * formatting.
33
+ */
34
+ declare const TimelineItemContent: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
35
+ children?: React$1.ReactNode | ((content: string) => React$1.ReactNode);
36
+ asChild?: boolean;
37
+ className?: string;
38
+ text?: string | null;
39
+ renderMarkdown?: boolean;
40
+ } & React$1.RefAttributes<HTMLDivElement>>;
41
+ /**
42
+ * Timestamp helper that renders a formatted date or allows callers to supply a
43
+ * render prop for custom time displays while preserving semantic markup.
44
+ */
45
+ declare const TimelineItemTimestamp: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLSpanElement>, "children"> & {
46
+ children?: React$1.ReactNode | ((timestamp: Date) => React$1.ReactNode);
47
+ asChild?: boolean;
48
+ className?: string;
49
+ timestamp: Date;
50
+ format?: (date: Date) => string;
51
+ } & React$1.RefAttributes<HTMLSpanElement>>;
52
+ //#endregion
53
+ export { TimelineItem, TimelineItemContent, TimelineItemTimestamp };
54
+ //# sourceMappingURL=timeline-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-item.d.ts","names":[],"sources":["../../react/src/primitives/timeline-item.tsx"],"sourcesContent":[],"mappings":";;;;;AASA;AA2BA;;AAAyB,KA3Bb,uBAAA,GA2Ba;WAAA,EAAA,OAAA;MAAA,EAAA,OAAA;SAZrB,EAAA,OAAM;WACG,EAZD,IAYC;MAA4B,EAAA,MAAM,GAAA,IAAA;YAGxC,EAAA,SAAA,GAAA,IAAA,GAAA,OAAA;;;;;;;;AA0IyB,cAlInB,YAkImB,EAlIP,OAAA,CAAA,yBAkIO,CAlIP,IAkIO,CAlIP,OAAA,CAAA,cAkIO,CAlIP,cAkIO,CAAA,EAAA,UAAA,CAAA,GAAA;EAAA,QAAA,CAAA,EA9I5B,OAAA,CAAM,SA8IsB,GAAA,CAAA,CAAA,KAAA,EA7InB,uBA6ImB,EAAA,GA7IS,OAAA,CAAM,SA6If,CAAA;EAkEnB,OAAA,CAAA,EAAA,OAAA;EA4CT,SAAA,CAAA,EAAA,MAAA;MA5C8B,EA5M3B,gBA4M2B;yBAAA,eAAA,CAAA,CAAA;;;;;;cAlErB,qBAAmB,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAZpB,OAAA,CAAM,kCAAkC,OAAA,CAAM;;;;;;;;;;cA8E7C,uBAAqB,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAXtB,OAAA,CAAM,yBAAyB,SAAS,OAAA,CAAM;;;aAG9C;kBACK"}