@squadico/chatbot 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +502 -0
- package/dist/chatbot.global.js +8 -0
- package/dist/chatbot.global.js.map +1 -0
- package/dist/components/Approval.d.ts +37 -0
- package/dist/components/Approval.d.ts.map +1 -0
- package/dist/components/ChatbotWidget.d.ts +19 -0
- package/dist/components/ChatbotWidget.d.ts.map +1 -0
- package/dist/components/Choices.d.ts +27 -0
- package/dist/components/Choices.d.ts.map +1 -0
- package/dist/components/Composer.d.ts +35 -0
- package/dist/components/Composer.d.ts.map +1 -0
- package/dist/components/Confirm.d.ts +16 -0
- package/dist/components/Confirm.d.ts.map +1 -0
- package/dist/components/MessageList.d.ts +32 -0
- package/dist/components/MessageList.d.ts.map +1 -0
- package/dist/components/RichText.d.ts +19 -0
- package/dist/components/RichText.d.ts.map +1 -0
- package/dist/element.d.ts +9 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/jsx.d.ts +57 -0
- package/dist/jsx.d.ts.map +1 -0
- package/dist/lib/client.d.ts +217 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/confirm.d.ts +17 -0
- package/dist/lib/confirm.d.ts.map +1 -0
- package/dist/lib/context.d.ts +40 -0
- package/dist/lib/context.d.ts.map +1 -0
- package/dist/lib/conversation.d.ts +49 -0
- package/dist/lib/conversation.d.ts.map +1 -0
- package/dist/lib/i18n.d.ts +152 -0
- package/dist/lib/i18n.d.ts.map +1 -0
- package/dist/lib/openState.d.ts +26 -0
- package/dist/lib/openState.d.ts.map +1 -0
- package/dist/lib/uid.d.ts +8 -0
- package/dist/lib/uid.d.ts.map +1 -0
- package/dist/lib/useChat.d.ts +71 -0
- package/dist/lib/useChat.d.ts.map +1 -0
- package/dist/react.cjs +2 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.ts +30 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +70 -0
- package/dist/react.js.map +1 -0
- package/dist/src-CN1vDssu.js +2492 -0
- package/dist/src-CN1vDssu.js.map +1 -0
- package/dist/src-DvRdkFTu.cjs +8 -0
- package/dist/src-DvRdkFTu.cjs.map +1 -0
- package/dist/types.d.ts +301 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +76 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public contract of the `@squadico/chatbot` package.
|
|
3
|
+
*
|
|
4
|
+
* These types are exported as-is: they are the API seen by hosts (plain HTML,
|
|
5
|
+
* Next.js, Vue 2, Vue 3). Changing any of them breaks the integrator's contract.
|
|
6
|
+
*/
|
|
7
|
+
export type ChatRole = 'user' | 'assistant';
|
|
8
|
+
/**
|
|
9
|
+
* The person the embedding application says is in front of the panel.
|
|
10
|
+
*
|
|
11
|
+
* `id` is whatever the host calls its own user — opaque to Squadico, never
|
|
12
|
+
* resolved against anything. `name` is a label for the transcript.
|
|
13
|
+
*
|
|
14
|
+
* `digest` is what turns the claim from a label into something Squadico can act
|
|
15
|
+
* on, and it is only needed where the application has identity verification
|
|
16
|
+
* switched on in the back office. It has to be computed **on the host's server** —
|
|
17
|
+
* a digest a browser can produce is a digest anybody can produce, and the shared
|
|
18
|
+
* secret would then be in the page's source. With verification on, a claim that
|
|
19
|
+
* arrives without it, or with a wrong one, is refused rather than downgraded.
|
|
20
|
+
*/
|
|
21
|
+
export interface HostUser {
|
|
22
|
+
id: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
/** `HMAC-SHA256(id)` in hex, computed server-side under the application's
|
|
25
|
+
* identity secret. See the README for the snippet. */
|
|
26
|
+
digest?: string;
|
|
27
|
+
}
|
|
28
|
+
/** What a file sent with a question is: sent as a picture, or read as text. */
|
|
29
|
+
export type ChatAttachmentKind = 'image' | 'document';
|
|
30
|
+
/**
|
|
31
|
+
* One file attached to a question, as the panel knows it.
|
|
32
|
+
*
|
|
33
|
+
* No URL: the bytes live behind a route the visitor's token opens, and a token
|
|
34
|
+
* cannot travel on an `<img src>`. The panel fetches them itself and draws the
|
|
35
|
+
* result — see `fetchAttachment`.
|
|
36
|
+
*/
|
|
37
|
+
export interface ChatAttachment {
|
|
38
|
+
id: string;
|
|
39
|
+
kind: ChatAttachmentKind;
|
|
40
|
+
filename: string;
|
|
41
|
+
contentType: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ChatMessage {
|
|
44
|
+
id: string;
|
|
45
|
+
role: ChatRole;
|
|
46
|
+
content: string;
|
|
47
|
+
/** The files sent with it. Empty on an answer, and on most questions. */
|
|
48
|
+
attachments?: ChatAttachment[];
|
|
49
|
+
/** Epoch ms — serialisable, unlike a `Date`, so it survives `postMessage` and
|
|
50
|
+
* `CustomEvent.detail` without loss. */
|
|
51
|
+
createdAt: number;
|
|
52
|
+
/** `true` while SSE tokens are still coming in. */
|
|
53
|
+
streaming?: boolean;
|
|
54
|
+
/** `true` when the message carries an error instead of an answer. */
|
|
55
|
+
error?: boolean;
|
|
56
|
+
/** Which agent wrote it, on an application that holds several. Absent on a
|
|
57
|
+
* single-agent integration, which renders exactly as it did before. */
|
|
58
|
+
agent?: AgentHandle;
|
|
59
|
+
/** The tool call this turn is waiting on, if it stopped on one. The message
|
|
60
|
+
* content is the agent's recap; nothing is written until a decision is sent. */
|
|
61
|
+
approval?: PendingApproval;
|
|
62
|
+
/** The name this message addressed and nobody on the application answers to.
|
|
63
|
+
* The answer came from the agent that answers plain text all the same, so this
|
|
64
|
+
* is a note under it and never an error. */
|
|
65
|
+
unknownHandle?: string;
|
|
66
|
+
/** The handles that do answer, to show instead of the mistyped one. Empty when
|
|
67
|
+
* the organization offers none — the panel then says only that nobody answers
|
|
68
|
+
* to that name. */
|
|
69
|
+
offered?: AgentHandle[];
|
|
70
|
+
/** Who wrote it when no agent handle says so: a member of the organization
|
|
71
|
+
* answering instead of an agent, or an agent of the team the conversation was
|
|
72
|
+
* passed to, which has no handle on the application. */
|
|
73
|
+
authorName?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* One agent a visitor can address, as the panel is told about it.
|
|
77
|
+
*
|
|
78
|
+
* `handle` is what somebody types (`@support`), stored and matched without the
|
|
79
|
+
* sigil. The rest is what the panel draws beside the name — all of it already
|
|
80
|
+
* configured on the agent, so a picker costs nothing extra.
|
|
81
|
+
*/
|
|
82
|
+
export interface AgentHandle {
|
|
83
|
+
handle: string;
|
|
84
|
+
name: string;
|
|
85
|
+
avatarEmoji?: string;
|
|
86
|
+
color?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The tool call a turn stopped on, waiting for a human decision.
|
|
90
|
+
*
|
|
91
|
+
* One call and not a list: the agent pauses on the call it wants to make, and
|
|
92
|
+
* `toolCallId` is what the decision answers by — the same id the runtime tracks
|
|
93
|
+
* the pause under, so approving anything else would resolve the wrong wait.
|
|
94
|
+
*
|
|
95
|
+
* `arguments` is the exact payload that would be sent. Nothing has been written
|
|
96
|
+
* while this is here.
|
|
97
|
+
*/
|
|
98
|
+
export interface PendingApproval {
|
|
99
|
+
toolCallId: string;
|
|
100
|
+
/** Tool name (`create_ticket`, `delete_record`…). */
|
|
101
|
+
tool: string;
|
|
102
|
+
arguments: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* What the panel sends back about a pending call: yes, or no.
|
|
106
|
+
*
|
|
107
|
+
* Two answers and no third. Editing the payload field by field and answering in
|
|
108
|
+
* prose both had a button here once and no server side at all — a control that
|
|
109
|
+
* cannot be honoured is worse than one that is missing, so they are gone. A
|
|
110
|
+
* correction is a new message, and the agent asks again.
|
|
111
|
+
*/
|
|
112
|
+
export interface ApprovalDecision {
|
|
113
|
+
approved: boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* An object named by the host page context: its id, and its name when the host
|
|
117
|
+
* knows it.
|
|
118
|
+
*
|
|
119
|
+
* The name is what gets displayed — the panel chip shows "Order #1042" instead
|
|
120
|
+
* of a UUID — and it is also handed to the agent, which can then name the
|
|
121
|
+
* object without reading it back.
|
|
122
|
+
*/
|
|
123
|
+
export interface ContextObject {
|
|
124
|
+
id: string;
|
|
125
|
+
name?: string;
|
|
126
|
+
}
|
|
127
|
+
/** A context entry: the named object, or its id alone. */
|
|
128
|
+
export type ContextValue = ContextObject | string;
|
|
129
|
+
/**
|
|
130
|
+
* Host page context, handed to the agent on every turn.
|
|
131
|
+
*
|
|
132
|
+
* The shape is entirely the host's: the widget filters nothing and forwards the
|
|
133
|
+
* context as it is. Any key carrying a `{ id, name }` object is displayed as a
|
|
134
|
+
* chip under the header and flattened on the wire into `<key>Id` + `<key>Name`
|
|
135
|
+
* (see `lib/context`), which is the form the agent reads.
|
|
136
|
+
*
|
|
137
|
+
* A page that only holds an id can pass it directly — `orderId: 'ORD-1'` — and
|
|
138
|
+
* a page that also knows the name should prefer the object form, since the name
|
|
139
|
+
* is what the chip shows.
|
|
140
|
+
*
|
|
141
|
+
* It reaches the agent as *data*: a labelled block beside the question, never
|
|
142
|
+
* text folded into its instructions. Which also means it is exactly as
|
|
143
|
+
* trustworthy as the `user` claim next to it — the API bounds it rather than
|
|
144
|
+
* believing it.
|
|
145
|
+
*
|
|
146
|
+
* The conversation's id is not in here: it is handed out by the server when the
|
|
147
|
+
* panel opens, because a visitor allowed to name their own conversation is a
|
|
148
|
+
* visitor choosing which one to read.
|
|
149
|
+
*/
|
|
150
|
+
export interface ChatbotContext {
|
|
151
|
+
[key: string]: unknown;
|
|
152
|
+
}
|
|
153
|
+
export type ChatbotTheme = 'light' | 'dark' | 'auto';
|
|
154
|
+
export type LauncherPosition = 'bottom-right' | 'bottom-left';
|
|
155
|
+
export interface ChatbotEventMap {
|
|
156
|
+
/** The sidebar has just opened. */
|
|
157
|
+
'chatbot-open': {
|
|
158
|
+
sessionId: string;
|
|
159
|
+
};
|
|
160
|
+
/** The sidebar has just closed. */
|
|
161
|
+
'chatbot-close': {
|
|
162
|
+
sessionId: string;
|
|
163
|
+
};
|
|
164
|
+
/** A message was sent (user) or completed (assistant). `agent` says which one
|
|
165
|
+
* answered, where the application holds several — so a host page can react
|
|
166
|
+
* per agent. */
|
|
167
|
+
'chatbot-message': {
|
|
168
|
+
role: ChatRole;
|
|
169
|
+
content: string;
|
|
170
|
+
sessionId: string;
|
|
171
|
+
agent?: string;
|
|
172
|
+
};
|
|
173
|
+
/** The turn failed (network, HTTP, or `{"error": ...}` in the SSE stream). */
|
|
174
|
+
'chatbot-error': {
|
|
175
|
+
message: string;
|
|
176
|
+
status?: number;
|
|
177
|
+
sessionId: string;
|
|
178
|
+
};
|
|
179
|
+
/** The conversation was reset — new `sessionId`. */
|
|
180
|
+
'chatbot-reset': {
|
|
181
|
+
sessionId: string;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export type ChatbotEventName = keyof ChatbotEventMap;
|
|
185
|
+
export type ChatbotEvent = {
|
|
186
|
+
[K in ChatbotEventName]: {
|
|
187
|
+
type: K;
|
|
188
|
+
} & ChatbotEventMap[K];
|
|
189
|
+
}[ChatbotEventName];
|
|
190
|
+
/** Options shared by the custom element (through attributes) and the React
|
|
191
|
+
* wrapper. */
|
|
192
|
+
export interface ChatbotOptions {
|
|
193
|
+
/**
|
|
194
|
+
* Public key of the Squadico application this page embeds. **Required** —
|
|
195
|
+
* with no authentication left in the widget, there is no second mode to fall
|
|
196
|
+
* back to.
|
|
197
|
+
*
|
|
198
|
+
* Safe in client HTML: it identifies the surface and authorizes nothing. Which
|
|
199
|
+
* pages may open a conversation with it is decided by the origin allowlist
|
|
200
|
+
* configured beside it.
|
|
201
|
+
*/
|
|
202
|
+
embedKey?: string;
|
|
203
|
+
/** Host page context handed to the agent. */
|
|
204
|
+
context?: ChatbotContext;
|
|
205
|
+
/**
|
|
206
|
+
* Who the embedding application has signed in, when it has anybody.
|
|
207
|
+
*
|
|
208
|
+
* Optional by design: a marketing site has anonymous visitors, and their
|
|
209
|
+
* conversations are anonymous. Sent once, when the panel opens, and it labels
|
|
210
|
+
* every message that visitor writes.
|
|
211
|
+
*
|
|
212
|
+
* It is attribution and never authorization — anyone can open devtools and
|
|
213
|
+
* send another id, so it groups conversations and names turns in a transcript
|
|
214
|
+
* and decides nothing, unless the application asks for a `digest` its own
|
|
215
|
+
* server computed. Changing `id` at runtime opens a new conversation rather
|
|
216
|
+
* than relabelling the old one.
|
|
217
|
+
*/
|
|
218
|
+
user?: HostUser;
|
|
219
|
+
/**
|
|
220
|
+
* Handle of the agent this page should open on — `sales` on a pricing page.
|
|
221
|
+
*
|
|
222
|
+
* Optional: with nobody named, the agent the application answers plain text with
|
|
223
|
+
* takes the conversation, which is the ordinary case. A handle nobody answers to
|
|
224
|
+
* opens on that same agent rather than refusing, so a page carrying a renamed
|
|
225
|
+
* handle keeps working.
|
|
226
|
+
*
|
|
227
|
+
* It addresses somebody, it does not restrict anybody: the visitor can address
|
|
228
|
+
* another agent in their next message, and the panel offers the handles the
|
|
229
|
+
* organization chose to show.
|
|
230
|
+
*/
|
|
231
|
+
agent?: string;
|
|
232
|
+
/** Header title. Defaults to the `locale` translation (`Assistant` in
|
|
233
|
+
* English). Empty hands it back to the translation. */
|
|
234
|
+
heading?: string;
|
|
235
|
+
/** Header subtitle. Defaults to `Squadico`. */
|
|
236
|
+
subheading?: string;
|
|
237
|
+
/** Name the assistant signs its answers with, above each message. Defaults to
|
|
238
|
+
* the `locale` translation (`Assistant` in English). */
|
|
239
|
+
assistantName?: string;
|
|
240
|
+
/** Placeholder of the input field. Defaults to the `locale` translation. */
|
|
241
|
+
placeholder?: string;
|
|
242
|
+
/** First message shown by the assistant, before any exchange. Defaults to the
|
|
243
|
+
* `locale` translation. */
|
|
244
|
+
greeting?: string;
|
|
245
|
+
/** Clickable suggestions shown under the greeting. */
|
|
246
|
+
suggestions?: string[];
|
|
247
|
+
/** CSS width of the sidebar. Defaults to `min(392px, 100vw)`. */
|
|
248
|
+
width?: string;
|
|
249
|
+
/** CSS accent colour. Defaults to black — white in the dark theme. */
|
|
250
|
+
accent?: string;
|
|
251
|
+
theme?: ChatbotTheme;
|
|
252
|
+
/** Anchor corner of the floating button. The sidebar always stays on the
|
|
253
|
+
* right. */
|
|
254
|
+
position?: LauncherPosition;
|
|
255
|
+
/** Opens the sidebar on mount, for a first visit. Once the user has opened or
|
|
256
|
+
* closed the panel themselves, their gesture wins (see `persistOpen`). */
|
|
257
|
+
defaultOpen?: boolean;
|
|
258
|
+
/** Remembers the open/closed panel across a reload or a navigation, for the
|
|
259
|
+
* lifetime of the browser tab (`sessionStorage`). `false` makes the panel
|
|
260
|
+
* mount from `defaultOpen` every time. Defaults to `true`. */
|
|
261
|
+
persistOpen?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Interface language and date locale, in BCP-47 (`en`, `en-GB`, `fr`,
|
|
264
|
+
* `es-ES`…). **When absent, the browser languages are read**
|
|
265
|
+
* (`navigator.languages`, in the user's own order of preference), and `en` is
|
|
266
|
+
* only used when none is supported.
|
|
267
|
+
*
|
|
268
|
+
* Three languages ship — `en`, `fr`, `es`; anything else falls back to
|
|
269
|
+
* English. The region subtag is only read by `Intl`: `fr-CA` gives the French
|
|
270
|
+
* copy with Canadian dates. A value passed here wins over the browser — the
|
|
271
|
+
* host's own account setting should win, not the OS language. Labels passed
|
|
272
|
+
* explicitly (`heading`, `subheading`, `placeholder`, `greeting`) win over the
|
|
273
|
+
* translation; left empty, they hand it back.
|
|
274
|
+
*/
|
|
275
|
+
locale?: string;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Imperative surface of the `<squadico-chatbot>` custom element.
|
|
279
|
+
* Reachable through `document.querySelector` or a React `ref`.
|
|
280
|
+
*/
|
|
281
|
+
export interface SquadicoChatbotElement extends HTMLElement {
|
|
282
|
+
context?: ChatbotContext;
|
|
283
|
+
embedKey?: string;
|
|
284
|
+
user?: HostUser;
|
|
285
|
+
agent?: string;
|
|
286
|
+
/** Reads and writes the open state of the sidebar. */
|
|
287
|
+
open: boolean;
|
|
288
|
+
openChat(): void;
|
|
289
|
+
closeChat(): void;
|
|
290
|
+
toggleChat(): void;
|
|
291
|
+
/** Clears the history and opens a new conversation on the next message. */
|
|
292
|
+
reset(): void;
|
|
293
|
+
/** Sends a message as if the user had typed it (opens the sidebar). */
|
|
294
|
+
sendMessage(text: string): void;
|
|
295
|
+
/** Id of the current conversation, as the server named it. Empty until the
|
|
296
|
+
* panel has opened one. */
|
|
297
|
+
readonly sessionId: string;
|
|
298
|
+
addEventListener<K extends ChatbotEventName>(type: K, listener: (event: CustomEvent<ChatbotEventMap[K]>) => void, options?: boolean | AddEventListenerOptions): void;
|
|
299
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;2DACuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,+EAA+E;AAC/E,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,CAAA;AAErD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,kBAAkB,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QA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AW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAC1D,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAA;IACP,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAA;CACR"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@squadico/chatbot",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Chatbot Squadico — web component (HTML, Next.js, Vue 2, Vue 3)",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"./dist/*.js",
|
|
9
|
+
"./dist/*.cjs"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"main": "./dist/index.cjs",
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"unpkg": "./dist/chatbot.global.js",
|
|
22
|
+
"jsdelivr": "./dist/chatbot.global.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"require": "./dist/index.cjs"
|
|
28
|
+
},
|
|
29
|
+
"./react": {
|
|
30
|
+
"types": "./dist/react.d.ts",
|
|
31
|
+
"import": "./dist/react.js",
|
|
32
|
+
"require": "./dist/react.cjs"
|
|
33
|
+
},
|
|
34
|
+
"./jsx": {
|
|
35
|
+
"types": "./dist/jsx.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./standalone": "./dist/chatbot.global.js",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "vite",
|
|
42
|
+
"build": "npm run build:bundles && npm run build:types",
|
|
43
|
+
"build:bundles": "vite build && vite build --config vite.config.standalone.ts",
|
|
44
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
45
|
+
"type-check": "tsc --noEmit",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"lint": "eslint .",
|
|
48
|
+
"size": "node scripts/report-size.mjs"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"preact": "^10.29.8"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": ">=17"
|
|
55
|
+
},
|
|
56
|
+
"peerDependenciesMeta": {
|
|
57
|
+
"react": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@eslint/js": "^10.0.1",
|
|
63
|
+
"@testing-library/preact": "^3.2.4",
|
|
64
|
+
"@testing-library/user-event": "^14.6.7",
|
|
65
|
+
"@types/react": "^19.2.18",
|
|
66
|
+
"eslint": "^10.8.1",
|
|
67
|
+
"jsdom": "^29.1.1",
|
|
68
|
+
"typescript": "^6.0.3",
|
|
69
|
+
"typescript-eslint": "^8.67.0",
|
|
70
|
+
"vite": "^8.2.1",
|
|
71
|
+
"vitest": "^3.2.7"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=20.9"
|
|
75
|
+
}
|
|
76
|
+
}
|