@smarter.sh/ui-chat 0.2.14 → 0.7.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.
Files changed (58) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +130 -128
  3. package/dist/smarter-chat-library.es.js +44274 -10767
  4. package/dist/smarter-chat-library.es.js.map +1 -1
  5. package/dist/smarter-chat-library.umd.js +657 -362
  6. package/dist/smarter-chat-library.umd.js.map +1 -1
  7. package/dist/types/src/components/AppTitle/Component.d.ts +13 -0
  8. package/dist/types/src/components/AppTitle/index.d.ts +2 -0
  9. package/dist/types/src/components/Console/Component.d.ts +17 -0
  10. package/dist/types/src/components/Console/ServerLogs.d.ts +8 -0
  11. package/dist/types/src/components/Console/data.d.ts +7 -0
  12. package/dist/types/src/components/Console/enums.d.ts +9 -0
  13. package/dist/types/src/components/Console/index.d.ts +2 -0
  14. package/dist/types/src/components/ErrorBoundary/Component.d.ts +17 -0
  15. package/dist/types/src/components/ErrorBoundary/index.d.ts +2 -0
  16. package/dist/types/src/components/SmarterChat/Component.d.ts +26 -0
  17. package/dist/types/src/components/SmarterChat/icons.d.ts +17 -0
  18. package/dist/types/src/components/SmarterChat/index.d.ts +2 -0
  19. package/dist/types/src/const.d.ts +5 -0
  20. package/dist/types/src/index.d.ts +12 -0
  21. package/dist/types/src/lib/ansi.d.ts +33 -0
  22. package/dist/types/src/lib/api.d.ts +73 -0
  23. package/dist/types/src/lib/code.d.ts +32 -0
  24. package/dist/types/src/lib/cookie.d.ts +17 -0
  25. package/dist/types/src/lib/enums.d.ts +26 -0
  26. package/dist/types/src/lib/layout.d.ts +42 -0
  27. package/dist/types/src/lib/logStream.d.ts +30 -0
  28. package/dist/types/src/lib/math.d.ts +18 -0
  29. package/dist/types/src/lib/mermaid.d.ts +27 -0
  30. package/dist/types/src/lib/messages.d.ts +52 -0
  31. package/dist/types/src/types.d.ts +143 -0
  32. package/dist/ui-chat.css +2 -1
  33. package/package.json +89 -57
  34. package/src/components/Console/Component.css +0 -47
  35. package/src/components/Console/Component.jsx +0 -186
  36. package/src/components/Console/HeadStyles.jsx +0 -20
  37. package/src/components/Console/enums.js +0 -7
  38. package/src/components/Console/index.js +0 -2
  39. package/src/components/ErrorModal/ErrorModal.css +0 -35
  40. package/src/components/ErrorModal/ErrorModal.jsx +0 -56
  41. package/src/components/ErrorModal/index.js +0 -3
  42. package/src/components/SmarterChat/Component.jsx +0 -427
  43. package/src/components/SmarterChat/ErrorBoundary.jsx +0 -32
  44. package/src/components/SmarterChat/Layout.js +0 -47
  45. package/src/components/SmarterChat/api.js +0 -200
  46. package/src/components/SmarterChat/enums.js +0 -17
  47. package/src/components/SmarterChat/index.js +0 -3
  48. package/src/components/SmarterChat/styles.css +0 -149
  49. package/src/components/SmarterChat/utils.jsx +0 -148
  50. package/src/components/enums.js +0 -1
  51. package/src/components/index.js +0 -3
  52. package/src/components/shared/cookie.js +0 -51
  53. package/src/constants.js +0 -2
  54. package/src/index.js +0 -4
  55. package/src/types/index.js +0 -2
  56. package/src/types/propTypes.js +0 -154
  57. package/src/version.js +0 -2
  58. package/types/index.d.ts +0 -17
