diff --git a/package.json b/package.json index 386bbf3f..88fb106c 100644 --- a/package.json +++ b/package.json @@ -292,7 +292,7 @@ }, "dependencies": { "@headlessui/react": "1.7.4", - "@memori.ai/memori-api-client": "^5.0.1", + "@memori.ai/memori-api-client": "^5.1.0", "@react-three/drei": "8.20.2", "@react-three/fiber": "7.0.25", "classnames": "2.3.2", diff --git a/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx b/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx index 18891ed1..487c80d4 100644 --- a/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx +++ b/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx @@ -1,7 +1,6 @@ import { useEffect, useState } from 'react'; import Tooltip from '../ui/Tooltip'; import Warning from '../icons/Warning'; -import { Tenant } from '@memori.ai/memori-api-client/dist/types'; import { useTranslation } from 'react-i18next'; type Status = @@ -13,7 +12,7 @@ type Status = export interface Props { forceStatus?: Status; - provider?: Tenant['defaultCompletionProvider']; + provider?: string; } const initProviderStatus = ( diff --git a/src/components/StartPanel/StartPanel.test.tsx b/src/components/StartPanel/StartPanel.test.tsx index b197a66b..0ea4bf3c 100644 --- a/src/components/StartPanel/StartPanel.test.tsx +++ b/src/components/StartPanel/StartPanel.test.tsx @@ -229,7 +229,12 @@ it('renders StartPanel with completion provider down unchanged', () => { = ({ diff --git a/src/helpers/error.ts b/src/helpers/error.ts index 2f40204b..e547af9d 100644 --- a/src/helpers/error.ts +++ b/src/helpers/error.ts @@ -63,6 +63,7 @@ const errors = { MEMORI_NO_PASSWORD_WHEN_PUBLIC: -214, MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS: -215, MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS: -216, + MEMORI_INVALID_COMPLETION_CONFIG: -217, MEMORI_TRANSFER_MISSING_DESTINATION_USER: -231, MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID: -232, @@ -195,6 +196,22 @@ const errors = { OUTCOME_NO_DCM_CONFIGURED: -2071, OUTCOME_USER_BADGES_DISABLED: -2072, + + COMPLETION_CONFIG_MISSING_NAME: -2401, + COMPLETION_CONFIG_MISSING_PROVIDER: -2402, + COMPLETION_CONFIG_MISSING_ENDPOINT: -2403, + COMPLETION_CONFIG_MISSING_API_KEY: -2404, + COMPLETION_CONFIG_MISSING_MODEL: -2405, + COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED: -2406, + COMPLETION_CONFIG_INVALID_PURPOSE: -2411, + COMPLETION_CONFIG_INVALID_ENDPOINT: -2412, + COMPLETION_CONFIG_INCONSISTENT_ENDPOINT: -2413, + COMPLETION_CONFIG_INVALID_PROVIDER: -2414, + COMPLETION_CONFIG_NOT_FOUND: -2421, + COMPLETION_CONFIG_NOT_ACCESSIBLE: -2422, + COMPLETION_CONFIG_NAME_RESERVED: -2441, + COMPLETION_CONFIG_NAME_ALREADY_EXISTS: -2442, + COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED: -2443, }; export const BACKEND_ERRORS = new Map( diff --git a/src/locales/en.json b/src/locales/en.json index 55ba7c16..8fc6a626 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -280,22 +280,23 @@ "SESSION_IS_NOT_ADMINISTRATIVE": "Non-administrative session", "SESSION_EXPIRED": "Session expired", - "MEMORI_MISSING_CONFIGURATION": "Memori: missing configuration", - "MEMORI_CONFIGURATION_NOT_FOUND": "Memories: configuration not found", - "MEMORI_INVALID_PRIVACY_TYPE": "Memories: invalid privacy type", - "MEMORI_MISSING_PASSWORD": "Memori: missing password", - "MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS": "Memories: total number of invalid recovery tokens", - "MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS": "Memories: minimum number of invalid recovery tokens", - "MEMORI_INVALID_VOICE_TYPE": "Memories: invalid voice type", - "MEMORI_MISSING_NAME": "Memories: missing name", - "MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS": "Memories: missing password or recovery token", - "MEMORI_INVALID_ID": "Memories: invalid ID", - "MEMORI_NAME_ALREADY_USED": "Memory name already in use", - "MEMORI_INVALID_PIN": "Memories: Invalid PIN", - "MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION": "Memories: TAG and PIN change require separate operations", - "MEMORI_NO_PASSWORD_WHEN_PUBLIC": "Memories: no password required when public", + "MEMORI_MISSING_CONFIGURATION": "Twin: missing configuration", + "MEMORI_CONFIGURATION_NOT_FOUND": "Twin: configuration not found", + "MEMORI_INVALID_PRIVACY_TYPE": "Twin: invalid privacy type", + "MEMORI_MISSING_PASSWORD": "Twin: missing password", + "MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS": "Twin: total number of invalid recovery tokens", + "MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS": "Twin: minimum number of invalid recovery tokens", + "MEMORI_INVALID_VOICE_TYPE": "Twin: invalid voice type", + "MEMORI_MISSING_NAME": "Twin: missing name", + "MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS": "Twin: missing password or recovery token", + "MEMORI_INVALID_ID": "Twin: invalid ID", + "MEMORI_NAME_ALREADY_USED": "Twin name already in use", + "MEMORI_INVALID_PIN": "Twin: Invalid PIN", + "MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION": "Twin: TAG and PIN change require separate operations", + "MEMORI_NO_PASSWORD_WHEN_PUBLIC": "Twin: no password required when public", "MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS": "Deep Thought requires completions to be enabled", "MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS": "The expert group requires completions to be enabled", + "MEMORI_INVALID_COMPLETION_CONFIG": "Twin: invalid completions configuration", "MEMORI_TRANSFER_MISSING_DESTINATION_USER": "Transfer: missing destination user", "MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID": "Transfer: invalid destination user ID", @@ -426,7 +427,23 @@ "BADGE_NOT_FOUND": "Badge not found", - "OUTCOME_NO_DCM_CONFIGURED": "Result: no DCM configured", - "OUTCOME_USER_BADGES_DISABLED": "Result: user badges disabled" + "OUTCOME_NO_DCM_CONFIGURED": "Outcome: no DCM configured", + "OUTCOME_USER_BADGES_DISABLED": "Outcome: user badges disabled", + + "COMPLETION_CONFIG_MISSING_NAME": "Completions configuration: missing name", + "COMPLETION_CONFIG_MISSING_PROVIDER": "Completions configuration: missing provider", + "COMPLETION_CONFIG_MISSING_ENDPOINT": "Completions configuration: missing endpoint", + "COMPLETION_CONFIG_MISSING_API_KEY": "Completions configuration: missing API key", + "COMPLETION_CONFIG_MISSING_MODEL": "Completions configuration: missing model", + "COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED": "Completions configuration: at least one completions type must be specified", + "COMPLETION_CONFIG_INVALID_PURPOSE": "Completions configuration: invalid completions type", + "COMPLETION_CONFIG_INVALID_ENDPOINT": "Completions configuration: invalid endpoint", + "COMPLETION_CONFIG_INCONSISTENT_ENDPOINT": "Completions configuration: inconsistent endpoint", + "COMPLETION_CONFIG_INVALID_PROVIDER": "Completions configuration: invalid provider", + "COMPLETION_CONFIG_NOT_FOUND": "Completions configuration: not found", + "COMPLETION_CONFIG_NOT_ACCESSIBLE": "Completions configuration: not accessible", + "COMPLETION_CONFIG_NAME_RESERVED": "Completions configuration: name reserved", + "COMPLETION_CONFIG_NAME_ALREADY_EXISTS": "Completions configuration: name already exists", + "COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED": "Completions configuration: visibility change not allowed" } } diff --git a/src/locales/it.json b/src/locales/it.json index 8f038900..4433651a 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -295,6 +295,7 @@ "MEMORI_NO_PASSWORD_WHEN_PUBLIC": "Memori: password non richiesta su Memori pubblico", "MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS": "Pensiero Profondo richiede l'abilitazione delle completions", "MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS": "Il gruppo di esperti richiede l'abilitazione delle completions", + "MEMORI_INVALID_COMPLETION_CONFIG": "Memori: configurazione completions non valida", "MEMORI_TRANSFER_MISSING_DESTINATION_USER": "Trasferimento: utente di destinazione mancante", "MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID": "Trasferimento: ID utente di destinazione non valido", @@ -425,7 +426,23 @@ "BADGE_NOT_FOUND": "Badge non trovato", - "OUTCOME_NO_DCM_CONFIGURED": "Esito: nessun DCM configurato", - "OUTCOME_USER_BADGES_DISABLED": "Esito: badge utente disabilitati" + "OUTCOME_NO_DCM_CONFIGURED": "Outcome: nessun DCM configurato", + "OUTCOME_USER_BADGES_DISABLED": "Outcome: badge utente disabilitati", + + "COMPLETION_CONFIG_MISSING_NAME": "Configurazione completions: nome mancante", + "COMPLETION_CONFIG_MISSING_PROVIDER": "Configurazione completions: provider mancante", + "COMPLETION_CONFIG_MISSING_ENDPOINT": "Configurazione completions: endpoint mancante", + "COMPLETION_CONFIG_MISSING_API_KEY": "Configurazione completions: API key mancante", + "COMPLETION_CONFIG_MISSING_MODEL": "Configurazione completions: modello mancante", + "COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED": "Configurazione completions: almeno un tipo di completions deve essere specificato", + "COMPLETION_CONFIG_INVALID_PURPOSE": "Configurazione completions: tipo di completions non valido", + "COMPLETION_CONFIG_INVALID_ENDPOINT": "Configurazione completions: endpoint non valido", + "COMPLETION_CONFIG_INCONSISTENT_ENDPOINT": "Configurazione completions: endpoint incoerente", + "COMPLETION_CONFIG_INVALID_PROVIDER": "Configurazione completions: provider non valido", + "COMPLETION_CONFIG_NOT_FOUND": "Configurazione completions: non trovata", + "COMPLETION_CONFIG_NOT_ACCESSIBLE": "Configurazione completions: non accessibile", + "COMPLETION_CONFIG_NAME_RESERVED": "Configurazione completions: nome riservato", + "COMPLETION_CONFIG_NAME_ALREADY_EXISTS": "Configurazione completions: nome già esistente", + "COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED": "Configurazione completions: cambiamento visibilità non consentito" } } diff --git a/yarn.lock b/yarn.lock index 1ec4c7a6..68e77810 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4084,14 +4084,14 @@ __metadata: languageName: node linkType: hard -"@memori.ai/memori-api-client@npm:^5.0.1": - version: 5.0.1 - resolution: "@memori.ai/memori-api-client@npm:5.0.1" +"@memori.ai/memori-api-client@npm:^5.1.0": + version: 5.1.0 + resolution: "@memori.ai/memori-api-client@npm:5.1.0" dependencies: cross-fetch: ^3.1.5 peerDependencies: typescript: ">=4.8" - checksum: cef43b546930e6db3bc8374476f0574fea1df00a47d3b05c680bb26e167f7e7e4a02d7efb0bb160f2ac03a43b0a3ea9d605031c774491026095bb8be09413871 + checksum: cc1e24d369efaa0f4d4347357222e95ec4a3fec170ce5b9208606774770b95f97e404298554749cbed27bed9a5727667a68a44adce512f2ff8a678e7e30747b1 languageName: node linkType: hard @@ -4106,7 +4106,7 @@ __metadata: "@commitlint/cli": 17.3.0 "@commitlint/config-conventional": 17.3.0 "@headlessui/react": 1.7.4 - "@memori.ai/memori-api-client": ^5.0.1 + "@memori.ai/memori-api-client": ^5.1.0 "@react-three/drei": 8.20.2 "@react-three/fiber": 7.0.25 "@release-it/conventional-changelog": 5.1.1