diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index b0395d4d..0d4ad3d7 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -24,6 +24,10 @@ env: NODE_VERSION: 18.16.0 # https://github.com/helm/helm/releases HELM_VERSION: 3.11.2 + # https://npmjs.com/package/snyk?activeTab=versions + SNYK_VERSION: 1.1187.0 + # https://github.com/oras-project/oras/releases + ORAS_VERSION: 1.0.0 jobs: sast-creds: @@ -31,7 +35,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: # We need all Git history for testing credentials fetch-depth: 0 @@ -39,7 +43,7 @@ jobs: submodules: recursive - name: SAST - Credentials - uses: trufflesecurity/trufflehog@v3.33.0 + uses: trufflesecurity/trufflehog@v3.44.0 with: base: ${{ github.event.repository.default_branch }} head: HEAD @@ -53,7 +57,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: # We need all Git history for "version.sh" fetch-depth: 0 @@ -73,7 +77,7 @@ jobs: # Required for running "npx" CLI - name: Setup Node - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.7.0 with: node-version: ${{ env.NODE_VERSION }} @@ -112,20 +116,10 @@ jobs: --severity-threshold=medium \ .helm-template - # Fix issue "Error: Code Scanning could not process the submitted SARIF file: rejecting SARIF, as there are more runs than allowed (XX > 20)" - # See: https://github.com/github/codeql-action/issues/220 - - name: Merge SARIF files - run: | - npx --yes @microsoft/sarif-multitool@${{ env.SARIF_MULTITOOL_VERSION }} \ - merge \ - --merge-runs \ - --output-file merged.sarif \ - snyk.sarif - - name: Upload results to GitHub Security - uses: github/codeql-action/upload-sarif@v2.2.12 + uses: github/codeql-action/upload-sarif@v2.20.3 with: - sarif_file: merged.sarif + sarif_file: snyk.sarif deploy-helm: name: Deploy Helm chart @@ -137,7 +131,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: # Chart Releaser needs to have local access to "gh-pages" plus current branch fetch-depth: 0 @@ -177,7 +171,7 @@ jobs: src: [conversation-api, conversation-ui] steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 with: # We need all Git history for "version.sh" fetch-depth: 0 @@ -197,23 +191,23 @@ jobs: - name: Setup QEMU id: setup-qemu - uses: docker/setup-qemu-action@v2.1.0 + uses: docker/setup-qemu-action@v2.2.0 with: platforms: ${{ env.CONTAINER_PLATFORMS }} - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 + uses: docker/setup-buildx-action@v2.9.1 with: version: v${{ env.BUILDX_VERSION }} # Required for running "npx" CLI - name: Setup Node - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.7.0 with: node-version: ${{ env.NODE_VERSION }} - name: Login to container registry - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v2.2.0 with: registry: ${{ env.CONTAINER_REGISTRY }} username: ${{ github.actor }} @@ -221,7 +215,7 @@ jobs: - name: Container meta id: meta - uses: docker/metadata-action@v4.4.0 + uses: docker/metadata-action@v4.6.0 with: images: ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_NAME }}/${{ matrix.src }} tags: | @@ -244,7 +238,7 @@ jobs: echo "tag=$tag" >> $GITHUB_OUTPUT - name: Build/push container - uses: docker/build-push-action@v4.0.0 + uses: docker/build-push-action@v4.1.1 with: build-args: | VERSION=${{ steps.version.outputs.version_full }} @@ -275,20 +269,10 @@ jobs: --severity-threshold=medium \ ${{ steps.tag.outputs.tag }} - # Fix issue "Error: Code Scanning could not process the submitted SARIF file: rejecting SARIF, as there are more runs than allowed (XX > 20)" - # See: https://github.com/github/codeql-action/issues/220 - - name: Merge SARIF files - run: | - npx --yes @microsoft/sarif-multitool@${{ env.SARIF_MULTITOOL_VERSION }} \ - merge \ - --merge-runs \ - --output-file merged.sarif \ - snyk.sarif - - name: Upload results to GitHub Security - uses: github/codeql-action/upload-sarif@v2.2.12 + uses: github/codeql-action/upload-sarif@v2.20.3 with: - sarif_file: merged.sarif + sarif_file: snyk.sarif sast-semgrep: name: SAST - Semgrep @@ -300,7 +284,7 @@ jobs: image: returntocorp/semgrep steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 - name: Run tests # Semgrep can be used to break the build when it detects security issues. In this case we want to upload the issues to GitHub Security @@ -310,6 +294,34 @@ jobs: run: semgrep ci --sarif --output=semgrep.sarif - name: Upload results to GitHub Security - uses: github/codeql-action/upload-sarif@v2.2.12 + uses: github/codeql-action/upload-sarif@v2.20.3 with: sarif_file: semgrep.sarif + + deploy-artifacthub-metadata: + name: Deploy ArtifactHub metadata + # Only deploy on main branch, as we don't want to break verification with a bad metadata file during development + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3.5.3 + + - name: Setup ORAS + uses: oras-project/setup-oras@v1.0.0 + with: + version: ${{ env.ORAS_VERSION }} + + - name: Login to registry + uses: docker/login-action@v2.2.0 + with: + registry: ${{ env.CONTAINER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push to registry + run: | + oras push \ + ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_NAME }}:artifacthub.io \ + artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml \ + --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..d6f0f908 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,83 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [Clémence Lesné](mailto:clemlesne@users.noreply.github.com). All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/README.md b/README.md index c87785e8..7c243ecd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🔒 Private GPT +# Employee communication with Private GPT – AI-powered chatbot you can trust > 👋🏻 Demo available at [private-gpt.shopping-cart-devops-demo.lesne.pro](https://private-gpt.shopping-cart-devops-demo.lesne.pro). @@ -153,4 +153,12 @@ sequenceDiagram WIP +## [Security](./SECURITY.md) + +## Support + +This project is open source and maintained by people like you. If you need help or found a bug, please feel free to open an issue on the [clemlesne/private-gpt](https://github.com/clemlesne/private-gpt) GitHub project. + +## [Code of conduct](./CODE_OF_CONDUCT.md) + ## [Authors](./AUTHORS.md) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..cc658d4e --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Proactive detection of vulnerabilities + +At each build, a vulnerability scan is performed on the system. If a vulnerability that can be upgraded is detected, the build is stopped and the image is not pushed to the registry. Vulnerability is reported in [GitHub Security](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning). The maintainers are alterted and have access to reports. + +Automation is supported by [Snyk](https://snyk.io) and [Semgrep](https://semgrep.dev). Helm chart, configuration files, and containers, are scanned for vulnerabilities and misconfigurations. + +## Reporting a vulnerability + +If you think you have found a vulnerability, please do not open an issue on GitHub. Instead, please send an email to [Clémence Lesné](mailto:clemence@lesne.pro). + +## Chain of trust + +Helm chart and containers are not signed yet with a GPG key. + +## Reliability notes + +Systems are built every days. Each image is accompanied by a SBOM (Software Bill of Materials) which allows to verify that the installed packages are those expected. This speed has the advantage of minimizing exposure to security flaws, which will then be corrected on the build environments in 24 hours. + +Nevertheless it can happen that a package provider (e.g. Debian, Canonical, Red Hat) deploys a system update that introduces a bug. This is difficult to predict. diff --git a/artifacthub-repo.yml b/artifacthub-repo.yml new file mode 100644 index 00000000..f3c2a3ee --- /dev/null +++ b/artifacthub-repo.yml @@ -0,0 +1,4 @@ +repositoryID: 06ff1e13-8ff5-42a2-b081-0d647a731827 +owners: + - name: clemlesne + email: clemlesne@users.noreply.github.com diff --git a/cicd/helm/private-gpt/Chart.yaml b/cicd/helm/private-gpt/Chart.yaml index 66f21a52..6dd46e99 100644 --- a/cicd/helm/private-gpt/Chart.yaml +++ b/cicd/helm/private-gpt/Chart.yaml @@ -2,6 +2,22 @@ name: private-gpt description: Private GPT is a local version of Chat GPT, using Azure OpenAI. version: 0.0.0 apiVersion: v1 +keywords: + - ai-assisted-chat + - azure-openai + - business-productivity + - chatgpt + - cloud-based-chat + - conversational-interface + - deploy-chatbot + - employee-communication + - employee-engagement + - enterprise-grade-platform + - internal-communication + - local-chatbot + - natural-language-processing + - private-gpt + - virtual-assistant-for-employees dependencies: - name: qdrant version: 0.2.9 diff --git a/docs/doc.png b/docs/doc.png index 8a53ef28..0ee057e1 100644 Binary files a/docs/doc.png and b/docs/doc.png differ diff --git a/src/conversation-api/main.py b/src/conversation-api/main.py index 895563ba..3ba9a280 100644 --- a/src/conversation-api/main.py +++ b/src/conversation-api/main.py @@ -136,6 +136,7 @@ def get_ai_prompt() -> Dict[UUID, StoredPromptModel]: You MUST: - Cite sources and examples as footnotes (example: [^1]) +- Specify the language name when you cite source code (example: ```python) - Write emojis as gemoji shortcodes (example: :smile:) - Write links with Markdown syntax (example: [You can find it at google.com.](https://google.com)) - Write lists with Markdown syntax, using dashes (example: - First item) or numbers (example: 1. First item) @@ -143,12 +144,11 @@ def get_ai_prompt() -> Dict[UUID, StoredPromptModel]: EXAMPLE #1 User: What is the capital of France? -Paris[^1] is the capital of France. -[^1]: https://paris.fr +You: Paris[^1] is the capital of France. [^1]: https://paris.fr EXAMPLE #2 User: I am happy! -:smile: +You: :smile: """ AI_TITLE_PROMPT = """ @@ -158,34 +158,32 @@ def get_ai_prompt() -> Dict[UUID, StoredPromptModel]: - A sentence, not a question - A summary of the conversation - Extremely concise +- If you can't find a title, write "null" - In the language of the conversation -- Shorter than 10 words - -Exmaple to follow: EXAMPLE #1 User: I want to build an influence strategy on Twitter. Give me a 12-step chart showing how to do it. -Twitter and influence strategy +You: Twitter and influence strategy EXAMPLE #2 User: aws store api calls for audit -Store AWS API calls +You: Store AWS API calls EXAMPLE #3 User: lol! -A funny conversation +You: A funny conversation EXAMPLE #4 User: xxx -Unknown subject +You: null EXAMPLE #5 User: hello boy -Unknown subject +You: null EXAMPLE #6 User: write a poem -A poem +You: A poem """ @@ -548,7 +546,7 @@ async def _guess_title_background( # Create messages object from conversation # We don't include the custom prompt, as it will false the title response (espacially with ASCI art prompt) completion_messages = [ - {"role": MessageRole.SYSTEM, "content": AI_CONVERSATION_DEFAULT_PROMPT} + {"role": MessageRole.SYSTEM, "content": AI_TITLE_PROMPT} ] completion_messages += [{"role": m.role, "content": m.content} for m in messages] @@ -556,6 +554,10 @@ async def _guess_title_background( content = await openai.completion(completion_messages, current_user) + if content == "null": + logger.error("No title found") + return + # Store the updated conversation in Redis conversation.title = content await store.conversation_set(conversation) diff --git a/src/conversation-api/persistence/cosmos.py b/src/conversation-api/persistence/cosmos.py index 1dc8c0b8..5096edeb 100644 --- a/src/conversation-api/persistence/cosmos.py +++ b/src/conversation-api/persistence/cosmos.py @@ -60,7 +60,7 @@ async def user_get(self, user_external_id: str) -> Union[UserModel, None]: return None async def user_set(self, user: UserModel) -> None: - user_client.create_item(body={ + user_client.upsert_item(body={ **self._sanitize_before_insert(user.dict()), "dummy": "dummy", }) @@ -80,7 +80,7 @@ async def conversation_exists(self, conversation_id: UUID, user_id: UUID) -> boo return self.conversation_get(conversation_id, user_id) is not None async def conversation_set(self, conversation: StoredConversationModel) -> None: - conversation_client.create_item(body=self._sanitize_before_insert(conversation.dict())) + conversation_client.upsert_item(body=self._sanitize_before_insert(conversation.dict())) async def conversation_list(self, user_id: UUID) -> List[StoredConversationModel]: query = f"SELECT * FROM c WHERE c.user_id = '{user_id}' ORDER BY c.created_at DESC" @@ -112,7 +112,7 @@ async def message_get_index( async def message_set(self, message: StoredMessageModel) -> None: expiry = SECRET_TTL_SECS if message.secret else None - message_client.create_item(body={ + message_client.upsert_item(body={ **self._sanitize_before_insert(message.dict()), "_ts": expiry, # TTL in seconds }) @@ -127,7 +127,7 @@ async def usage_set(self, usage: UsageModel) -> None: self._loop.create_task(self._usage_set_background(usage)) async def _usage_set_background(self, usage: UsageModel) -> None: - usage_client.create_item(body=self._sanitize_before_insert(usage.dict())) + usage_client.upsert_item(body=self._sanitize_before_insert(usage.dict())) def _sanitize_before_insert(self, item: dict) -> Dict[str, Any]: for key, value in item.items(): diff --git a/src/conversation-ui/Dockerfile b/src/conversation-ui/Dockerfile index a8c065ef..b3042b54 100644 --- a/src/conversation-ui/Dockerfile +++ b/src/conversation-ui/Dockerfile @@ -15,7 +15,7 @@ RUN npm install \ && npm run build # Output container -FROM docker.io/nginxinc/nginx-unprivileged:1.23-alpine3.17 +FROM docker.io/nginxinc/nginx-unprivileged:1.25-alpine3.17 USER root diff --git a/src/conversation-ui/package-lock.json b/src/conversation-ui/package-lock.json index bb269f8b..f39c7ba7 100644 --- a/src/conversation-ui/package-lock.json +++ b/src/conversation-ui/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@microsoft/applicationinsights-react-js": "^3.4.3", "@microsoft/applicationinsights-web": "^3.0.2", - "@orama/orama": "^1.0.9", + "@orama/orama": "^1.0.10", "autoprefixer": "^10.4.14", "axios": "^1.4.0", "axios-retry": "^3.5.1", @@ -37,15 +37,15 @@ }, "devDependencies": { "@types/react": "^18.2.14", - "@types/react-dom": "^18.2.6", + "@types/react-dom": "^18.2.7", "@vitejs/plugin-basic-ssl": "^1.0.1", "@vitejs/plugin-react": "^4.0.3", "eslint": "^8.44.0", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.3.5", + "eslint-plugin-react-refresh": "^0.4.3", "sass": "^1.63.6", - "vite": "^4.4.2" + "vite": "^4.4.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -82,35 +82,35 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.6.tgz", - "integrity": "sha512-29tfsWTq2Ftu7MXmimyC0C5FDZv5DYxOZkh3XD3+QW4V/BYuv/LyEsjj3c0hqedEaDt6DBfDvexMKU8YevdqFg==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz", + "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.22.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.8.tgz", - "integrity": "sha512-75+KxFB4CZqYRXjx4NlR4J7yGvKumBuZTmV4NV6v09dVXXkuYVYLT68N6HCzLvfJ+fWCxQsntNzKwwIXL4bHnw==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.9.tgz", + "integrity": "sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.7", - "@babel/helper-compilation-targets": "^7.22.6", - "@babel/helper-module-transforms": "^7.22.5", + "@babel/generator": "^7.22.9", + "@babel/helper-compilation-targets": "^7.22.9", + "@babel/helper-module-transforms": "^7.22.9", "@babel/helpers": "^7.22.6", "@babel/parser": "^7.22.7", "@babel/template": "^7.22.5", "@babel/traverse": "^7.22.8", "@babel/types": "^7.22.5", - "@nicolo-ribaudo/semver-v6": "^6.3.3", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2" + "json5": "^2.2.2", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -121,9 +121,9 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.7.tgz", - "integrity": "sha512-p+jPjMG+SI8yvIaxGgeW24u7q9+5+TGpZh8/CuB7RhBKd7RCy8FayNEFNNKrNK/eUcY/4ExQqLmyrvBXKsIcwQ==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz", + "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==", "dev": true, "dependencies": { "@babel/types": "^7.22.5", @@ -136,16 +136,16 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.6.tgz", - "integrity": "sha512-534sYEqWD9VfUm3IPn2SLcH4Q3P86XL+QvqdC7ZsFrzyyPF3T4XGiVghF6PTYNdWg6pXuoqXxNQAhbYeEInTzA==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz", + "integrity": "sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.22.6", + "@babel/compat-data": "^7.22.9", "@babel/helper-validator-option": "^7.22.5", - "@nicolo-ribaudo/semver-v6": "^6.3.3", "browserslist": "^4.21.9", - "lru-cache": "^5.1.1" + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -200,22 +200,22 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", - "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz", + "integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.5", "@babel/helper-module-imports": "^7.22.5", "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-plugin-utils": { @@ -519,9 +519,9 @@ "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" }, "node_modules/@esbuild/android-arm": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.11.tgz", - "integrity": "sha512-q4qlUf5ucwbUJZXF5tEQ8LF7y0Nk4P58hOsGk3ucY0oCwgQqAnqXVbUuahCddVHfrxmpyewRpiTHwVHIETYu7Q==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.12.tgz", + "integrity": "sha512-LIxaNIQfkFZbTLb4+cX7dozHlAbAshhFE5PKdro0l+FnCpx1GDJaQ2WMcqm+ToXKMt8p8Uojk/MFRuGyz3V5Sw==", "cpu": [ "arm" ], @@ -535,9 +535,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.11.tgz", - "integrity": "sha512-snieiq75Z1z5LJX9cduSAjUr7vEI1OdlzFPMw0HH5YI7qQHDd3qs+WZoMrWYDsfRJSq36lIA6mfZBkvL46KoIw==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.12.tgz", + "integrity": "sha512-BMAlczRqC/LUt2P97E4apTBbkvS9JTJnp2DKFbCwpZ8vBvXVbNdqmvzW/OsdtI/+mGr+apkkpqGM8WecLkPgrA==", "cpu": [ "arm64" ], @@ -551,9 +551,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.11.tgz", - "integrity": "sha512-iPuoxQEV34+hTF6FT7om+Qwziv1U519lEOvekXO9zaMMlT9+XneAhKL32DW3H7okrCOBQ44BMihE8dclbZtTuw==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.12.tgz", + "integrity": "sha512-zU5MyluNsykf5cOJ0LZZZjgAHbhPJ1cWfdH1ZXVMXxVMhEV0VZiZXQdwBBVvmvbF28EizeK7obG9fs+fpmS0eQ==", "cpu": [ "x64" ], @@ -567,9 +567,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.11.tgz", - "integrity": "sha512-Gm0QkI3k402OpfMKyQEEMG0RuW2LQsSmI6OeO4El2ojJMoF5NLYb3qMIjvbG/lbMeLOGiW6ooU8xqc+S0fgz2w==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.12.tgz", + "integrity": "sha512-zUZMep7YONnp6954QOOwEBwFX9svlKd3ov6PkxKd53LGTHsp/gy7vHaPGhhjBmEpqXEXShi6dddjIkmd+NgMsA==", "cpu": [ "arm64" ], @@ -583,9 +583,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.11.tgz", - "integrity": "sha512-N15Vzy0YNHu6cfyDOjiyfJlRJCB/ngKOAvoBf1qybG3eOq0SL2Lutzz9N7DYUbb7Q23XtHPn6lMDF6uWbGv9Fw==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.12.tgz", + "integrity": "sha512-ohqLPc7i67yunArPj1+/FeeJ7AgwAjHqKZ512ADk3WsE3FHU9l+m5aa7NdxXr0HmN1bjDlUslBjWNbFlD9y12Q==", "cpu": [ "x64" ], @@ -599,9 +599,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.11.tgz", - "integrity": "sha512-atEyuq6a3omEY5qAh5jIORWk8MzFnCpSTUruBgeyN9jZq1K/QI9uke0ATi3MHu4L8c59CnIi4+1jDKMuqmR71A==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.12.tgz", + "integrity": "sha512-GIIHtQXqgeOOqdG16a/A9N28GpkvjJnjYMhOnXVbn3EDJcoItdR58v/pGN31CHjyXDc8uCcRnFWmqaJt24AYJg==", "cpu": [ "arm64" ], @@ -615,9 +615,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.11.tgz", - "integrity": "sha512-XtuPrEfBj/YYYnAAB7KcorzzpGTvOr/dTtXPGesRfmflqhA4LMF0Gh/n5+a9JBzPuJ+CGk17CA++Hmr1F/gI0Q==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.12.tgz", + "integrity": "sha512-zK0b9a1/0wZY+6FdOS3BpZcPc1kcx2G5yxxfEJtEUzVxI6n/FrC2Phsxj/YblPuBchhBZ/1wwn7AyEBUyNSa6g==", "cpu": [ "x64" ], @@ -631,9 +631,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.11.tgz", - "integrity": "sha512-Idipz+Taso/toi2ETugShXjQ3S59b6m62KmLHkJlSq/cBejixmIydqrtM2XTvNCywFl3VC7SreSf6NV0i6sRyg==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.12.tgz", + "integrity": "sha512-y75OijvrBE/1XRrXq1jtrJfG26eHeMoqLJ2dwQNwviwTuTtHGCojsDO6BJNF8gU+3jTn1KzJEMETytwsFSvc+Q==", "cpu": [ "arm" ], @@ -647,9 +647,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.11.tgz", - "integrity": "sha512-c6Vh2WS9VFKxKZ2TvJdA7gdy0n6eSy+yunBvv4aqNCEhSWVor1TU43wNRp2YLO9Vng2G+W94aRz+ILDSwAiYog==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.12.tgz", + "integrity": "sha512-JKgG8Q/LL/9sw/iHHxQyVMoQYu3rU3+a5Z87DxC+wAu3engz+EmctIrV+FGOgI6gWG1z1+5nDDbXiRMGQZXqiw==", "cpu": [ "arm64" ], @@ -663,9 +663,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.11.tgz", - "integrity": "sha512-S3hkIF6KUqRh9n1Q0dSyYcWmcVa9Cg+mSoZEfFuzoYXXsk6196qndrM+ZiHNwpZKi3XOXpShZZ+9dfN5ykqjjw==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.12.tgz", + "integrity": "sha512-yoRIAqc0B4lDIAAEFEIu9ttTRFV84iuAl0KNCN6MhKLxNPfzwCBvEMgwco2f71GxmpBcTtn7KdErueZaM2rEvw==", "cpu": [ "ia32" ], @@ -679,9 +679,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.11.tgz", - "integrity": "sha512-MRESANOoObQINBA+RMZW+Z0TJWpibtE7cPFnahzyQHDCA9X9LOmGh68MVimZlM9J8n5Ia8lU773te6O3ILW8kw==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.12.tgz", + "integrity": "sha512-qYgt3dHPVvf/MgbIBpJ4Sup/yb9DAopZ3a2JgMpNKIHUpOdnJ2eHBo/aQdnd8dJ21X/+sS58wxHtA9lEazYtXQ==", "cpu": [ "loong64" ], @@ -695,9 +695,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.11.tgz", - "integrity": "sha512-qVyPIZrXNMOLYegtD1u8EBccCrBVshxMrn5MkuFc3mEVsw7CCQHaqZ4jm9hbn4gWY95XFnb7i4SsT3eflxZsUg==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.12.tgz", + "integrity": "sha512-wHphlMLK4ufNOONqukELfVIbnGQJrHJ/mxZMMrP2jYrPgCRZhOtf0kC4yAXBwnfmULimV1qt5UJJOw4Kh13Yfg==", "cpu": [ "mips64el" ], @@ -711,9 +711,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.11.tgz", - "integrity": "sha512-T3yd8vJXfPirZaUOoA9D2ZjxZX4Gr3QuC3GztBJA6PklLotc/7sXTOuuRkhE9W/5JvJP/K9b99ayPNAD+R+4qQ==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.12.tgz", + "integrity": "sha512-TeN//1Ft20ZZW41+zDSdOI/Os1bEq5dbvBvYkberB7PHABbRcsteeoNVZFlI0YLpGdlBqohEpjrn06kv8heCJg==", "cpu": [ "ppc64" ], @@ -727,9 +727,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.11.tgz", - "integrity": "sha512-evUoRPWiwuFk++snjH9e2cAjF5VVSTj+Dnf+rkO/Q20tRqv+644279TZlPK8nUGunjPAtQRCj1jQkDAvL6rm2w==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.12.tgz", + "integrity": "sha512-AgUebVS4DoAblBgiB2ACQ/8l4eGE5aWBb8ZXtkXHiET9mbj7GuWt3OnsIW/zX+XHJt2RYJZctbQ2S/mDjbp0UA==", "cpu": [ "riscv64" ], @@ -743,9 +743,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.11.tgz", - "integrity": "sha512-/SlRJ15XR6i93gRWquRxYCfhTeC5PdqEapKoLbX63PLCmAkXZHY2uQm2l9bN0oPHBsOw2IswRZctMYS0MijFcg==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.12.tgz", + "integrity": "sha512-dJ3Rb3Ei2u/ysSXd6pzleGtfDdc2MuzKt8qc6ls8vreP1G3B7HInX3i7gXS4BGeVd24pp0yqyS7bJ5NHaI9ing==", "cpu": [ "s390x" ], @@ -759,9 +759,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.11.tgz", - "integrity": "sha512-xcncej+wF16WEmIwPtCHi0qmx1FweBqgsRtEL1mSHLFR6/mb3GEZfLQnx+pUDfRDEM4DQF8dpXIW7eDOZl1IbA==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.12.tgz", + "integrity": "sha512-OrNJMGQbPaVyHHcDF8ybNSwu7TDOfX8NGpXCbetwOSP6txOJiWlgQnRymfC9ocR1S0Y5PW0Wb1mV6pUddqmvmQ==", "cpu": [ "x64" ], @@ -775,9 +775,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.11.tgz", - "integrity": "sha512-aSjMHj/F7BuS1CptSXNg6S3M4F3bLp5wfFPIJM+Km2NfIVfFKhdmfHF9frhiCLIGVzDziggqWll0B+9AUbud/Q==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.12.tgz", + "integrity": "sha512-55FzVCAiwE9FK8wWeCRuvjazNRJ1QqLCYGZVB6E8RuQuTeStSwotpSW4xoRGwp3a1wUsaVCdYcj5LGCASVJmMg==", "cpu": [ "x64" ], @@ -791,9 +791,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.11.tgz", - "integrity": "sha512-tNBq+6XIBZtht0xJGv7IBB5XaSyvYPCm1PxJ33zLQONdZoLVM0bgGqUrXnJyiEguD9LU4AHiu+GCXy/Hm9LsdQ==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.12.tgz", + "integrity": "sha512-qnluf8rfb6Y5Lw2tirfK2quZOBbVqmwxut7GPCIJsM8lc4AEUj9L8y0YPdLaPK0TECt4IdyBdBD/KRFKorlK3g==", "cpu": [ "x64" ], @@ -807,9 +807,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.11.tgz", - "integrity": "sha512-kxfbDOrH4dHuAAOhr7D7EqaYf+W45LsAOOhAet99EyuxxQmjbk8M9N4ezHcEiCYPaiW8Dj3K26Z2V17Gt6p3ng==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.12.tgz", + "integrity": "sha512-+RkKpVQR7bICjTOPUpkTBTaJ4TFqQBX5Ywyd/HSdDkQGn65VPkTsR/pL4AMvuMWy+wnXgIl4EY6q4mVpJal8Kg==", "cpu": [ "x64" ], @@ -823,9 +823,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.11.tgz", - "integrity": "sha512-Sh0dDRyk1Xi348idbal7lZyfSkjhJsdFeuC13zqdipsvMetlGiFQNdO+Yfp6f6B4FbyQm7qsk16yaZk25LChzg==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.12.tgz", + "integrity": "sha512-GNHuciv0mFM7ouzsU0+AwY+7eV4Mgo5WnbhfDCQGtpvOtD1vbOiRjPYG6dhmMoFyBjj+pNqQu2X+7DKn0KQ/Gw==", "cpu": [ "arm64" ], @@ -839,9 +839,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.11.tgz", - "integrity": "sha512-o9JUIKF1j0rqJTFbIoF4bXj6rvrTZYOrfRcGyL0Vm5uJ/j5CkBD/51tpdxe9lXEDouhRgdr/BYzUrDOvrWwJpg==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.12.tgz", + "integrity": "sha512-kR8cezhYipbbypGkaqCTWIeu4zID17gamC8YTPXYtcN3E5BhhtTnwKBn9I0PJur/T6UVwIEGYzkffNL0lFvxEw==", "cpu": [ "ia32" ], @@ -855,9 +855,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.11.tgz", - "integrity": "sha512-rQI4cjLHd2hGsM1LqgDI7oOCYbQ6IBOVsX9ejuRMSze0GqXUG2ekwiKkiBU1pRGSeCqFFHxTrcEydB2Hyoz9CA==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.12.tgz", + "integrity": "sha512-O0UYQVkvfM/jO8a4OwoV0mAKSJw+mjWTAd1MJd/1FCX6uiMdLmMRPK/w6e9OQ0ob2WGxzIm9va/KG0Ja4zIOgg==", "cpu": [ "x64" ], @@ -1413,15 +1413,6 @@ "typescript": ">=1" } }, - "node_modules/@nicolo-ribaudo/semver-v6": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz", - "integrity": "sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1458,9 +1449,9 @@ } }, "node_modules/@orama/orama": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@orama/orama/-/orama-1.0.9.tgz", - "integrity": "sha512-arQ2G/+Xjgpm3E+dqKLGyQkEkdQyL//R8BHN/T/x6bGIWVJh3+w5R0dSPR7mMt3XxjDj+OpWVV/i9jY+RMm5FA==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@orama/orama/-/orama-1.0.10.tgz", + "integrity": "sha512-BSFRkFJr1EepUloWISpBRDuYcTz0P9CO/+sp46nEP7NJrEi7nc5A0bdFf8zpA3KW5qBCwj2J/zuHJZdUME5Agg==", "engines": { "node": ">= 16.0.0" } @@ -1482,24 +1473,24 @@ } }, "node_modules/@types/hast": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz", - "integrity": "sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.5.tgz", + "integrity": "sha512-SvQi0L/lNpThgPoleH53cdjB3y9zpLlVjRbqB3rH8hx1jiRSBGAhyjV3H+URFjNVRqt2EdYNrbZE5IsGlNfpRg==", "dependencies": { - "@types/unist": "*" + "@types/unist": "^2" } }, "node_modules/@types/katex": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.0.tgz", - "integrity": "sha512-hz+S3nV6Mym5xPbT9fnO8dDhBFQguMYpY0Ipxv06JMi1ORgnEM4M1ymWDUhUNer3ElLmT583opRo4RzxKmh9jw==" + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.1.tgz", + "integrity": "sha512-cwglq2A63Yk082CQk0t8LIoDhZAVgJqkumLyk3grpg3K8sevaDW//Qsspmxj9Sf+97biqt79CfAlPrvizHlP0w==" }, "node_modules/@types/mdast": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.11.tgz", - "integrity": "sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==", + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", + "integrity": "sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==", "dependencies": { - "@types/unist": "*" + "@types/unist": "^2" } }, "node_modules/@types/ms": { @@ -1528,9 +1519,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.6", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.6.tgz", - "integrity": "sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A==", + "version": "18.2.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.7.tgz", + "integrity": "sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==", "dev": true, "dependencies": { "@types/react": "*" @@ -1550,9 +1541,9 @@ "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" }, "node_modules/@types/unist": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", - "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==" + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz", + "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, "node_modules/@vitejs/plugin-basic-ssl": { "version": "1.0.1", @@ -1946,9 +1937,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001514", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001514.tgz", - "integrity": "sha512-ENcIpYBmwAAOm/V2cXgM7rZUrKKaqisZl4ZAI520FIkqGXUxJjmaIssbRW5HVVR5tyV6ygTLIm15aU8LUmQSaQ==", + "version": "1.0.30001515", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz", + "integrity": "sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA==", "funding": [ { "type": "opencollective", @@ -2279,9 +2270,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.455", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.455.tgz", - "integrity": "sha512-8tgdX0Odl24LtmLwxotpJCVjIndN559AvaOtd67u+2mo+IDsgsTF580NB+uuDCqsHw8yFg53l5+imFV9Fw3cbA==" + "version": "1.4.459", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.459.tgz", + "integrity": "sha512-XXRS5NFv8nCrBL74Rm3qhJjA2VCsRFx0OjHKBMPI0otij56aun8UWiKTDABmd5/7GTR021pA4wivs+Ri6XCElg==" }, "node_modules/error-ex": { "version": "1.3.2", @@ -2292,9 +2283,9 @@ } }, "node_modules/es-abstract": { - "version": "1.21.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", - "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", + "version": "1.21.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.3.tgz", + "integrity": "sha512-ZU4miiY1j3sGPFLJ34VJXEqhpmL+HGByCinGHv4HC+Fxl2fI2Z4yR6tl0mORnDr6PA8eihWo4LmSWDbvhALckg==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", @@ -2303,7 +2294,7 @@ "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.0", + "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", "gopd": "^1.0.1", @@ -2323,14 +2314,15 @@ "object-inspect": "^1.12.3", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.0", "safe-regex-test": "^1.0.0", "string.prototype.trim": "^1.2.7", "string.prototype.trimend": "^1.0.6", "string.prototype.trimstart": "^1.0.6", + "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -2380,9 +2372,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.11", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.11.tgz", - "integrity": "sha512-i8u6mQF0JKJUlGR3OdFLKldJQMMs8OqM9Cc3UCi9XXziJ9WERM5bfkHaEAy0YAvPRMgqSW55W7xYn84XtEFTtA==", + "version": "0.18.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.12.tgz", + "integrity": "sha512-XuOVLDdtsDslXStStduT41op21Ytmf4/BDS46aa3xPJ7X5h2eMWBF1oAe3QjUH3bDksocNXgzGUZ7XHIBya6Tg==", "dev": true, "hasInstallScript": true, "bin": { @@ -2392,28 +2384,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.11", - "@esbuild/android-arm64": "0.18.11", - "@esbuild/android-x64": "0.18.11", - "@esbuild/darwin-arm64": "0.18.11", - "@esbuild/darwin-x64": "0.18.11", - "@esbuild/freebsd-arm64": "0.18.11", - "@esbuild/freebsd-x64": "0.18.11", - "@esbuild/linux-arm": "0.18.11", - "@esbuild/linux-arm64": "0.18.11", - "@esbuild/linux-ia32": "0.18.11", - "@esbuild/linux-loong64": "0.18.11", - "@esbuild/linux-mips64el": "0.18.11", - "@esbuild/linux-ppc64": "0.18.11", - "@esbuild/linux-riscv64": "0.18.11", - "@esbuild/linux-s390x": "0.18.11", - "@esbuild/linux-x64": "0.18.11", - "@esbuild/netbsd-x64": "0.18.11", - "@esbuild/openbsd-x64": "0.18.11", - "@esbuild/sunos-x64": "0.18.11", - "@esbuild/win32-arm64": "0.18.11", - "@esbuild/win32-ia32": "0.18.11", - "@esbuild/win32-x64": "0.18.11" + "@esbuild/android-arm": "0.18.12", + "@esbuild/android-arm64": "0.18.12", + "@esbuild/android-x64": "0.18.12", + "@esbuild/darwin-arm64": "0.18.12", + "@esbuild/darwin-x64": "0.18.12", + "@esbuild/freebsd-arm64": "0.18.12", + "@esbuild/freebsd-x64": "0.18.12", + "@esbuild/linux-arm": "0.18.12", + "@esbuild/linux-arm64": "0.18.12", + "@esbuild/linux-ia32": "0.18.12", + "@esbuild/linux-loong64": "0.18.12", + "@esbuild/linux-mips64el": "0.18.12", + "@esbuild/linux-ppc64": "0.18.12", + "@esbuild/linux-riscv64": "0.18.12", + "@esbuild/linux-s390x": "0.18.12", + "@esbuild/linux-x64": "0.18.12", + "@esbuild/netbsd-x64": "0.18.12", + "@esbuild/openbsd-x64": "0.18.12", + "@esbuild/sunos-x64": "0.18.12", + "@esbuild/win32-arm64": "0.18.12", + "@esbuild/win32-ia32": "0.18.12", + "@esbuild/win32-x64": "0.18.12" } }, "node_modules/escalade": { @@ -2530,9 +2522,9 @@ } }, "node_modules/eslint-plugin-react-refresh": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.3.5.tgz", - "integrity": "sha512-61qNIsc7fo9Pp/mju0J83kzvLm0Bsayu7OQSLEoJxLDCBjIIyb87bkzufoOvdDxLkSlMfkF7UxomC4+eztUBSA==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.3.tgz", + "integrity": "sha512-Hh0wv8bUNY877+sI0BlCUlsS0TYYQqvzEwJsJJPM2WF4RnTStSnSR3zdJYa2nPOJgg3UghXi54lVyMSmpCalzA==", "dev": true, "peerDependencies": { "eslint": ">=7" @@ -3264,9 +3256,9 @@ } }, "node_modules/immutable": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz", - "integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.1.tgz", + "integrity": "sha512-lj9cnmB/kVS0QHsJnYKD1uo3o39nrbKxszjnqS9Fr6NB7bZzW45U6WSGBPKXDL/CvDKqDNPA4r3DoDQ8GTxo2A==", "dev": true }, "node_modules/import-fresh": { @@ -5686,9 +5678,9 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -5967,6 +5959,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typed-array-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", @@ -6219,13 +6230,13 @@ } }, "node_modules/vite": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.2.tgz", - "integrity": "sha512-zUcsJN+UvdSyHhYa277UHhiJ3iq4hUBwHavOpsNUGsTgjBeoBlK8eDt+iT09pBq0h9/knhG/SPrZiM7cGmg7NA==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.3.tgz", + "integrity": "sha512-IMnXQXXWgLi5brBQx/4WzDxdzW0X3pjO4nqFJAuNvwKtxzAmPzFE1wszW3VDpAGQJm3RZkm/brzRdyGsnwgJIA==", "dev": true, "dependencies": { "esbuild": "^0.18.10", - "postcss": "^8.4.24", + "postcss": "^8.4.25", "rollup": "^3.25.2" }, "bin": { diff --git a/src/conversation-ui/package.json b/src/conversation-ui/package.json index c19cfd60..db277cd8 100644 --- a/src/conversation-ui/package.json +++ b/src/conversation-ui/package.json @@ -13,7 +13,7 @@ "dependencies": { "@microsoft/applicationinsights-react-js": "^3.4.3", "@microsoft/applicationinsights-web": "^3.0.2", - "@orama/orama": "^1.0.9", + "@orama/orama": "^1.0.10", "autoprefixer": "^10.4.14", "axios": "^1.4.0", "axios-retry": "^3.5.1", @@ -40,14 +40,14 @@ }, "devDependencies": { "@types/react": "^18.2.14", - "@types/react-dom": "^18.2.6", + "@types/react-dom": "^18.2.7", "@vitejs/plugin-basic-ssl": "^1.0.1", "@vitejs/plugin-react": "^4.0.3", "eslint": "^8.44.0", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.3.5", + "eslint-plugin-react-refresh": "^0.4.3", "sass": "^1.63.6", - "vite": "^4.4.2" + "vite": "^4.4.3" } } diff --git a/src/conversation-ui/src/Button.jsx b/src/conversation-ui/src/Button.jsx index 9d8d0d93..68cbf451 100644 --- a/src/conversation-ui/src/Button.jsx +++ b/src/conversation-ui/src/Button.jsx @@ -2,9 +2,27 @@ import "./button.scss"; import Loader from "./Loader"; import PropTypes from "prop-types"; -function Button({ disabled, onClick, text, loading, emoji, type, active, className, large }) { +function Button({ + active, + className, + disabled, + emoji, + large, + loading, + onClick, + text, + type, +}) { return ( - @@ -12,15 +30,15 @@ function Button({ disabled, onClick, text, loading, emoji, type, active, classNa } Button.propTypes = { + emoji: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, active: PropTypes.bool, className: PropTypes.string, disabled: PropTypes.bool, - emoji: PropTypes.string.isRequired, large: PropTypes.bool, loading: PropTypes.bool, onClick: PropTypes.func, - text: PropTypes.string.isRequired, type: PropTypes.string, -} +}; export default Button; diff --git a/src/conversation-ui/src/Conversation.jsx b/src/conversation-ui/src/Conversation.jsx index e5c6d4e2..6a0c9815 100644 --- a/src/conversation-ui/src/Conversation.jsx +++ b/src/conversation-ui/src/Conversation.jsx @@ -261,48 +261,54 @@ function Conversation() { return (
-
- {conversation.messages.length == 0 && ( -
- 🔒 Private GPT -
-
-

💡

-
-
-

Examples

-

Generating content that is tailored to specific audiences or personas.

-

Help on technical language and jargon in specific industries (such as finance or healthcare).

-
-
-

⚡️

-
-
-

Capabilities

-

Analyzing large amounts of qualitative data (such as news articles or earnings calls) to inform investment decisions.

-

Generating summaries of court cases or contracts to save time on manual review.

-
-
-

⚠️

-
-
-

Limitations

-

Ensuring that generated content adheres to applicable regulations in a given industry or region.

-

Mitigating any risks associated with automated content creation (such as reputational harm or inadvertent bias).

-
+
+ {conversationId &&

{conversation.title ? conversation.title : "New chat"}

} +
+ {conversation.messages.length == 0 && ( +
+
+ 🔒 + Welcome to Private GPT +
+
+
+

💡

+
+
+

Examples

+

Generating content that is tailored to specific audiences or personas.

+

Help on technical language and jargon in specific industries (such as finance or healthcare).

+
+
+

⚡️

+
+
+

Capabilities

+

Analyzing large amounts of qualitative data (such as news articles or earnings calls) to inform investment decisions.

+

Generating summaries of court cases or contracts to save time on manual review.

+
+
+

⚠️

+
+
+

Limitations

+

Ensuring that generated content adheres to applicable regulations in a given industry or region.

+

Mitigating any risks associated with automated content creation (such as reputational harm or inadvertent bias).

- {!auth.userData && ( -
- )} + {!auth.userData && ( +
+ )} + {conversation.messages.length > 0 &&
{conversation.messages.map((message) => ( ))} -
+
} {auth.userData && (
-
- -

🔒 Private GPT

- +
+ {/* This button is never disabled and this is on purpose. + + It is the central point of the application and should always be clickable. UX interviews with users showed that they were confused when the button was disabled. They thought that the application was broken. */} + {auth.userData && <> +
- {auth.userData &&
- {/* This button is never disabled and this is on purpose. - - It is the central point of the application and should always be clickable. UX interviews with users showed that they were confused when the button was disabled. They thought that the application was broken. */} -
}
{auth.userData && ( { - e.preventDefault(); + const clipboardHandler = () => { // Copy to clipboard navigator.clipboard.writeText(content); // Animation feedback @@ -41,45 +45,44 @@ function Message({ }; return ( -
+
setDisplayActions(!displayActions)} + onMouseEnter={() => setDisplayActions(true)} + onMouseLeave={() => setDisplayActions(false)} + >
setDisplaySub(!displaySub)} - onDoubleClick={clipboardHandler} + ref={httpContent} > - { } - ) : ( - - {children} - - ); + if (!inline) { + const match = /language-(\w+)/.exec(className || ""); + const language = match ? match[1] : null; + return ( + + ); + } }, }} /> @@ -90,6 +93,16 @@ function Message({ {moment(date).fromNow()} )} + {displayActions && ( + +
); } diff --git a/src/conversation-ui/src/conversation.scss b/src/conversation-ui/src/conversation.scss index c4c57896..12942a2e 100644 --- a/src/conversation-ui/src/conversation.scss +++ b/src/conversation-ui/src/conversation.scss @@ -10,6 +10,23 @@ margin-bottom: var(--conversation-padding-v); } + .conversation__header { + background-color: var(--background); + padding: var(--conversation-padding-v) 0; + + // Stays at the top + position: sticky; + top: 0; + z-index: 900; + + > h2 { + // Disable line wrapping + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + .conversation__messages { display: flex; flex-direction: column; @@ -19,22 +36,32 @@ > *:not(:last-child) { margin-bottom: var(--conversation-padding-v); } + } + + .conversation__empty { + align-items: center; + display: flex; + flex-direction: column; + flex-grow: 1; + justify-content: center; + + > *:not(:last-child) { + margin-bottom: calc(var(--conversation-padding-v) * 2); + } - .conversation__messages__empty { + .conversation__empty__header { align-items: center; display: flex; flex-direction: column; + text-align: center; - // Center the content vertically and horizontally - align-self: center; - margin: auto 0; - - > *:not(:last-child) { - margin-bottom: 1em; + > span { + font-size: 800%; + line-height: 1; } } - .conversation__messages__empty__doc { + .conversation__empty__doc { background-color: var(--background-muted); border-radius: var(--radius); display: grid; @@ -62,6 +89,7 @@ .conversation__input { background-color: var(--background); + padding-bottom: var(--conversation-padding-v); // Stays at the bottom bottom: 0; diff --git a/src/conversation-ui/src/conversations.scss b/src/conversation-ui/src/conversations.scss index 962a90ab..eab8189c 100644 --- a/src/conversation-ui/src/conversations.scss +++ b/src/conversation-ui/src/conversations.scss @@ -10,8 +10,8 @@ > h2, > h3 { // Disable line wrapping - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; } } diff --git a/src/conversation-ui/src/header.scss b/src/conversation-ui/src/header.scss index b9bc2dd8..a8265470 100644 --- a/src/conversation-ui/src/header.scss +++ b/src/conversation-ui/src/header.scss @@ -14,7 +14,13 @@ html { flex-direction: row; > * { - flex-grow: 1; + &.header__actions__toggle { + flex-grow: 1; + } + + &:not(.header__actions__toggle) { + flex-grow: 2; + } } // Add spaces around actions @@ -67,7 +73,7 @@ html { } // Hide the toggle button - .header__top__toggle { + .header__actions__toggle { display: none; } @@ -98,19 +104,6 @@ html { padding: calc(var(--header-padding-v) / 2) var(--header-padding-h); } - .header__top { - align-items: center; - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-between; - - // Add spaces around title and toggle button - > *:not(:last-child) { - margin-right: var(--header-padding-h); - } - } - .header__actions { display: flex; } diff --git a/src/conversation-ui/src/main.scss b/src/conversation-ui/src/main.scss index 5ebe5fd0..42f3bdd1 100644 --- a/src/conversation-ui/src/main.scss +++ b/src/conversation-ui/src/main.scss @@ -17,6 +17,7 @@ html { --header-width: min(26em, 38vw); --line-height-small: 1.5; --line-height: 1.7; + --message-padding-v: 1em; --radius: 1.5em; --search-padding-v: 1em; @@ -24,6 +25,7 @@ html { @media (max-width: $media--small) { --conversation-padding-h: 1em; --header-padding-h: 1em; + --message-padding-h: 1em; --search-padding-h: 1em; } @@ -31,6 +33,7 @@ html { @media (min-width: $media--small) { --conversation-padding-h: 2em; --header-padding-h: 2em; + --message-padding-h: 2em; --search-padding-h: 2em; } @@ -116,15 +119,15 @@ body { } h1 { - font-size: 1.5rem; + font-size: calc(var(--font-size) * 1.75); } h2 { - font-size: 1.25rem; + font-size: calc(var(--font-size) * 1.5); } h3 { - font-size: 1.125rem; + font-size: calc(var(--font-size) * 1.25); } strong, @@ -133,7 +136,7 @@ body { } big { - font-size: 3rem; + font-size: calc(var(--font-size) * 2.25); } small { @@ -207,9 +210,9 @@ body { &, > * { // Disable line wrapping - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; } } @@ -286,9 +289,9 @@ body { opacity: 0.75; // Disable line wrapping - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; } } diff --git a/src/conversation-ui/src/message.scss b/src/conversation-ui/src/message.scss index c5f6da9c..dcddd48e 100644 --- a/src/conversation-ui/src/message.scss +++ b/src/conversation-ui/src/message.scss @@ -2,6 +2,7 @@ display: flex; flex-direction: column; max-width: 70%; + position: relative; &.message--assistant { &, @@ -24,18 +25,34 @@ } } + .message__actions { + background-color: var(--background); + border-radius: var(--radius); + display: flex; + flex-direction: row; + outline: 1px solid var(--border); + padding: calc(var(--message-padding-v) / 2) calc(var(--message-padding-h) / 2); + position: absolute; + right: calc(var(--message-padding-h) * -1); + top: calc(var(--message-padding-v) * -2); + + > *:not(:last-child) { + margin-right: calc(var(--message-padding-h) / 4); + } + } + .message__content { background-color: var(--background-muted); border-radius: var(--radius); box-sizing: border-box; overflow-x: auto; - padding: 1em; + padding: var(--message-padding-v) var(--message-padding-h); // Fix overflow with non wrapping content like code and tables max-width: 100%; > *:not(:last-child) { - margin-bottom: 1em; + margin-bottom: var(--message-padding-v); } table { @@ -51,7 +68,7 @@ } .message__sub { - margin: 0 1em; + margin: 0 var(--message-padding-h); opacity: 0.75; } }