package/LICENSE CHANGED
@@ -660,9 +660,9 @@ if any, to sign a "copyright disclaimer" for the program, if necessary.
660
660
  For more information on this, and how to apply and follow the GNU AGPL, see
661
661
  <http://www.gnu.org/licenses/>.
662
662
 
663
- EdX Inc. wishes to state, in clarification of the above license terms, that
663
+ Lawrence McDaniel wishes to state, in clarification of the above license terms, that
664
664
  any public, independently available web service offered over the network and
665
- communicating with edX's copyrighted works by any form of inter-service
665
+ communicating with Lawrence McDaniel's copyrighted works by any form of inter-service
666
666
  communication, including but not limited to Remote Procedure Call (RPC)
667
667
  interfaces, is not a work based on our copyrighted work within the meaning
668
668
  of the license. "Corresponding Source" of this work, or works based on this
package/README.md CHANGED
@@ -1,176 +1,178 @@
1
1
  [![NPM](https://a11ybadges.com/badge?logo=npm)](https://www.npmjs.com/package/@smarter.sh/ui-chat)
2
2
  [![GitHub](https://a11ybadges.com/badge?logo=github)](https://github.com/smarter-sh/smarter-chat/)
3
+ [![Test Status](https://github.com/smarter-sh/smarter-chat/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/smarter-sh/smarter-chat/actions/workflows/test.yml)
4
+ [![Coverage](https://img.shields.io/codecov/c/github/smarter-sh/smarter-chat/main?label=coverage&logo=codecov)](https://codecov.io/gh/smarter-sh/smarter-chat)
3
5
  <a href="https://smarter.sh">
4
6
  <img src="https://img.shields.io/badge/Smarter.sh-orange?style=flat&logo=appveyor&logoColor=white" height="32">
5
7
  </a>
6
8
 
7
- # SmarterChat React.js component for smarter.sh
8
-
9
- This project contains the source code for the interactive chatbot found in the Smarter web console [developer workbench](https://platform.smarter.sh/chatbots/example/). It integrates natively with Smarter Saas and on-premise installations. You can optionally enable the meta data output behavior found in the Smarter sandbox. See [Smarter Technical Overview](./doc/README.md)
10
-
11
- This project is also suitable for all front-end cross-platform projects. For example, use this code base to create a react.js run-time for use inside of Wordpress plugins, salesforce.com apps, .net components and Sharepoint add-ins.
9
+ # Smarter Chat
10
+
11
+ Smarter Chat is the React chat component of the [Smarter](https://smarter.sh) LLMClient prompt engineering
12
+ workbench. Beside the chat, its Console displays the LLMClient's configuration, and the chat session's api calls,
13
+ tool calls and plugin usage, and optionally streams your server logs, in color, with long lines that scroll or wrap.
14
+ Drag the separator between the chat and the Console to resize them, or hide the Console, which slides out to the right.
15
+ The new chat button starts a new chat session, and clears the server logs. The Sandbox mode / Production mode button
16
+ shows and hides the backend's own messages in the chat thread. While a prompt runs, its progress (LLM requests, tool,
17
+ plugin and MCP server calls) is displayed in the thread, and a failed prompt is displayed with the LLM provider's error
18
+ message. Responses are rendered as GitHub flavored markdown (headings, emphasis, lists, tables, block quotes, code,
19
+ links and images), with raw html escaped, and images are scaled to fit their chat bubble. Math, written in LaTeX as
20
+ `\( ... \)` inline, or `\[ ... \]` or `$$ ... $$` displayed, is typeset by [KaTeX](https://katex.org). A `mermaid` code block is drawn as a
21
+ [Mermaid](https://mermaid.js.org) diagram, which is downloaded only when a message first has one, with a button that
22
+ shows its code.
23
+
24
+ It is also published to npm as [@smarter.sh/ui-chat](https://www.npmjs.com/package/@smarter.sh/ui-chat), so that
25
+ any web page can use a Smarter LLMClient as its chat backend: a Wordpress or Squarespace site, a Salesforce portal,
26
+ a Shopify storefront, a Sharepoint add-in, or your own web application.
12
27
 
13
28
  ![Basic Usage](./doc/img/readme-usage4.png)
14
29
 
30
+ See the [Smarter Chat documentation](https://docs.smarter.sh/en/latest/smarter-framework/developer-reference/react-integration/smarter-chat.html).
31
+
15
32
  ## Usage
16
33
 
17
34
  ```console
18
35
  npm install @smarter.sh/ui-chat
19
36
  ```
20
37
 
21
- ```jsx
22
- import React from "react";
23
- import ReactDOM from "react-dom/client";
38
+ ```tsx
39
+ import { createRoot } from "react-dom/client";
24
40
  import { SmarterChat } from "@smarter.sh/ui-chat";
25
-
26
- const rootElement = document.getElementById("root");
27
- const root = ReactDOM.createRoot(rootElement);
28
- const apiUrl = rootElement.getAttribute("smarter-chatbot-api-url");
29
- const toggleMetadata = rootElement.getAttribute("smarter-toggle-metadata") === "true";
30
- const csrfCookieName = rootElement.getAttribute("smarter-csrf-cookie-name") || "csrftoken";
31
- const sessionCookieName = rootElement.getAttribute("smarter-session-cookie-name") || "session_key";
32
- const cookieDomain = rootElement.getAttribute("smarter-cookie-domain") || "platform.smarter.sh";
33
- const authSessionCookieName = rootElement.getAttribute("django-session-cookie-name") || "sessionid";
34
- const csrftoken = rootElement.getAttribute("django-csrftoken");
35
- const debugMode = rootElement.getAttribute("smarter-debug-mode") === "true";
36
- const debugCookieName = "debug";
37
-
38
- root.render(
39
- <React.StrictMode>
40
- <SmarterChat
41
- apiUrl={apiUrl}
42
- apiKey={apiKey}
43
- toggleMetadata={toggleMetadata}
44
- csrfCookieName={csrfCookieName}
45
- csrftoken={csrftoken}
46
- debugCookieName={debugCookieName}
47
- debugCookieExpiration={debugCookieExpiration}
48
- debugMode={debugMode}
49
- sessionCookieName={sessionCookieName}
50
- sessionCookieExpiration={sessionCookieExpiration}
51
- authSessionCookieName={authSessionCookieName}
52
- showConsole={true}
53
- cookieDomain={cookieDomain}
54
- />
55
- </React.StrictMode>,
41
+ import "@smarter.sh/ui-chat/dist/ui-chat.css";
42
+ // the stylesheet and fonts of math in the responses. katex is installed with @smarter.sh/ui-chat.
43
+ import "katex/dist/katex.min.css";
44
+
45
+ createRoot(document.getElementById("chat")!).render(
46
+ <SmarterChat
47
+ apiUrl="https://stackademy.3141-5926-5359.api.example.com/"
48
+ cookieDomain="example.com"
49
+ showConsole={false}
50
+ />,
56
51
  );
57
52
  ```
58
53
 
59
- ## Integrate to an existing web page
54
+ React 19 is a peer dependency.
60
55
 
61
- We integrate this react component to the [Smarter developer workbench](https://platform.smarter.sh/) using this small repo, [github.com/smarter-sh/smarter-workbench](https://github.com/smarter-sh/smarter-workbench). This methodology provides a layer of separation between Django and react.js, which keeps things simple. smarter-workbench substantially consists of the following three files:
62
-
63
- - [main.jsx](https://github.com/smarter-sh/smarter-workbench/blob/main/src/main.jsx): a 40-line react.js mini app for configuring this npm component with a Smarter Api url and any initialization settings we choose to include.
64
- - [app-loader.js](https://github.com/smarter-sh/smarter-workbench/blob/main/src/public/app-loader.js): a small js script that injects the react.js build assets into your DOM, initiating the React boot-up process.
65
- - [Makefile](https://github.com/smarter-sh/smarter-workbench/blob/main/Makefile): for automating build and release to AWS Cloudfront, where the react ui-chat app is served.
66
-
67
- Meanwhile, Django adds a pair of DOM elements like the following example, where app-loader.js launches itself with an "iffe", (Immediately Invoked Function Expression).
68
-
69
- ```html
70
- <div
71
- id="smarter-sh-v1-ui-chat-root"
72
- smarter-chatbot-api-url="https://openai.3141-5926-5359.api.smarter.sh/"
73
- smarter-toggle-metadata="False"
74
- style="height: 88vh;"
75
- ></div>
76
- <script async="" src="https://cdn.platform.smarter.sh/ui-chat/app-loader.js"></script>
77
- ```
56
+ ### Props
78
57
 
79
- ## Developers
58
+ | Prop | Default | Description |
59
+ | ------------------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
60
+ | `apiUrl` | (required) | The url of the LLMClient's api. The chat appends `config/` for its configuration. |
61
+ | `apiKey` | `null` | A Smarter api key, sent as `Authorization: Token <apiKey>`, for LLMClients that require authentication. |
62
+ | `toggleMetadata` | `false` | Show the button that shows and hides the backend's messages (system prompt, tool results, Smarter's). |
63
+ | `showConsole` | `true` | Show the Console beside the chat. It needs a wide page. |
64
+ | `debugMode` | `false` | Log to the browser console. |
65
+ | `csrfCookieName` | `"csrftoken"` | The name of Django's CSRF cookie, whose value is sent as the `X-CSRFToken` header. |
66
+ | `csrftoken` | `null` | The CSRF token, when the page cannot read the CSRF cookie. |
67
+ | `sessionCookieName` | `"session_key"` | The cookie in which the chat saves its chat session's key, for the page's path. |
68
+ | `sessionCookieExpiration` | one day | The session cookie's lifetime, in milliseconds. |
69
+ | `debugCookieName` | `"debug"` | The cookie in which the chat saves the LLMClient's debug mode. |
70
+ | `debugCookieExpiration` | one day | The debug cookie's lifetime, in milliseconds. |
71
+ | `cookieDomain` | `""` | The domain whose cookies the chat reads. Empty means the page's own domain. |
72
+ | `smarterRequestId` | `""` | A unique id of the page request, sent as the `X-Smarter-RequestId` header. |
73
+ | `streamProgress` | `true` | Display a running prompt's progress, which the prompt api streams as Server-Sent Events. |
74
+ | `logStreamUrl` | `null` | The url of a server log stream (Server-Sent Events), for the Console's "Server Logs" tab. |
80
75
 
81
- SmarterChat is created with [React](https://react.dev/) leveraging [@chatscope/chat-ui-kit-react](https://www.npmjs.com/package/@chatscope/chat-ui-kit-react)
76
+ The package also exports the `Console` component, the `MessageDirectionEnum`, `SenderRoleEnum`,
77
+ `ValidMessageRolesEnum` and `MenuItems` enums, `version`, and TypeScript types for its props and for the
78
+ Smarter api's data (`SmarterChatProps`, `ChatConfig`, `ChatMessage`, `PromptProgressEvent`, ...).
82
79
 
83
- ### Backend integration
80
+ ### The Smarter api
84
81
 
85
- See [Getting Started with the Smarter Chatbot Api](./doc/CHATBOT_API.md)
86
- This app interacts with two endpoints from the [smarter.sh/v1](https://platform.smarter.sh/docs/api/) chatbot api:
82
+ Smarter Chat calls two apis, both with POST requests that send the browser's cookies:
87
83
 
88
- - GET `/config/`: retrieves a json dict, structured in 4 major sections, with all information required by the react app.
89
- - POST `/chat/`: send a text completion prompt to the Smarter Api.
84
+ - `<apiUrl>config/?session_key=<key>`: the LLMClient's configuration, including the chat session's history,
85
+ which restores the chat thread when the page reloads. A new chat session's key is saved in the session cookie.
86
+ - `chatbot.url_chatbot` in the configuration: the LLMClient's prompt api. It receives the chat thread with each
87
+ new message, `{"session_key": "...", "messages": [...]}`, and returns the completion as a JSON string, in
88
+ `data.body`, whose `smarter.messages` are added to the thread. A failed prompt returns the LLM provider's status,
89
+ and `{"error": {"status", "message"}, "response": <the completion>}` in its body. With `streamProgress`, the
90
+ request accepts `text/event-stream`, and the response is `progress` events while the prompt runs, then a `result`
91
+ event, `{"status": <http status>, "response": <the same JSON>}`. A server that doesn't stream answers with JSON.
90
92
 
91
- Smarter chatbot urls use either of these two naming conventions:
93
+ Requests from your page to the Smarter api are cross-origin, so your page's origin must be allowed by the Smarter
94
+ platform's CORS configuration.
92
95
 
93
- - public: `https://<name>.<account_number>.example.com/`
94
- - authenticated: `https://platform.smarter.sh/chatbots/<name>/`. This react component looks for and adds the Smarter platform sessionid cookie value to request headers, if it exists.
96
+ ## Development
95
97
 
96
- Public api url example for a deployed chatbot:
98
+ This repository is self-contained: clone it, and its Makefile does the rest. The Smarter backend is optional.
97
99
 
98
- - `https://my-chatbot.3141-5926-5359.api.smarter.sh/config/`
99
- - `https://my-chatbot.3141-5926-5359.api.smarter.sh/chat/`
100
-
101
- Authenticated api url example for any chatbot in your Smarter account:
100
+ ```console
101
+ git clone https://github.com/smarter-sh/smarter-chat.git
102
+ cd smarter-chat
103
+ make init # npm install
104
+ make serve # Storybook, at http://localhost:6006
105
+ ```
102
106
 
103
- - `https://platform.smarter.sh/chatbots/my-chatbot/config/`
104
- - `https://platform.smarter.sh/chatbots/my-chatbot/chat/`
107
+ `make serve` browses the components in Storybook, whose stories mock the Smarter api with
108
+ [MSW](https://mswjs.io/), so no backend is needed. When the Smarter dev server is running at http://localhost:9357, the
109
+ stories use the web console's own stylesheets; without it, they use Bootstrap, which the web console's theme is built
110
+ on.
105
111
 
106
- #### Config
112
+ | Command | What it does |
113
+ | --------------- | ------------------------------------------------------------------------------------------------- |
114
+ | `make init` | Installs the dependencies. |
115
+ | `make serve` | Browses the components in Storybook, with the Smarter api mocked. |
116
+ | `make run` | Runs the app with Vite's dev server, proxying api requests to the Smarter dev server (port 9357). |
117
+ | `make build` | Builds the app, with a Vite manifest for Django, and the npm package into `dist/`. |
118
+ | `make test` | Runs the unit tests (Vitest and React Testing Library). Every story is also rendered as a test. |
119
+ | `make coverage` | Runs the unit tests with a coverage report in `coverage/`, which CI uploads to Codecov. |
120
+ | `make lint` | Lints with ESLint, type-checks with TypeScript, and checks formatting with Prettier. |
121
+ | `make release` | Runs the tests, then builds the npm package into `dist/` and publishes it to npm. |
107
122
 
108
- A Json dict containing all configuration data for the chatbot. This is downloaded at run-time when the reactapp is initializing.
109
- Example: [/chatbots/example/config/?session_key=YOUR-SESSION-KEY](http://localhost:8000/chatbots/example/config/)
123
+ ### Inside the Smarter repository
110
124
 
111
- See: [sample config](./data/sample-config.json)
125
+ Smarter's web console hosts Smarter Chat as one of the React apps in its npm workspace. `make react-install`, in the
126
+ [Smarter repository](https://github.com/smarter-sh/smarter), clones this repository into
127
+ `smarter/react/packages/smarter-chat`:
112
128
 
113
- #### Api
129
+ ```console
130
+ git clone https://github.com/smarter-sh/smarter.git
131
+ cd smarter
132
+ make react-install # clones smarter-chat's main branch
133
+ make react-install SMARTER_CHAT_BRANCH=alpha # or another branch
134
+ ```
114
135
 
115
- A REST Api for sending and receiving chat prompt requests. The url comes from the config dict (above): data.chatbot.url_chatbot.
116
- example: `http://api.smarter.sh/v1/chatbots/smarter/example/`
136
+ The same `make` commands work there, in `smarter/react/packages/smarter-chat`, which is this repository's own git
137
+ working tree. Two differ: `make init` installs the whole workspace's dependencies, and `make build` builds the app into
138
+ the Smarter web console's static files, rather than into `build/`. The Smarter repository's `make react-test` and
139
+ `make react-lint`, and its GitHub Actions workflows, also test and lint Smarter Chat along with the other React apps.
117
140
 
118
- example http request:
141
+ ### Commits, versions and releases
119
142
 
120
- ```json
121
- {
122
- "method": "POST",
123
- "credentials": "include",
124
- "mode": "cors",
125
- "headers": {
126
- "Accept": "application/json",
127
- "Content-Type": "application/json",
128
- "X-CSRFToken": "q9WXqqIhYJMI3ZSBIOE18JMORBMqAHri",
129
- "Origin": "http://localhost:8000",
130
- "Cookie": "session_key=a07593ecfaecd24008ca4251096732663ac0213b8cc6bdcce4f4c043276ab0b5; debug=true;"
131
- },
132
- "body": "{\"session_key\":\"a07593ecfaecd24008ca4251096732663ac0213b8cc6bdcce4f4c043276ab0b5\",\"messages\":[{\"role\":\"system\",\"content\":\"You are a helpful chatbot."},{\"role\":\"assistant\",\"content\":\"Welcome to the Smarter demo!\"}]}"
133
- }
134
- ```
143
+ Run `make pre-commit-init` once per clone (the Smarter repository's `make react-install` does it when its virtual
144
+ environment is active). It installs two git hooks: pre-commit, which runs codespell, Prettier and
145
+ ESLint, and the standard pre-commit-hooks checks, and commit-msg, which runs commitlint.
135
146
 
136
- example http response:
137
-
138
- ```json
139
- {
140
- "data": {
141
- "isBase64Encoded": false,
142
- "statusCode": 200,
143
- "headers": {
144
- "Content-Type": "application/json"
145
- },
146
- "body": "{\"id\": \"chatcmpl-AoDpMvoAhf8iSJuEm6pMqkX62HK4G\", \"choices\": [{\"finish_reason\": \"stop\", \"index\": 0, \"logprobs\": null, \"message\": {\"content\": \"Hello! While I'm not your mom, I'm here to help you with any questions or tasks you have. What can I assist you with today?\", \"refusal\": null, \"role\": \"assistant\", \"audio\": null, \"function_call\": null, \"tool_calls\": null}}], \"created\": 1736532916, \"model\": \"gpt-4-turbo-2024-04-09\", \"object\": \"chat.completion\", \"service_tier\": \"default\", \"system_fingerprint\": \"fp_f17929ee92\", \"usage\": {\"completion_tokens\": 33, \"prompt_tokens\": 1122, \"total_tokens\": 1155, \"completion_tokens_details\": {\"accepted_prediction_tokens\": 0, \"audio_tokens\": 0, \"reasoning_tokens\": 0, \"rejected_prediction_tokens\": 0}, \"prompt_tokens_details\": {\"audio_tokens\": 0, \"cached_tokens\": 0}}, \"metadata\": {\"tool_calls\": null, \"model\": \"gpt-4-turbo\", \"temperature\": 0.5, \"max_tokens\": 256, \"input_text\": \"hi mom\"}}"
147
- },
148
- "api": "smarter.sh/v1",
149
- "thing": "Chatbot",
150
- "metadata": {
151
- "command": "chat"
152
- }
153
- }
154
- ```
147
+ Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/), as Smarter's do, because
148
+ [semantic-release](https://semantic-release.gitbook.io/) versions this package from them. On each push to `alpha`
149
+ (prereleases, e.g. `1.0.0-alpha.1`) and to `main`, `.github/workflows/pushMain.yml` determines the next version, writes
150
+ it to `package.json`, adds the release notes to `CHANGELOG.md`, tags the commit and creates a GitHub release. A release
151
+ on `main` is then merged back into `alpha`. `feat` commits are minor releases, `fix` and `perf` commits are patches, and
152
+ a `BREAKING CHANGE:` footer is a major release. See `release.config.cjs`.
155
153
 
156
- ## Contributor Reference
154
+ semantic-release does not publish to npm. After a release on `main`, publish it with `make release`.
157
155
 
158
- ### Getting Started
156
+ ### Source
159
157
 
160
- - `make`: prints a full menu of commands to the console.
161
- - `make init`: Setup your environment for first time use. sets up your Node environment for you. initializes pre-commit, which you need to run prior to creating pull requests.
162
- - `make run`: Run the dev server locally
163
- - `make build`: Build the react.js project. saves vite.js output to `./build` in the root of this project.
164
- - `make release`: Deploy the react.js project. **REQUIRES awscli + keypair with sufficient permissions**. Publishes the contents of the `./build` folder to an AWS S3 bucket served by the host defined by the value of `CDN_HOST_BASE_URL` located in shared/constant.js. For example, the react app for the Smarter workbench is initialized and served from these endpoints: a. [index.html](https://cdn.platform.smarter.sh/ui-chat/index.html): the react app build artifacts, and b. [app-loader.js](https://cdn.platform.smarter.sh/ui-chat/app-loader.js): a script to insert the react app build artifacts into the DOM.
158
+ | Path | Contents |
159
+ | ----------------------------- | ------------------------------------------------------------------------------------------ |
160
+ | `src/index.ts` | The npm package's public api. |
161
+ | `src/main.tsx`, `src/App.tsx` | The app that the Smarter web console renders, configured by its root element's attributes. |
162
+ | `src/components/` | `SmarterChat`, `Console`, `AppTitle` and `ErrorBoundary`, with their stories and tests. |
163
+ | `src/lib/` | The Smarter api calls, the chat thread's messages, and cookies. |
164
+ | `src/mocks/` | Example api data and MSW handlers, for the stories and tests. |
165
165
 
166
- ### Architecture
166
+ ## License
167
167
 
168
- - [Vite](https://vitejs.dev/)
169
- - [React](https://react.dev/)
170
- - [Chat UI Kit React](https://www.npmjs.com/package/@chatscope/chat-ui-kit-react)
168
+ Smarter Chat is licensed under the GNU Affero General Public License v3.0 or later
169
+ ([AGPL-3.0-or-later](./LICENSE)), as Smarter is.
171
170
 
172
171
  ## Contributing
173
172
 
174
- We welcome contributions! There are a variety of ways for you to get involved, regardless of your background. In addition to Pull requests, this project would benefit from contributors focused on documentation and how-to video content creation, testing, community engagement, and stewards to help us to ensure that we comply with evolving standards for the ethical use of AI.
173
+ We welcome contributions! There are a variety of ways for you to get involved, regardless of your background. In
174
+ addition to Pull requests, this project would benefit from contributors focused on documentation and how-to video
175
+ content creation, testing, community engagement, and stewards to help us to ensure that we comply with evolving
176
+ standards for the ethical use of AI.
175
177
 
176
178
  You can also contact [Lawrence McDaniel](https://lawrencemcdaniel.com/contact) directly.