From d0a42d63ec1a924e1e55dcc0863fe50d5912faf1 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Wed, 17 Sep 2025 16:23:35 +0400 Subject: [PATCH] UBERF-13587: Huly secretary integration (#9861) Signed-off-by: Alexey Zinoviev --- common/config/rush/pnpm-lock.yaml | 143 ++++++ desktop/package.json | 3 + desktop/src/ui/platform.ts | 3 + dev/prod/package.json | 3 + dev/prod/src/platform.ts | 4 + models/ai-assistant/.eslintrc.js | 7 + models/ai-assistant/.npmignore | 4 + models/ai-assistant/config/rig.json | 5 + models/ai-assistant/jest.config.js | 7 + models/ai-assistant/package.json | 46 ++ models/ai-assistant/src/index.ts | 43 ++ models/ai-assistant/src/plugin.ts | 27 ++ models/ai-assistant/tsconfig.json | 12 + models/all/package.json | 3 +- models/all/src/index.ts | 13 + packages/account-client/src/client.ts | 10 + packages/core/src/classes.ts | 3 +- packages/core/src/utils.ts | 2 +- plugins/ai-assistant-assets/.eslintrc.js | 7 + plugins/ai-assistant-assets/config/rig.json | 5 + plugins/ai-assistant-assets/jest.config.js | 7 + plugins/ai-assistant-assets/lang/cs.json | 13 + plugins/ai-assistant-assets/lang/de.json | 13 + plugins/ai-assistant-assets/lang/en.json | 13 + plugins/ai-assistant-assets/lang/es.json | 13 + plugins/ai-assistant-assets/lang/fr.json | 13 + plugins/ai-assistant-assets/lang/it.json | 13 + plugins/ai-assistant-assets/lang/ja.json | 13 + plugins/ai-assistant-assets/lang/pt.json | 13 + plugins/ai-assistant-assets/lang/ru.json | 13 + plugins/ai-assistant-assets/lang/zh.json | 13 + plugins/ai-assistant-assets/package.json | 39 ++ .../src/__tests__/lang.test.ts | 6 + plugins/ai-assistant-assets/src/index.ts | 14 + plugins/ai-assistant-assets/tsconfig.json | 13 + plugins/ai-assistant-resources/.eslintrc.js | 4 + plugins/ai-assistant-resources/.prettierrc | 22 + .../ai-assistant-resources/config/rig.json | 5 + plugins/ai-assistant-resources/jest.config.js | 5 + plugins/ai-assistant-resources/package.json | 59 +++ .../ai-assistant-resources/postcss.config.js | 5 + .../src/components/Configure.svelte | 99 ++++ .../src/components/icons/HulyAssistant.svelte | 436 ++++++++++++++++++ plugins/ai-assistant-resources/src/index.ts | 47 ++ plugins/ai-assistant-resources/src/plugin.ts | 26 ++ plugins/ai-assistant-resources/src/utils.ts | 39 ++ .../ai-assistant-resources/svelte.config.js | 5 + plugins/ai-assistant-resources/tsconfig.json | 11 + plugins/ai-assistant/.eslintrc.js | 7 + plugins/ai-assistant/.npmignore | 4 + plugins/ai-assistant/config/rig.json | 4 + plugins/ai-assistant/jest.config.js | 7 + plugins/ai-assistant/package.json | 45 ++ plugins/ai-assistant/src/index.ts | 44 ++ plugins/ai-assistant/tsconfig.json | 12 + rush.json | 20 + .../src/collections/postgres/migrations.ts | 12 +- server/account/src/operations.ts | 13 + server/account/src/serviceOperations.ts | 5 +- 59 files changed, 1490 insertions(+), 5 deletions(-) create mode 100644 models/ai-assistant/.eslintrc.js create mode 100644 models/ai-assistant/.npmignore create mode 100644 models/ai-assistant/config/rig.json create mode 100644 models/ai-assistant/jest.config.js create mode 100644 models/ai-assistant/package.json create mode 100644 models/ai-assistant/src/index.ts create mode 100644 models/ai-assistant/src/plugin.ts create mode 100644 models/ai-assistant/tsconfig.json create mode 100644 plugins/ai-assistant-assets/.eslintrc.js create mode 100644 plugins/ai-assistant-assets/config/rig.json create mode 100644 plugins/ai-assistant-assets/jest.config.js create mode 100644 plugins/ai-assistant-assets/lang/cs.json create mode 100644 plugins/ai-assistant-assets/lang/de.json create mode 100644 plugins/ai-assistant-assets/lang/en.json create mode 100644 plugins/ai-assistant-assets/lang/es.json create mode 100644 plugins/ai-assistant-assets/lang/fr.json create mode 100644 plugins/ai-assistant-assets/lang/it.json create mode 100644 plugins/ai-assistant-assets/lang/ja.json create mode 100644 plugins/ai-assistant-assets/lang/pt.json create mode 100644 plugins/ai-assistant-assets/lang/ru.json create mode 100644 plugins/ai-assistant-assets/lang/zh.json create mode 100644 plugins/ai-assistant-assets/package.json create mode 100644 plugins/ai-assistant-assets/src/__tests__/lang.test.ts create mode 100644 plugins/ai-assistant-assets/src/index.ts create mode 100644 plugins/ai-assistant-assets/tsconfig.json create mode 100644 plugins/ai-assistant-resources/.eslintrc.js create mode 100644 plugins/ai-assistant-resources/.prettierrc create mode 100644 plugins/ai-assistant-resources/config/rig.json create mode 100644 plugins/ai-assistant-resources/jest.config.js create mode 100644 plugins/ai-assistant-resources/package.json create mode 100644 plugins/ai-assistant-resources/postcss.config.js create mode 100644 plugins/ai-assistant-resources/src/components/Configure.svelte create mode 100644 plugins/ai-assistant-resources/src/components/icons/HulyAssistant.svelte create mode 100644 plugins/ai-assistant-resources/src/index.ts create mode 100644 plugins/ai-assistant-resources/src/plugin.ts create mode 100644 plugins/ai-assistant-resources/src/utils.ts create mode 100644 plugins/ai-assistant-resources/svelte.config.js create mode 100644 plugins/ai-assistant-resources/tsconfig.json create mode 100644 plugins/ai-assistant/.eslintrc.js create mode 100644 plugins/ai-assistant/.npmignore create mode 100644 plugins/ai-assistant/config/rig.json create mode 100644 plugins/ai-assistant/jest.config.js create mode 100644 plugins/ai-assistant/package.json create mode 100644 plugins/ai-assistant/src/index.ts create mode 100644 plugins/ai-assistant/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5b5c5e6123..f96875bece 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -133,6 +133,15 @@ importers: '@rush-temp/activity-resources': specifier: file:./projects/activity-resources.tgz version: file:projects/activity-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@22.15.29)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(postcss-load-config@4.0.2(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + '@rush-temp/ai-assistant': + specifier: file:./projects/ai-assistant.tgz + version: file:projects/ai-assistant.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@22.15.29)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + '@rush-temp/ai-assistant-assets': + specifier: file:./projects/ai-assistant-assets.tgz + version: file:projects/ai-assistant-assets.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + '@rush-temp/ai-assistant-resources': + specifier: file:./projects/ai-assistant-resources.tgz + version: file:projects/ai-assistant-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@22.15.29)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(postcss-load-config@4.0.2(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) '@rush-temp/ai-bot': specifier: file:./projects/ai-bot.tgz version: file:projects/ai-bot.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@22.15.29)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) @@ -559,6 +568,9 @@ importers: '@rush-temp/model-activity': specifier: file:./projects/model-activity.tgz version: file:projects/model-activity.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + '@rush-temp/model-ai-assistant': + specifier: file:./projects/model-ai-assistant.tgz + version: file:projects/model-ai-assistant.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) '@rush-temp/model-ai-bot': specifier: file:./projects/model-ai-bot.tgz version: file:projects/model-ai-bot.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) @@ -4379,6 +4391,18 @@ packages: resolution: {integrity: sha512-6ZhlPiyVd+TRx0o0qdULlvoalPU0FlX8HS5NAkSgjhkdKMHuvDNDNpIhPjTZ4DZrXPpNBZZyXSiarXAKD4G8Qw==, tarball: file:projects/activity.tgz} version: 0.0.0 + '@rush-temp/ai-assistant-assets@file:projects/ai-assistant-assets.tgz': + resolution: {integrity: sha512-xMeqPY9WNH6VNmUx0H+MYd+6a7X9/p+ETR+1kFr/NN5TAALQqG4+7POW8a1z/YQESI0aEt1MXqzbpCXdN6MRSg==, tarball: file:projects/ai-assistant-assets.tgz} + version: 0.0.0 + + '@rush-temp/ai-assistant-resources@file:projects/ai-assistant-resources.tgz': + resolution: {integrity: sha512-aDNUOd/pe/cLE9TuPx2N0b8qPbYLWui5iCYXUs32W7WAYbrXJDOZj2tYJlZR0kl0j4ydoHeJzn3x6uE1WteM7w==, tarball: file:projects/ai-assistant-resources.tgz} + version: 0.0.0 + + '@rush-temp/ai-assistant@file:projects/ai-assistant.tgz': + resolution: {integrity: sha512-zV980Axii2zE/l6RXcue6zoj267Mh2GIg8G+4Ih/+vzBtPP2gjojU7kg2jvxUlTAp/ovYd2PALmutDTUShw60A==, tarball: file:projects/ai-assistant.tgz} + version: 0.0.0 + '@rush-temp/ai-bot-resources@file:projects/ai-bot-resources.tgz': resolution: {integrity: sha512-Ne8uj1rTTgpgWHs/SZ9wwZQacLv4LLKx0n7qVcgBoR2rl5kRcjChiUlEA2+NLMTXfwqoUBJORNQSRnpLZkUp8g==, tarball: file:projects/ai-bot-resources.tgz} version: 0.0.0 @@ -4943,6 +4967,10 @@ packages: resolution: {integrity: sha512-ZNulrcnrHfqoQt8d2s3Ef83wxd1DeX+r9HDWpOclei6CuuebWnNGVSEIXmJ9fr9DQj6yJVbkj481qLgI7e3K5g==, tarball: file:projects/model-activity.tgz} version: 0.0.0 + '@rush-temp/model-ai-assistant@file:projects/model-ai-assistant.tgz': + resolution: {integrity: sha512-H9B1vpwWN8SAb94yJbs6Kh+klMeefGcf4blEAHefllxpeSY4lRIUsKabraQ9/oKLTnWX6IA5CcYb4c/3+qgLzQ==, tarball: file:projects/model-ai-assistant.tgz} + version: 0.0.0 + '@rush-temp/model-ai-bot@file:projects/model-ai-bot.tgz': resolution: {integrity: sha512-24xp2zEvYzmo/W4PDZRdhTmoNANfgqa7M3wOsvbEwpeXZhhEaWfE+yZEF3ZRlqdgIUK+EpmugoM3KScCYT6+XQ==, tarball: file:projects/model-ai-bot.tgz} version: 0.0.0 @@ -17557,6 +17585,96 @@ snapshots: - supports-color - ts-node + '@rush-temp/ai-assistant-assets@file:projects/ai-assistant-assets.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3))': + dependencies: + '@types/jest': 29.5.12 + '@types/node': 22.15.29 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.8.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.8.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + prettier: 3.2.5 + ts-jest: 29.1.2(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(jest@29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - ts-node + + '@rush-temp/ai-assistant-resources@file:projects/ai-assistant-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@22.15.29)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(postcss-load-config@4.0.2(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3))': + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.8.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.8.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.20)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + jest: 29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.20) + sass: 1.71.1 + svelte: 4.2.20 + svelte-check: 3.6.9(@babel/core@7.23.9)(postcss-load-config@4.0.2(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(postcss@8.5.3)(sass@1.71.1)(svelte@4.2.20) + svelte-eslint-parser: 0.33.1(svelte@4.2.20) + svelte-loader: 3.2.0(svelte@4.2.20) + svelte-preprocess: 5.1.3(@babel/core@7.23.9)(postcss-load-config@4.0.2(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(postcss@8.5.3)(sass@1.71.1)(svelte@4.2.20)(typescript@5.8.3) + ts-jest: 29.1.2(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(jest@29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - coffeescript + - esbuild + - less + - node-notifier + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + - ts-node + + '@rush-temp/ai-assistant@file:projects/ai-assistant.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@22.15.29)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3))': + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.8.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.8.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + prettier: 3.2.5 + ts-jest: 29.1.2(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(jest@29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - ts-node + '@rush-temp/ai-bot-resources@file:projects/ai-bot-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@22.15.29)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(postcss-load-config@4.0.2(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(postcss@8.5.3)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3))': dependencies: '@types/jest': 29.5.12 @@ -21918,6 +22036,31 @@ snapshots: - supports-color - ts-node + '@rush-temp/model-ai-assistant@file:projects/model-ai-assistant.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3))': + dependencies: + '@types/jest': 29.5.12 + '@types/node': 22.15.29 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.8.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.8.3))(eslint@8.56.0)(typescript@5.8.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.8.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)) + prettier: 3.2.5 + ts-jest: 29.1.2(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(jest@29.7.0(@types/node@22.15.29)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3)))(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - ts-node + '@rush-temp/model-ai-bot@file:projects/model-ai-bot.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.25.9)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@22.15.29)(typescript@5.8.3))': dependencies: '@types/jest': 29.5.12 diff --git a/desktop/package.json b/desktop/package.json index 00aee948fa..95648c6da7 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -258,6 +258,9 @@ "@hcengineering/huly-mail": "^0.6.0", "@hcengineering/huly-mail-assets": "^0.6.0", "@hcengineering/huly-mail-resources": "^0.6.0", + "@hcengineering/ai-assistant": "^0.6.0", + "@hcengineering/ai-assistant-assets": "^0.6.0", + "@hcengineering/ai-assistant-resources": "^0.6.0", "electron-squirrel-startup": "~1.0.0", "dotenv": "~16.0.0", "electron-context-menu": "^4.0.4", diff --git a/desktop/src/ui/platform.ts b/desktop/src/ui/platform.ts index 1e0e4f0c48..36570461ff 100644 --- a/desktop/src/ui/platform.ts +++ b/desktop/src/ui/platform.ts @@ -68,6 +68,7 @@ import { achievementId } from '@hcengineering/achievement' import communication, { communicationId } from '@hcengineering/communication' import { emojiId } from '@hcengineering/emoji' import { hulyMailId } from '@hcengineering/huly-mail' +import { aiAssistantId } from '@hcengineering/ai-assistant' import billingPlugin, { billingId } from '@hcengineering/billing' import '@hcengineering/activity-assets' @@ -125,6 +126,7 @@ import '@hcengineering/media-assets' import '@hcengineering/communication-assets' import '@hcengineering/billing-assets' import '@hcengineering/huly-mail-assets' +import '@hcengineering/ai-assistant-assets' import analyticsCollector, { analyticsCollectorId } from '@hcengineering/analytics-collector' import { coreId } from '@hcengineering/core' @@ -246,6 +248,7 @@ function configureI18n (): void { addStringsLoader(emojiId, async (lang: string) => await import(`@hcengineering/emoji-assets/lang/${lang}.json`)) addStringsLoader(billingId, async (lang: string) => await import(`@hcengineering/billing-assets/lang/${lang}.json`)) addStringsLoader(hulyMailId, async (lang: string) => await import(`@hcengineering/huly-mail-assets/lang/${lang}.json`)) + addStringsLoader(aiAssistantId, async (lang: string) => await import(`@hcengineering/ai-assistant-assets/lang/${lang}.json`)) } export class PlatformBranding { diff --git a/dev/prod/package.json b/dev/prod/package.json index e64a90c620..094e4fd85d 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -279,6 +279,9 @@ "@hcengineering/huly-mail": "^0.6.0", "@hcengineering/huly-mail-assets": "^0.6.0", "@hcengineering/huly-mail-resources": "^0.6.0", + "@hcengineering/ai-assistant": "^0.6.0", + "@hcengineering/ai-assistant-assets": "^0.6.0", + "@hcengineering/ai-assistant-resources": "^0.6.0", "@sentry/svelte": "^9.22.0", "posthog-js": "^1.246.0", "readable-stream": "^4.7.0", diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 9cebe18e4a..2e8490e115 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -77,6 +77,7 @@ import communication, { communicationId } from '@hcengineering/communication' import {emojiId} from '@hcengineering/emoji' import billingPlugin, {billingId} from '@hcengineering/billing' import { hulyMailId } from '@hcengineering/huly-mail' +import { aiAssistantId } from '@hcengineering/ai-assistant' import '@hcengineering/activity-assets' import '@hcengineering/analytics-collector-assets' @@ -133,6 +134,7 @@ import '@hcengineering/communication-assets' import '@hcengineering/emoji-assets' import '@hcengineering/billing-assets' import '@hcengineering/huly-mail-assets' +import '@hcengineering/ai-assistant-assets' import { coreId } from '@hcengineering/core' import presentation, { @@ -375,6 +377,7 @@ function configureI18n(): void { addStringsLoader(emojiId, async (lang: string) => await import(`@hcengineering/emoji-assets/lang/${lang}.json`)) addStringsLoader(billingId, async (lang: string) => await import(`@hcengineering/billing-assets/lang/${lang}.json`)) addStringsLoader(hulyMailId, async (lang: string) => await import(`@hcengineering/huly-mail-assets/lang/${lang}.json`)) + addStringsLoader(aiAssistantId, async (lang: string) => await import(`@hcengineering/ai-assistant-assets/lang/${lang}.json`)) } export async function configurePlatform() { @@ -586,6 +589,7 @@ export async function configurePlatform() { addLocation(emojiId, () => import(/* webpackChunkName: "achievement" */ '@hcengineering/emoji-resources')) addLocation(billingId, () => import(/* webpackChunkName: "achievement" */ '@hcengineering/billing-resources')) addLocation(hulyMailId, () => import(/* webpackChunkName: "achievement" */ '@hcengineering/huly-mail-resources')) + addLocation(aiAssistantId, () => import(/* webpackChunkName: "achievement" */ '@hcengineering/ai-assistant-resources')) setMetadata(client.metadata.FilterModel, 'ui') setMetadata(client.metadata.ExtraPlugins, ['preference' as Plugin]) diff --git a/models/ai-assistant/.eslintrc.js b/models/ai-assistant/.eslintrc.js new file mode 100644 index 0000000000..c1cf82cba0 --- /dev/null +++ b/models/ai-assistant/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/model/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/ai-assistant/.npmignore b/models/ai-assistant/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/ai-assistant/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/ai-assistant/config/rig.json b/models/ai-assistant/config/rig.json new file mode 100644 index 0000000000..2f6be36605 --- /dev/null +++ b/models/ai-assistant/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "model" +} diff --git a/models/ai-assistant/jest.config.js b/models/ai-assistant/jest.config.js new file mode 100644 index 0000000000..2cfd408b67 --- /dev/null +++ b/models/ai-assistant/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], + roots: ["./src"], + coverageReporters: ["text-summary", "html"] +} diff --git a/models/ai-assistant/package.json b/models/ai-assistant/package.json new file mode 100644 index 0000000000..20ea89f86f --- /dev/null +++ b/models/ai-assistant/package.json @@ -0,0 +1,46 @@ +{ + "name": "@hcengineering/model-ai-assistant", + "version": "0.6.0", + "main": "lib/index.js", + "svelte": "src/index.ts", + "types": "types/index.d.ts", + "author": "Copyright © Hardcore Engineering Inc.", + "template": "@hcengineering/model-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "build:watch": "compile", + "format": "format src", + "_phase:build": "compile transpile src", + "_phase:format": "format src", + "_phase:validate": "compile validate", + "_phase:test": "jest --passWithNoTests --silent --forceExit", + "test": "jest --passWithNoTests --silent --forceExit" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-n": "^15.4.0", + "eslint": "^8.54.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "prettier": "^3.1.0", + "typescript": "^5.8.3", + "@types/node": "^22.15.29", + "jest": "^29.7.0", + "@types/jest": "^29.5.5", + "ts-jest": "^29.1.1" + }, + "dependencies": { + "@hcengineering/model": "^0.6.11", + "@hcengineering/core": "^0.6.32", + "@hcengineering/platform": "^0.6.11", + "@hcengineering/model-core": "^0.6.0", + "@hcengineering/ai-assistant": "^0.6.0", + "@hcengineering/ai-assistant-resources": "^0.6.0", + "@hcengineering/setting": "^0.6.17", + "@hcengineering/ui": "^0.6.15" + } +} diff --git a/models/ai-assistant/src/index.ts b/models/ai-assistant/src/index.ts new file mode 100644 index 0000000000..d4d8b64101 --- /dev/null +++ b/models/ai-assistant/src/index.ts @@ -0,0 +1,43 @@ +// +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { aiAssistantIntegrationKind } from '@hcengineering/ai-assistant' +import { type Builder } from '@hcengineering/model' +import core from '@hcengineering/model-core' +import setting from '@hcengineering/setting' + +import aiAssistant from './plugin' + +export { aiAssistantId } from '@hcengineering/ai-assistant' +export { default } from './plugin' + +export function createModel (builder: Builder): void { + builder.createDoc( + setting.class.IntegrationType, + core.space.Model, + { + label: aiAssistant.string.IntegrationLabel, + description: aiAssistant.string.IntegrationDescription, + icon: aiAssistant.component.IconHulyAssistant, + allowMultiple: false, + createComponent: aiAssistant.component.Connect, + onDisconnect: aiAssistant.handler.DisconnectHandler, + onDisconnectAll: aiAssistant.handler.DisconnectAllHandler, + reconnectComponent: aiAssistant.component.Connect, + kind: aiAssistantIntegrationKind + }, + aiAssistant.integrationType.AiAssistant + ) +} diff --git a/models/ai-assistant/src/plugin.ts b/models/ai-assistant/src/plugin.ts new file mode 100644 index 0000000000..707cb68f10 --- /dev/null +++ b/models/ai-assistant/src/plugin.ts @@ -0,0 +1,27 @@ +// +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { type IntlString, mergeIds } from '@hcengineering/platform' +import { aiAssistantId } from '@hcengineering/ai-assistant' +import aiAssistant from '@hcengineering/ai-assistant-resources/src/plugin' + +export default mergeIds(aiAssistantId, aiAssistant, { + string: { + ConfigLabel: '' as IntlString, + ConfigDescription: '' as IntlString, + IntegrationLabel: '' as IntlString, + IntegrationDescription: '' as IntlString + } +}) diff --git a/models/ai-assistant/tsconfig.json b/models/ai-assistant/tsconfig.json new file mode 100644 index 0000000000..367a8578c9 --- /dev/null +++ b/models/ai-assistant/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/model/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types", + "tsBuildInfoFile": ".build/build.tsbuildinfo" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib", "dist", "types", "bundle"] +} \ No newline at end of file diff --git a/models/all/package.json b/models/all/package.json index a689d7bfce..1cfa9299fa 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -132,6 +132,7 @@ "@hcengineering/model-communication": "^0.6.0", "@hcengineering/model-emoji": "^0.6.0", "@hcengineering/model-billing": "^0.6.0", - "@hcengineering/model-huly-mail": "^0.6.0" + "@hcengineering/model-huly-mail": "^0.6.0", + "@hcengineering/model-ai-assistant": "^0.6.0" } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index b42a39f427..5b82ed2d90 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -108,6 +108,7 @@ import testManagement, { } from '@hcengineering/model-test-management' import { mailId, createModel as mailModel } from '@hcengineering/model-mail' import { hulyMailId, createModel as hulyMailModel } from '@hcengineering/model-huly-mail' +import aiAssistant, { aiAssistantId, createModel as aiAssistantModel } from '@hcengineering/model-ai-assistant' import { serverDocumentsId, @@ -481,6 +482,18 @@ export default function buildModel (): Builder { [mailModel, mailId], [billingModel, billingId, { beta: false, hidden: true, enabled: true }], [hulyMailModel, hulyMailId], + [ + aiAssistantModel, + aiAssistantId, + { + label: aiAssistant.string.ConfigLabel, + description: aiAssistant.string.ConfigDescription, + hidden: true, + enabled: false, + beta: true, + classFilter: defaultFilter + } + ], [serverCoreModel, serverCoreId], [serverAttachmentModel, serverAttachmentId], diff --git a/packages/account-client/src/client.ts b/packages/account-client/src/client.ts index 268dd4dc52..b6f8de7c7c 100644 --- a/packages/account-client/src/client.ts +++ b/packages/account-client/src/client.ts @@ -223,6 +223,7 @@ export interface AccountClient { mergeSpecifiedPersons: (primaryPerson: PersonUuid, secondaryPerson: PersonUuid) => Promise mergeSpecifiedAccounts: (primaryAccount: AccountUuid, secondaryAccount: AccountUuid) => Promise addEmailSocialId: (email: string) => Promise + addHulyAssistantSocialId: () => Promise setCookie: () => Promise deleteCookie: () => Promise @@ -1098,6 +1099,15 @@ class AccountClientImpl implements AccountClient { return await this.rpc(request) } + async addHulyAssistantSocialId (): Promise { + const request = { + method: 'addHulyAssistantSocialId' as const, + params: {} + } + + return await this.rpc(request) + } + async setCookie (): Promise { const url = concatLink(this.url, '/cookie') const response = await fetch(url, { ...this.request, method: 'PUT' }) diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index c0e9f25bd4..17673915a0 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -869,7 +869,8 @@ export enum SocialIdType { PHONE = 'phone', OIDC = 'oidc', HULY = 'huly', - TELEGRAM = 'telegram' + TELEGRAM = 'telegram', + HULY_ASSISTANT = 'huly-assistant' } export interface SocialId { diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index cfb63fbf33..3314a14f12 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -977,7 +977,7 @@ export function pickPrimarySocialId (socialIds: SocialId[]): SocialId { return hulySocialIds[0] ?? activeSocialIds[0] } -export const loginSocialTypes = [SocialIdType.EMAIL, SocialIdType.GOOGLE, SocialIdType.GITHUB] +export const loginSocialTypes = [SocialIdType.EMAIL, SocialIdType.GOOGLE, SocialIdType.GITHUB, SocialIdType.OIDC] export function notEmpty (id: T | undefined | null): id is T { return id !== undefined && id !== null && id !== '' diff --git a/plugins/ai-assistant-assets/.eslintrc.js b/plugins/ai-assistant-assets/.eslintrc.js new file mode 100644 index 0000000000..e73094bc7e --- /dev/null +++ b/plugins/ai-assistant-assets/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/assets/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/plugins/ai-assistant-assets/config/rig.json b/plugins/ai-assistant-assets/config/rig.json new file mode 100644 index 0000000000..b75800b9b7 --- /dev/null +++ b/plugins/ai-assistant-assets/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "assets" +} diff --git a/plugins/ai-assistant-assets/jest.config.js b/plugins/ai-assistant-assets/jest.config.js new file mode 100644 index 0000000000..2cfd408b67 --- /dev/null +++ b/plugins/ai-assistant-assets/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], + roots: ["./src"], + coverageReporters: ["text-summary", "html"] +} diff --git a/plugins/ai-assistant-assets/lang/cs.json b/plugins/ai-assistant-assets/lang/cs.json new file mode 100644 index 0000000000..f844d714c2 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/cs.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "AI Asistent", + "IntegrationDescription": "Váš AI asistent poháněný umělou inteligencí, který pomáhá organizovat, automatizovat a zjednodušit váš denní pracovní tok napříč platformou", + "ConfigLabel": "AI Asistent", + "ConfigDescription": "Osobní asistent poháněný umělou inteligencí", + "Connect": "Připojit", + "Cancel": "Zrušit", + "Status": "Stav", + "FailedToConnect": "Služba AI Asistenta není dostupná", + "Configure": "Konfigurovat AI Asistenta" + } +} \ No newline at end of file diff --git a/plugins/ai-assistant-assets/lang/de.json b/plugins/ai-assistant-assets/lang/de.json new file mode 100644 index 0000000000..3cb57e19a2 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/de.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "KI-Assistent", + "IntegrationDescription": "Ihr KI-unterstützter persönlicher Assistent, der hilft, Ihren täglichen Arbeitsablauf auf der Plattform zu organisieren, automatisieren und zu optimieren", + "ConfigLabel": "KI-Assistent", + "ConfigDescription": "KI-unterstützter persönlicher Assistent", + "Connect": "Verbinden", + "Cancel": "Abbrechen", + "Status": "Status", + "FailedToConnect": "KI-Assistent-Service ist nicht verfügbar", + "Configure": "KI-Assistent konfigurieren" + } +} \ No newline at end of file diff --git a/plugins/ai-assistant-assets/lang/en.json b/plugins/ai-assistant-assets/lang/en.json new file mode 100644 index 0000000000..979cfe2826 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/en.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "AI Assistant", + "IntegrationDescription": "Your AI-powered personal assistant that helps organize, automate, and streamline your daily workflow across the platform", + "ConfigLabel": "AI Assistant", + "ConfigDescription": "AI-powered personal assistant", + "Connect": "Connect", + "Cancel": "Cancel", + "Status": "Status", + "FailedToConnect": "AI Assistant service is not available", + "Configure": "Configure AI Assistant" + } +} \ No newline at end of file diff --git a/plugins/ai-assistant-assets/lang/es.json b/plugins/ai-assistant-assets/lang/es.json new file mode 100644 index 0000000000..a682808c46 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/es.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "Asistente de IA", + "IntegrationDescription": "Tu asistente personal impulsado por IA que ayuda a organizar, automatizar y optimizar tu flujo de trabajo diario en toda la plataforma", + "ConfigLabel": "Asistente de IA", + "ConfigDescription": "Asistente personal impulsado por IA", + "Connect": "Conectar", + "Cancel": "Cancelar", + "Status": "Estado", + "FailedToConnect": "El servicio del Asistente de IA no está disponible", + "Configure": "Configurar Asistente de IA" + } +} \ No newline at end of file diff --git a/plugins/ai-assistant-assets/lang/fr.json b/plugins/ai-assistant-assets/lang/fr.json new file mode 100644 index 0000000000..d181c54861 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/fr.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "Assistant IA", + "IntegrationDescription": "Votre assistant personnel alimenté par IA qui aide à organiser, automatiser et rationaliser votre flux de travail quotidien sur la plateforme", + "ConfigLabel": "Assistant IA", + "ConfigDescription": "Assistant personnel alimenté par IA", + "Connect": "Se connecter", + "Cancel": "Annuler", + "Status": "Statut", + "FailedToConnect": "Le service Assistant IA n'est pas disponible", + "Configure": "Configurer l'Assistant IA" + } +} \ No newline at end of file diff --git a/plugins/ai-assistant-assets/lang/it.json b/plugins/ai-assistant-assets/lang/it.json new file mode 100644 index 0000000000..afc7c5a53d --- /dev/null +++ b/plugins/ai-assistant-assets/lang/it.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "Assistente AI", + "IntegrationDescription": "Il tuo assistente personale basato sull'AI che aiuta a organizzare, automatizzare e snellire il tuo flusso di lavoro quotidiano sulla piattaforma", + "ConfigLabel": "Assistente AI", + "ConfigDescription": "Assistente personale basato sull'AI", + "Connect": "Connetti", + "Cancel": "Annulla", + "Status": "Stato", + "FailedToConnect": "Il servizio Assistente AI non è disponibile", + "Configure": "Configura Assistente AI" + } +} diff --git a/plugins/ai-assistant-assets/lang/ja.json b/plugins/ai-assistant-assets/lang/ja.json new file mode 100644 index 0000000000..a50add10c7 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/ja.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "AIアシスタント", + "IntegrationDescription": "プラットフォーム全体で日常のワークフローを整理、自動化、効率化するAI搭載のパーソナルアシスタント", + "ConfigLabel": "AIアシスタント", + "ConfigDescription": "AI搭載のパーソナルアシスタント", + "Connect": "接続", + "Cancel": "キャンセル", + "Status": "ステータス", + "FailedToConnect": "AIアシスタントサービスは利用できません", + "Configure": "AIアシスタント設定" + } +} diff --git a/plugins/ai-assistant-assets/lang/pt.json b/plugins/ai-assistant-assets/lang/pt.json new file mode 100644 index 0000000000..010171b807 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/pt.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "Assistente de IA", + "IntegrationDescription": "Seu assistente pessoal alimentado por IA que ajuda a organizar, automatizar e simplificar seu fluxo de trabalho diário na plataforma", + "ConfigLabel": "Assistente de IA", + "ConfigDescription": "Assistente pessoal alimentado por IA", + "Connect": "Conectar", + "Cancel": "Cancelar", + "Status": "Status", + "FailedToConnect": "O serviço do Assistente de IA não está disponível", + "Configure": "Configurar Assistente de IA" + } +} \ No newline at end of file diff --git a/plugins/ai-assistant-assets/lang/ru.json b/plugins/ai-assistant-assets/lang/ru.json new file mode 100644 index 0000000000..c89f40ff08 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/ru.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "ИИ Помощник", + "IntegrationDescription": "Ваш персональный помощник на основе ИИ, который помогает организовать, автоматизировать и оптимизировать ваш ежедневный рабочий процесс на платформе", + "ConfigLabel": "ИИ Помощник", + "ConfigDescription": "Персональный помощник на основе ИИ", + "Connect": "Подключить", + "Cancel": "Отмена", + "Status": "Статус", + "FailedToConnect": "Служба ИИ Помощника недоступна", + "Configure": "Настроить ИИ Помощника" + } +} \ No newline at end of file diff --git a/plugins/ai-assistant-assets/lang/zh.json b/plugins/ai-assistant-assets/lang/zh.json new file mode 100644 index 0000000000..1b238a3f24 --- /dev/null +++ b/plugins/ai-assistant-assets/lang/zh.json @@ -0,0 +1,13 @@ +{ + "string": { + "IntegrationLabel": "AI 助手", + "IntegrationDescription": "您的 AI 驱动的个人助手,帮助组织、自动化和简化您在平台上的日常工作流程", + "ConfigLabel": "AI 助手", + "ConfigDescription": "AI 驱动的个人助手", + "Connect": "连接", + "Cancel": "取消", + "Status": "状态", + "FailedToConnect": "AI 助手服务不可用", + "Configure": "配置 AI 助手" + } +} diff --git a/plugins/ai-assistant-assets/package.json b/plugins/ai-assistant-assets/package.json new file mode 100644 index 0000000000..0fa4911128 --- /dev/null +++ b/plugins/ai-assistant-assets/package.json @@ -0,0 +1,39 @@ +{ + "name": "@hcengineering/ai-assistant-assets", + "version": "0.6.0", + "main": "src/index.ts", + "author": "Copyright © Hardcore Engineering Inc.", + "template": "@hcengineering/assets-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "test": "jest --passWithNoTests --silent", + "format": "format src", + "build:watch": "compile", + "build:docs": "", + "_phase:build": "compile transpile src", + "_phase:test": "jest --passWithNoTests --silent", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.4.0", + "eslint-plugin-promise": "^6.1.1", + "eslint": "^8.54.0", + "prettier": "^3.1.0", + "typescript": "^5.8.3", + "@types/node": "^22.15.29", + "jest": "^29.7.0", + "ts-jest": "^29.1.1", + "@types/jest": "^29.5.5" + }, + "dependencies": { + "@hcengineering/platform": "^0.6.11", + "@hcengineering/ai-assistant": "^0.6.0" + } +} diff --git a/plugins/ai-assistant-assets/src/__tests__/lang.test.ts b/plugins/ai-assistant-assets/src/__tests__/lang.test.ts new file mode 100644 index 0000000000..cf96c6dcf7 --- /dev/null +++ b/plugins/ai-assistant-assets/src/__tests__/lang.test.ts @@ -0,0 +1,6 @@ +import { makeLocalesTest } from '@hcengineering/platform' + +it( + 'Locales are equale', + makeLocalesTest((lang) => import(`../../lang/${lang}.json`)) +) diff --git a/plugins/ai-assistant-assets/src/index.ts b/plugins/ai-assistant-assets/src/index.ts new file mode 100644 index 0000000000..0c56ed7ff6 --- /dev/null +++ b/plugins/ai-assistant-assets/src/index.ts @@ -0,0 +1,14 @@ +// +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// diff --git a/plugins/ai-assistant-assets/tsconfig.json b/plugins/ai-assistant-assets/tsconfig.json new file mode 100644 index 0000000000..2857a41ad2 --- /dev/null +++ b/plugins/ai-assistant-assets/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/assets/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types", + "types": ["node", "jest"], + "tsBuildInfoFile": ".build/build.tsbuildinfo" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib", "dist", "types", "bundle"] +} \ No newline at end of file diff --git a/plugins/ai-assistant-resources/.eslintrc.js b/plugins/ai-assistant-resources/.eslintrc.js new file mode 100644 index 0000000000..bb8fd7450d --- /dev/null +++ b/plugins/ai-assistant-resources/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/ui/eslint.config.json'], + parserOptions: { tsconfigRootDir: __dirname } +} diff --git a/plugins/ai-assistant-resources/.prettierrc b/plugins/ai-assistant-resources/.prettierrc new file mode 100644 index 0000000000..792942803a --- /dev/null +++ b/plugins/ai-assistant-resources/.prettierrc @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "trailingComma": "none", + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "printWidth": 120, + "useTabs": false, + "bracketSpacing": true, + "proseWrap": "preserve", + "plugins": [ + "prettier-plugin-svelte" + ], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} \ No newline at end of file diff --git a/plugins/ai-assistant-resources/config/rig.json b/plugins/ai-assistant-resources/config/rig.json new file mode 100644 index 0000000000..bcad6f7c33 --- /dev/null +++ b/plugins/ai-assistant-resources/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "ui" +} diff --git a/plugins/ai-assistant-resources/jest.config.js b/plugins/ai-assistant-resources/jest.config.js new file mode 100644 index 0000000000..3656e284d3 --- /dev/null +++ b/plugins/ai-assistant-resources/jest.config.js @@ -0,0 +1,5 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'] +} diff --git a/plugins/ai-assistant-resources/package.json b/plugins/ai-assistant-resources/package.json new file mode 100644 index 0000000000..f71faae516 --- /dev/null +++ b/plugins/ai-assistant-resources/package.json @@ -0,0 +1,59 @@ +{ + "name": "@hcengineering/ai-assistant-resources", + "version": "0.6.0", + "main": "src/index.ts", + "author": "Copyright © Hardcore Engineering Inc.", + "license": "EPL-2.0", + "scripts": { + "build": "compile ui", + "build:docs": "api-extractor run --local", + "format": "format src", + "svelte-check": "do-svelte-check", + "_phase:svelte-check": "do-svelte-check", + "build:watch": "compile ui", + "_phase:build": "compile ui", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "svelte-loader": "^3.2.0", + "sass": "^1.53.0", + "svelte-preprocess": "^5.1.3", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-n": "^15.4.0", + "eslint": "^8.54.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "eslint-plugin-svelte": "^2.35.1", + "prettier-plugin-svelte": "^3.2.2", + "prettier": "^3.1.0", + "svelte-check": "^3.6.9", + "typescript": "^5.8.3", + "jest": "^29.7.0", + "ts-jest": "^29.1.1", + "@types/jest": "^29.5.5", + "svelte-eslint-parser": "^0.33.1" + }, + "dependencies": { + "@hcengineering/platform": "^0.6.11", + "svelte": "^4.2.20", + "@hcengineering/ai-assistant": "^0.6.0", + "@hcengineering/ui": "^0.6.15", + "@hcengineering/presentation": "^0.6.3", + "@hcengineering/card": "^0.6.0", + "@hcengineering/card-resources": "^0.6.0", + "@hcengineering/contact": "^0.6.24", + "@hcengineering/setting": "^0.6.17", + "@hcengineering/login": "^0.6.12", + "@hcengineering/core": "^0.6.32", + "@hcengineering/panel": "^0.6.23", + "@hcengineering/analytics": "^0.6.0", + "@hcengineering/integration-client": "^0.6.0", + "@hcengineering/account-client": "^0.6.0", + "@hcengineering/setting-resources": "^0.6.0", + "@hcengineering/view-resources": "^0.6.0" + } +} diff --git a/plugins/ai-assistant-resources/postcss.config.js b/plugins/ai-assistant-resources/postcss.config.js new file mode 100644 index 0000000000..88752c6cb0 --- /dev/null +++ b/plugins/ai-assistant-resources/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: [ + require('autoprefixer') + ] +} diff --git a/plugins/ai-assistant-resources/src/components/Configure.svelte b/plugins/ai-assistant-resources/src/components/Configure.svelte new file mode 100644 index 0000000000..db3075465c --- /dev/null +++ b/plugins/ai-assistant-resources/src/components/Configure.svelte @@ -0,0 +1,99 @@ + + + + { + dispatch('close') + }} + canSave={false} + fullSize + okLabel={presentation.string.Ok} + on:close={() => dispatch('close')} + on:changeContent +> + +
+ + + +
+
+
+ {#if isLoading} +
+
+ +
+
+ {/if} +
+
diff --git a/plugins/ai-assistant-resources/src/components/icons/HulyAssistant.svelte b/plugins/ai-assistant-resources/src/components/icons/HulyAssistant.svelte new file mode 100644 index 0000000000..12fa244573 --- /dev/null +++ b/plugins/ai-assistant-resources/src/components/icons/HulyAssistant.svelte @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/ai-assistant-resources/src/index.ts b/plugins/ai-assistant-resources/src/index.ts new file mode 100644 index 0000000000..1fd3346e67 --- /dev/null +++ b/plugins/ai-assistant-resources/src/index.ts @@ -0,0 +1,47 @@ +// +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { type Resources } from '@hcengineering/platform' +import type { Integration } from '@hcengineering/account-client' + +import Configure from './components/Configure.svelte' +import IconHulyAssistant from './components/icons/HulyAssistant.svelte' +import { getIntegrationClient } from './utils' + +export default async (): Promise => ({ + component: { + Connect: Configure, + Configure, + IconHulyAssistant + }, + handler: { + DisconnectHandler: async (integration: Integration): Promise => { + if (integration == null) { + console.error('Missing required argument integration in DisconnectHandler') + return + } + const integrationClient = await getIntegrationClient() + await integrationClient.removeIntegration(integration.socialId, integration.workspaceUuid) + }, + DisconnectAllHandler: async (integration: Integration): Promise => { + if (integration == null) { + console.error('Missing required argument integration in DisconnectHandler') + return + } + const integrationClient = await getIntegrationClient() + await integrationClient.removeConnection(integration) + } + } +}) diff --git a/plugins/ai-assistant-resources/src/plugin.ts b/plugins/ai-assistant-resources/src/plugin.ts new file mode 100644 index 0000000000..b6b36d8fed --- /dev/null +++ b/plugins/ai-assistant-resources/src/plugin.ts @@ -0,0 +1,26 @@ +// +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { type IntlString, mergeIds } from '@hcengineering/platform' + +import aiAssistant, { aiAssistantId } from '@hcengineering/ai-assistant' + +export default mergeIds(aiAssistantId, aiAssistant, { + string: { + Connect: '' as IntlString, + FailedToConnect: '' as IntlString, + Configure: '' as IntlString + } +}) diff --git a/plugins/ai-assistant-resources/src/utils.ts b/plugins/ai-assistant-resources/src/utils.ts new file mode 100644 index 0000000000..55b5ad86ea --- /dev/null +++ b/plugins/ai-assistant-resources/src/utils.ts @@ -0,0 +1,39 @@ +// +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +import { getMetadata } from '@hcengineering/platform' +import presentation from '@hcengineering/presentation' +import login from '@hcengineering/login' +import { aiAssistantIntegrationKind } from '@hcengineering/ai-assistant' +import { + getIntegrationClient as getIntegrationClientRaw, + type IntegrationClient +} from '@hcengineering/integration-client' +import { getClient as getAccountClientRaw, type AccountClient } from '@hcengineering/account-client' + +export async function getIntegrationClient (): Promise { + const accountsUrl = getMetadata(login.metadata.AccountsUrl) + const token = getMetadata(presentation.metadata.Token) + if (accountsUrl === undefined || token === undefined) { + throw new Error('Accounts URL or token is not defined') + } + return getIntegrationClientRaw(accountsUrl, token, aiAssistantIntegrationKind, 'ai-assistant') +} + +export function getAccountClient (): AccountClient { + const accountsUrl = getMetadata(login.metadata.AccountsUrl) + const token = getMetadata(presentation.metadata.Token) + + return getAccountClientRaw(accountsUrl, token) +} diff --git a/plugins/ai-assistant-resources/svelte.config.js b/plugins/ai-assistant-resources/svelte.config.js new file mode 100644 index 0000000000..944a06f73e --- /dev/null +++ b/plugins/ai-assistant-resources/svelte.config.js @@ -0,0 +1,5 @@ +const sveltePreprocess = require('svelte-preprocess') + +module.exports = { + preprocess: sveltePreprocess() +}; \ No newline at end of file diff --git a/plugins/ai-assistant-resources/tsconfig.json b/plugins/ai-assistant-resources/tsconfig.json new file mode 100644 index 0000000000..14ada1dc34 --- /dev/null +++ b/plugins/ai-assistant-resources/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/ui/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib", "dist", "types", "bundle"] +} \ No newline at end of file diff --git a/plugins/ai-assistant/.eslintrc.js b/plugins/ai-assistant/.eslintrc.js new file mode 100644 index 0000000000..72235dc283 --- /dev/null +++ b/plugins/ai-assistant/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/default/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/plugins/ai-assistant/.npmignore b/plugins/ai-assistant/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/plugins/ai-assistant/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/plugins/ai-assistant/config/rig.json b/plugins/ai-assistant/config/rig.json new file mode 100644 index 0000000000..0110930f55 --- /dev/null +++ b/plugins/ai-assistant/config/rig.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig" +} diff --git a/plugins/ai-assistant/jest.config.js b/plugins/ai-assistant/jest.config.js new file mode 100644 index 0000000000..2cfd408b67 --- /dev/null +++ b/plugins/ai-assistant/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], + roots: ["./src"], + coverageReporters: ["text-summary", "html"] +} diff --git a/plugins/ai-assistant/package.json b/plugins/ai-assistant/package.json new file mode 100644 index 0000000000..32ffd30b41 --- /dev/null +++ b/plugins/ai-assistant/package.json @@ -0,0 +1,45 @@ +{ + "name": "@hcengineering/ai-assistant", + "version": "0.6.0", + "main": "lib/index.js", + "svelte": "src/index.ts", + "types": "types/index.d.ts", + "files": [ + "lib/**/*", + "types/**/*", + "tsconfig.json" + ], + "author": "Copyright © Hardcore Engineering Inc.", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "build:watch": "compile", + "format": "format src", + "test": "jest --passWithNoTests --silent", + "_phase:build": "compile transpile src", + "_phase:test": "jest --passWithNoTests --silent", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-n": "^15.4.0", + "eslint": "^8.54.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "prettier": "^3.1.0", + "typescript": "^5.8.3", + "jest": "^29.7.0", + "ts-jest": "^29.1.1", + "@types/jest": "^29.5.5" + }, + "dependencies": { + "@hcengineering/platform": "^0.6.11", + "@hcengineering/core": "^0.6.32", + "@hcengineering/ui": "^0.6.15", + "@hcengineering/setting": "^0.6.17" + } +} diff --git a/plugins/ai-assistant/src/index.ts b/plugins/ai-assistant/src/index.ts new file mode 100644 index 0000000000..07167adc17 --- /dev/null +++ b/plugins/ai-assistant/src/index.ts @@ -0,0 +1,44 @@ +// +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import type { Ref, IntegrationKind } from '@hcengineering/core' +import { type Plugin, plugin } from '@hcengineering/platform' +import type { Handler, IntegrationType } from '@hcengineering/setting' +import type { AnyComponent } from '@hcengineering/ui' + +/** + * @public + */ +export const aiAssistantIntegrationKind = 'ai-assistant' as IntegrationKind + +/** + * @public + */ +export const aiAssistantId = 'ai-assistant' as Plugin + +export default plugin(aiAssistantId, { + component: { + Connect: '' as AnyComponent, + IconHulyAssistant: '' as AnyComponent, + Configure: '' as AnyComponent + }, + integrationType: { + AiAssistant: '' as Ref + }, + handler: { + DisconnectHandler: '' as Handler, + DisconnectAllHandler: '' as Handler + } +}) diff --git a/plugins/ai-assistant/tsconfig.json b/plugins/ai-assistant/tsconfig.json new file mode 100644 index 0000000000..b5ae22f6e4 --- /dev/null +++ b/plugins/ai-assistant/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types", + "tsBuildInfoFile": ".build/build.tsbuildinfo" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib", "dist", "types", "bundle"] +} \ No newline at end of file diff --git a/rush.json b/rush.json index eb3c826f4b..820c09f1c7 100644 --- a/rush.json +++ b/rush.json @@ -2596,6 +2596,26 @@ "projectFolder": "plugins/huly-mail-resources", "shouldPublish": false }, + { + "packageName": "@hcengineering/model-ai-assistant", + "projectFolder": "models/ai-assistant", + "shouldPublish": false + }, + { + "packageName": "@hcengineering/ai-assistant", + "projectFolder": "plugins/ai-assistant", + "shouldPublish": false + }, + { + "packageName": "@hcengineering/ai-assistant-assets", + "projectFolder": "plugins/ai-assistant-assets", + "shouldPublish": false + }, + { + "packageName": "@hcengineering/ai-assistant-resources", + "projectFolder": "plugins/ai-assistant-resources", + "shouldPublish": false + }, { "packageName": "@hcengineering/pod-worker", "projectFolder": "services/worker", diff --git a/server/account/src/collections/postgres/migrations.ts b/server/account/src/collections/postgres/migrations.ts index 8f55909028..405e973876 100644 --- a/server/account/src/collections/postgres/migrations.ts +++ b/server/account/src/collections/postgres/migrations.ts @@ -33,7 +33,8 @@ export function getMigrations (ns: string): [string, string][] { getV12Migration(ns), getV13Migration(ns), getV14Migration(ns), - getV15Migration(ns) + getV15Migration(ns), + getV16Migration(ns) ] } @@ -436,3 +437,12 @@ function getV15Migration (ns: string): [string, string] { ` ] } + +function getV16Migration (ns: string): [string, string] { + return [ + 'account_db_v16_add_huly_assistant_social_id_type', + ` + ALTER TYPE ${ns}.social_id_type ADD VALUE 'huly-assistant' AFTER 'telegram'; + ` + ] +} diff --git a/server/account/src/operations.ts b/server/account/src/operations.ts index 33fd4487d5..65f4ef5f8f 100644 --- a/server/account/src/operations.ts +++ b/server/account/src/operations.ts @@ -2293,6 +2293,17 @@ async function addEmailSocialId ( return await sendOtp(ctx, db, branding, targetSocialId) } +async function addHulyAssistantSocialId ( + ctx: MeasureContext, + db: AccountDB, + branding: Branding | null, + token: string +): Promise { + const { account } = decodeTokenVerbose(ctx, token) + + return await addSocialIdBase(db, account, SocialIdType.HULY_ASSISTANT, account, true) +} + export async function releaseSocialId ( ctx: MeasureContext, db: AccountDB, @@ -2421,6 +2432,7 @@ export type AccountMethods = | 'getAccountInfo' | 'isReadOnlyGuest' | 'addEmailSocialId' + | 'addHulyAssistantSocialId' | 'releaseSocialId' | 'deleteAccount' @@ -2464,6 +2476,7 @@ export function getMethods (hasSignUp: boolean = true): Partial