@ckeditor/ckeditor5-ai 0.0.0-nightly-20240116.0 → 0.0.0-nightly-20240118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +13 -5
- package/README.md +9 -10
- package/build/ai.js +6 -6
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/translations/ar.po +2 -2
- package/lang/translations/bg.po +2 -2
- package/lang/translations/bn.po +2 -2
- package/lang/translations/ca.po +2 -2
- package/lang/translations/cs.po +2 -2
- package/lang/translations/da.po +2 -2
- package/lang/translations/de.po +2 -2
- package/lang/translations/el.po +2 -2
- package/lang/translations/es.po +2 -2
- package/lang/translations/et.po +2 -2
- package/lang/translations/fi.po +2 -2
- package/lang/translations/fr.po +2 -2
- package/lang/translations/he.po +2 -2
- package/lang/translations/hi.po +2 -2
- package/lang/translations/hu.po +2 -2
- package/lang/translations/id.po +2 -2
- package/lang/translations/it.po +2 -2
- package/lang/translations/ja.po +2 -2
- package/lang/translations/ko.po +2 -2
- package/lang/translations/lt.po +2 -2
- package/lang/translations/lv.po +2 -2
- package/lang/translations/ms.po +2 -2
- package/lang/translations/nl.po +2 -2
- package/lang/translations/no.po +2 -2
- package/lang/translations/pl.po +2 -2
- package/lang/translations/pt-br.po +2 -2
- package/lang/translations/pt.po +2 -2
- package/lang/translations/ro.po +2 -2
- package/lang/translations/ru.po +2 -2
- package/lang/translations/sk.po +2 -2
- package/lang/translations/sr.po +2 -2
- package/lang/translations/sv.po +2 -2
- package/lang/translations/th.po +2 -2
- package/lang/translations/tr.po +2 -2
- package/lang/translations/uk.po +2 -2
- package/lang/translations/vi.po +2 -2
- package/lang/translations/zh-cn.po +2 -2
- package/lang/translations/zh.po +2 -2
- package/package.json +6 -6
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.d.ts +21 -21
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/aiconfig.d.ts +1 -1
- package/src/ui/aiassistantcontroller.js +1 -1
- package/src/ui/dropdown/aicommandslistview.js +1 -1
- package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
- package/src/ui/dropdown/labelwithhighlightview.js +1 -1
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/theme/ai-form.css +13 -1
package/lang/translations/tr.po
CHANGED
|
@@ -215,11 +215,11 @@ msgstr "İstek başlıklarının hazırlanması başarısız oldu."
|
|
|
215
215
|
|
|
216
216
|
msgctxt "Error message displayed when preparing request parameters fails."
|
|
217
217
|
msgid "AI_ERROR_GET_PARAMETERS"
|
|
218
|
-
msgstr ""
|
|
218
|
+
msgstr "İstek parametreleri hazırlanamadı"
|
|
219
219
|
|
|
220
220
|
msgctxt "Error message displayed when the requested AI model is not supported."
|
|
221
221
|
msgid "AI_ERROR_UNSUPPORTED_MODEL"
|
|
222
|
-
msgstr ""
|
|
222
|
+
msgstr "İstenen yapay zeka modeli (\"%0\") desteklenmiyor"
|
|
223
223
|
|
|
224
224
|
msgctxt "Error message displayed when the content selected for AI processing is too long"
|
|
225
225
|
msgid "AI_ERROR_CONTEXT_LENGTH"
|
package/lang/translations/uk.po
CHANGED
|
@@ -215,11 +215,11 @@ msgstr "Не вдалося підготувати заголовки запит
|
|
|
215
215
|
|
|
216
216
|
msgctxt "Error message displayed when preparing request parameters fails."
|
|
217
217
|
msgid "AI_ERROR_GET_PARAMETERS"
|
|
218
|
-
msgstr ""
|
|
218
|
+
msgstr "Не вдалось підготувати параметри запиту"
|
|
219
219
|
|
|
220
220
|
msgctxt "Error message displayed when the requested AI model is not supported."
|
|
221
221
|
msgid "AI_ERROR_UNSUPPORTED_MODEL"
|
|
222
|
-
msgstr ""
|
|
222
|
+
msgstr "Запитувана модель ШІ (\"%0\") не підтримується"
|
|
223
223
|
|
|
224
224
|
msgctxt "Error message displayed when the content selected for AI processing is too long"
|
|
225
225
|
msgid "AI_ERROR_CONTEXT_LENGTH"
|
package/lang/translations/vi.po
CHANGED
|
@@ -215,11 +215,11 @@ msgstr "Chuẩn bị tiêu đề yêu cầu không thành công"
|
|
|
215
215
|
|
|
216
216
|
msgctxt "Error message displayed when preparing request parameters fails."
|
|
217
217
|
msgid "AI_ERROR_GET_PARAMETERS"
|
|
218
|
-
msgstr ""
|
|
218
|
+
msgstr "Không thể chuẩn bị tham số yêu cầu"
|
|
219
219
|
|
|
220
220
|
msgctxt "Error message displayed when the requested AI model is not supported."
|
|
221
221
|
msgid "AI_ERROR_UNSUPPORTED_MODEL"
|
|
222
|
-
msgstr ""
|
|
222
|
+
msgstr "Không hỗ trợ mô hình AI được yêu cầu (\"%0\")"
|
|
223
223
|
|
|
224
224
|
msgctxt "Error message displayed when the content selected for AI processing is too long"
|
|
225
225
|
msgid "AI_ERROR_CONTEXT_LENGTH"
|
|
@@ -215,11 +215,11 @@ msgstr "准备请求头失败"
|
|
|
215
215
|
|
|
216
216
|
msgctxt "Error message displayed when preparing request parameters fails."
|
|
217
217
|
msgid "AI_ERROR_GET_PARAMETERS"
|
|
218
|
-
msgstr ""
|
|
218
|
+
msgstr "请求参数准备失败"
|
|
219
219
|
|
|
220
220
|
msgctxt "Error message displayed when the requested AI model is not supported."
|
|
221
221
|
msgid "AI_ERROR_UNSUPPORTED_MODEL"
|
|
222
|
-
msgstr ""
|
|
222
|
+
msgstr "不支持请求的 AI 模型 (\"%0\")"
|
|
223
223
|
|
|
224
224
|
msgctxt "Error message displayed when the content selected for AI processing is too long"
|
|
225
225
|
msgid "AI_ERROR_CONTEXT_LENGTH"
|
package/lang/translations/zh.po
CHANGED
|
@@ -215,11 +215,11 @@ msgstr "要求標頭準備失敗"
|
|
|
215
215
|
|
|
216
216
|
msgctxt "Error message displayed when preparing request parameters fails."
|
|
217
217
|
msgid "AI_ERROR_GET_PARAMETERS"
|
|
218
|
-
msgstr ""
|
|
218
|
+
msgstr "要求參數準備失敗"
|
|
219
219
|
|
|
220
220
|
msgctxt "Error message displayed when the requested AI model is not supported."
|
|
221
221
|
msgid "AI_ERROR_UNSUPPORTED_MODEL"
|
|
222
|
-
msgstr ""
|
|
222
|
+
msgstr "不支援要求的 AI 模型(\"%0\")"
|
|
223
223
|
|
|
224
224
|
msgctxt "Error message displayed when the content selected for AI processing is too long"
|
|
225
225
|
msgid "AI_ERROR_CONTEXT_LENGTH"
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
4
|
-
"description": "AI
|
|
3
|
+
"version": "0.0.0-nightly-20240118.0",
|
|
4
|
+
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
7
|
-
"homepage": "https://ckeditor.com/
|
|
7
|
+
"homepage": "https://ckeditor.com/ckeditor-5",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"CKEditor",
|
|
10
10
|
"ckeditor5",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"framework"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"ckeditor5": "0.0.0-nightly-
|
|
27
|
-
"ckeditor5-collaboration": "0.0.0-nightly-
|
|
26
|
+
"ckeditor5": "0.0.0-nightly-20240118.0",
|
|
27
|
+
"ckeditor5-collaboration": "0.0.0-nightly-20240118.0",
|
|
28
28
|
"@aws-sdk/client-bedrock-runtime": "3.470.0",
|
|
29
|
-
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-
|
|
29
|
+
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-20240118.0",
|
|
30
30
|
"lodash-es": "4.17.21"
|
|
31
31
|
},
|
|
32
32
|
"type": "module",
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x4929=['afterInit','AIRequestError','pluginName','aiadapter-text-adapter-not-set','name','textAdapter'];(function(_0x48a972,_0x492963){var _0x4372c2=function(_0xf67a33){while(--_0xf67a33){_0x48a972['push'](_0x48a972['shift']());}};_0x4372c2(++_0x492963);}(_0x4929,0x195));var _0x4372=function(_0x48a972,_0x492963){_0x48a972=_0x48a972-0x0;var _0x4372c2=_0x4929[_0x48a972];return _0x4372c2;};import{Plugin as _0x6481c8}from'ckeditor5/src/core.js';import{CKEditorError as _0x47cafc}from'ckeditor5/src/utils.js';export default class I extends _0x6481c8{static get[_0x4372('0x5')](){return'AIAdapter';}[_0x4372('0x3')](){if(!this[_0x4372('0x2')])throw new _0x47cafc(_0x4372('0x0'),null);}}export class AIRequestError extends Error{constructor(_0x213ad9){super(_0x213ad9),this[_0x4372('0x1')]=_0x4372('0x4');}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4ad0=['locale','get','object','_prepareRequestHeaders','reject','requires','AbortError','assign','catch','abortController','signal','AI_ERROR_GET_HEADERS','sendRequest','_prepareRequestParameters','abort','plugins','init','application/json','makeRequest','aborted','resolve','editor'];(function(_0x5a8fee,_0x4ad0c1){const _0x300195=function(_0x48d82a){while(--_0x48d82a){_0x5a8fee['push'](_0x5a8fee['shift']());}};_0x300195(++_0x4ad0c1);}(_0x4ad0,0x1e0));const _0x3001=function(_0x5a8fee,_0x4ad0c1){_0x5a8fee=_0x5a8fee-0x0;let _0x300195=_0x4ad0[_0x5a8fee];return _0x300195;};import{Plugin as _0x41bd4c}from'ckeditor5/src/core.js';import{CKEditorError as _0x411fa7}from'ckeditor5/src/utils.js';import{default as _0x1ee6e0,AIRequestError as _0x2218e4}from'./aiadapter.js';import{getTranslation as _0x4e8498}from'../utils/common-translations.js';export default class _ extends _0x41bd4c{static get[_0x3001('0x9')](){return[_0x1ee6e0];}constructor(_0x1025f4){super(_0x1025f4),this[_0x3001('0xd')]=new AbortController();}[_0x3001('0x14')](){this['editor'][_0x3001('0x13')][_0x3001('0x5')](_0x1ee6e0)['textAdapter']=this;}[_0x3001('0x12')](){this['abortController'][_0x3001('0xe')][_0x3001('0x1')]||(this['abortController'][_0x3001('0x12')](),this[_0x3001('0xd')]=new AbortController());}async[_0x3001('0x0')](_0x5ef145){return this[_0x3001('0x10')](_0x5ef145)[_0x3001('0xc')](_0x9bb6d1=>{if(_0x9bb6d1 instanceof _0x2218e4)return Promise['reject'](_0x9bb6d1);if(_0x3001('0xa')==_0x9bb6d1['name'])return Promise[_0x3001('0x2')]();throw console['error'](_0x9bb6d1),new _0x411fa7('aitextadapter-send-request-failed',null);});}async[_0x3001('0x7')](_0x1b2861,_0xf44b63){const _0x4247fb=this[_0x3001('0x3')][_0x3001('0x4')],_0x268a00={'Content-Type':_0x3001('0x15')};if('object'==typeof _0x1b2861)Object[_0x3001('0xb')](_0x268a00,_0x1b2861);else{if(_0x1b2861)try{const _0x335a2d=await _0x1b2861(_0xf44b63);Object['assign'](_0x268a00,_0x335a2d);}catch(_0x331846){return Promise[_0x3001('0x8')](new _0x2218e4(_0x4e8498(_0x4247fb,_0x3001('0xf'))));}}return _0x268a00;}async[_0x3001('0x11')](_0x2b80eb,_0x1b39e7){const _0x4fb631=this[_0x3001('0x3')][_0x3001('0x4')];if(_0x3001('0x6')==typeof _0x2b80eb)return _0x2b80eb;try{return await _0x2b80eb(_0x1b39e7);}catch(_0x14f26a){return Promise[_0x3001('0x8')](new _0x2218e4(_0x4e8498(_0x4fb631,'AI_ERROR_GET_PARAMETERS')));}}}
|
|
@@ -10,7 +10,7 @@ import { type Editor } from 'ckeditor5/src/core.js';
|
|
|
10
10
|
import { default as AITextAdapter, type AITextAdapterRequestData, type RequestHeaders, type RequestParameters } from './aitextadapter.js';
|
|
11
11
|
import { type BedrockRuntimeClientConfig } from '@aws-sdk/client-bedrock-runtime';
|
|
12
12
|
/**
|
|
13
|
-
* Adapter for AI text-related requests that supports
|
|
13
|
+
* Adapter for AI text-related requests that supports the Amazon Bedrock service.
|
|
14
14
|
*
|
|
15
15
|
* See also {@link module:ai/adapters/aitextadapter~AITextAdapter}.
|
|
16
16
|
*/
|
|
@@ -24,13 +24,13 @@ export default class AWSTextAdapter extends AITextAdapter {
|
|
|
24
24
|
*/
|
|
25
25
|
constructor(editor: Editor);
|
|
26
26
|
/**
|
|
27
|
-
* Performs the request to the
|
|
27
|
+
* Performs the request to the Amazon Bedrock service or to the endpoint provided in the editor configuration.
|
|
28
28
|
*
|
|
29
29
|
* If you want to extend this adapter, you can overload this method to do some additional processing or make an external call.
|
|
30
30
|
*/
|
|
31
31
|
sendRequest({ query, context, onData, actionId }: AITextAdapterRequestData): Promise<void>;
|
|
32
32
|
/**
|
|
33
|
-
* Prepares the actual full prompt for the request to the
|
|
33
|
+
* Prepares the actual full prompt for the request to the Amazon Bedrock API.
|
|
34
34
|
*
|
|
35
35
|
* The prompt may differ depending on what model is used.
|
|
36
36
|
*
|
|
@@ -43,18 +43,18 @@ export default class AWSTextAdapter extends AITextAdapter {
|
|
|
43
43
|
*/
|
|
44
44
|
preparePrompt(query: string, context: string, model: string, actionId: string): Promise<string>;
|
|
45
45
|
/**
|
|
46
|
-
* For given
|
|
46
|
+
* For a given model, it returns the family to which this model belongs.
|
|
47
47
|
*
|
|
48
|
-
* For example, for `anthropic.claude-instant-v1` will return `anthropic.claude`.
|
|
48
|
+
* For example, for `anthropic.claude-instant-v1` it will return `anthropic.claude`.
|
|
49
49
|
*
|
|
50
|
-
* Throws {@link module:ai/adapters/aiadapter~AIRequestError `AIRequestError`} if given
|
|
50
|
+
* Throws {@link module:ai/adapters/aiadapter~AIRequestError `AIRequestError`} if a given model is not supported.
|
|
51
51
|
*/
|
|
52
52
|
getModelFamily(model: string): AWSModelFamily;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* The configuration for the
|
|
55
|
+
* The configuration for the Amazon Bedrock adapter.
|
|
56
56
|
*
|
|
57
|
-
* The properties defined in this
|
|
57
|
+
* The properties defined in this configuration are set in the `config.ai.aws` namespace.
|
|
58
58
|
*
|
|
59
59
|
* ```ts
|
|
60
60
|
* ClassicEditor
|
|
@@ -77,20 +77,20 @@ export interface AWSTextAdapterConfig {
|
|
|
77
77
|
/**
|
|
78
78
|
* The URL to which the AI service request will be sent.
|
|
79
79
|
*
|
|
80
|
-
* Set this value only if you want to connect to
|
|
80
|
+
* Set this value only if you want to connect to Amazon Bedrock using a proxy endpoint.
|
|
81
81
|
*
|
|
82
82
|
* If `apiUrl` is not provided, the AWS-SDK library will be used to process the request. It will set a proper URL on its own.
|
|
83
83
|
*/
|
|
84
84
|
apiUrl?: string;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* An object with headers to set in the request to the AI service.
|
|
87
87
|
*
|
|
88
|
-
* **These headers are only used when connecting to AWS through the proxy endpoint (
|
|
88
|
+
* **These headers are only used when connecting to AWS through the proxy endpoint (that is, when `apiUrl` is set).**
|
|
89
89
|
*
|
|
90
|
-
* Otherwise, AWS-SDK library is used, and it sets the request headers on its own. In this mode, the request headers cannot be
|
|
90
|
+
* Otherwise, the AWS-SDK library is used, and it sets the request headers on its own. In this mode, the request headers cannot be
|
|
91
91
|
* customized.
|
|
92
92
|
*
|
|
93
|
-
* If the provided value is an
|
|
93
|
+
* If the provided value is an object, it is simply used as provided.
|
|
94
94
|
*
|
|
95
95
|
* ```js
|
|
96
96
|
* {
|
|
@@ -105,9 +105,9 @@ export interface AWSTextAdapterConfig {
|
|
|
105
105
|
* }
|
|
106
106
|
* ```
|
|
107
107
|
*
|
|
108
|
-
* If the provided value is a function, it should be a function that returns a
|
|
108
|
+
* If the provided value is a function, it should be a function that returns a promise which resolves with the headers object.
|
|
109
109
|
* This way, you can perform an authorization request to your application and receive the authorization token (and also implement
|
|
110
|
-
* any custom logic on the
|
|
110
|
+
* any custom logic on the backend side). The headers object is then used to make the actual call to the AI service.
|
|
111
111
|
*
|
|
112
112
|
* ```js
|
|
113
113
|
* {
|
|
@@ -126,7 +126,7 @@ export interface AWSTextAdapterConfig {
|
|
|
126
126
|
* }
|
|
127
127
|
* ```
|
|
128
128
|
*
|
|
129
|
-
* The function is passed {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
|
|
129
|
+
* The function is passed the {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
|
|
130
130
|
* possible to further customize the headers.
|
|
131
131
|
*
|
|
132
132
|
* If the function fails for any reason, the promise should be rejected. In this case, a feature that made the request should display
|
|
@@ -141,12 +141,12 @@ export interface AWSTextAdapterConfig {
|
|
|
141
141
|
*
|
|
142
142
|
* See [AWS model parameters reference](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) to learn more.
|
|
143
143
|
*
|
|
144
|
-
* If the provided value is an
|
|
144
|
+
* If the provided value is an object, it is passed to the request as provided.
|
|
145
145
|
*
|
|
146
|
-
* If the provided value is a function, it should be a function that returns a
|
|
146
|
+
* If the provided value is a function, it should be a function that returns a promise which resolves with the request parameters
|
|
147
147
|
* object. This gives you more flexibility to provide parameters for the AI model.
|
|
148
148
|
*
|
|
149
|
-
* The function is passed {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
|
|
149
|
+
* The function is passed the {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId `actionId`} parameter to make it
|
|
150
150
|
* possible to further customize the parameters.
|
|
151
151
|
*
|
|
152
152
|
* If the function fails for any reason, the promise should be rejected. In this case, the feature that made the request should display
|
|
@@ -168,10 +168,10 @@ export interface AWSTextAdapterConfig {
|
|
|
168
168
|
*/
|
|
169
169
|
requestParameters?: RequestParameters;
|
|
170
170
|
/**
|
|
171
|
-
*
|
|
171
|
+
* The configuration for AWS-SDK Bedrock Runtime Client.
|
|
172
172
|
*
|
|
173
173
|
* If `apiUrl` is not provided, this configuration will be used to initialize the Bedrock Runtime Client which will be used to process
|
|
174
|
-
* the requests. The adapter will make requests directly to the
|
|
174
|
+
* the requests. The adapter will make requests directly to the Amazon Bedrock service.
|
|
175
175
|
*/
|
|
176
176
|
bedrockClientConfig?: BedrockRuntimeClientConfig;
|
|
177
177
|
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x404e=['toString','stringify','anthropic.claude-v2','_requestHeaders','getModelFamily','anthropic.claude','ai.aws.requestHeaders','split','signal','Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.','<span>','ai.aws.apiUrl','_readAsyncIterableResponse','Human:\x0a','AI_ERROR_UNSUPPORTED_MODEL','Instruction:\x0a','abortController','chunk','decode','ai.aws.requestParameters.temperature','_readStreamableResponse','ai.aws.requestParameters.top_p','text','POST','\x0a<</SYS>>\x0a[INST]\x0a','\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a','\x0a[/INST]','\x0a\x0aAssistant:','_prepareRequestHeaders','_getGeneratedText','_readStaticResponse','ai.aws.requestParameters.top_k','preparePrompt','locale','application/json','getReader','resolve','ai.aws.requestParameters.stream','generations','from','map','parse','_processProxyRequest','bytes','get','send','body','_bedrockClientConfig','ai21.j2','_apiUrl','<<SYS>>\x0a','test','bedrock-2023-05-31','ai.aws.requestParameters','AWSTextAdapter','cohere.command','completion','utf-8','ai.aws.requestParameters.anthropic_version','startsWith','pluginName','_prepareRequestParameters','</span>','_processAWSRequest','_requestParameters','generation','completions','define','read','config','meta.llama'];(function(_0x219d51,_0x404ee1){const _0x488cec=function(_0x10f985){while(--_0x10f985){_0x219d51['push'](_0x219d51['shift']());}};_0x488cec(++_0x404ee1);}(_0x404e,0xf1));const _0x488c=function(_0x219d51,_0x404ee1){_0x219d51=_0x219d51-0x0;let _0x488cec=_0x404e[_0x219d51];return _0x488cec;};import{default as _0x40c9fa}from'./aitextadapter.js';import{AIRequestError as _0x5a7d01}from'./aiadapter.js';import{BedrockRuntimeClient as _0x54d077,InvokeModelCommand as _0x30fcdb,InvokeModelWithResponseStreamCommand as _0x2a7aa7}from'@aws-sdk/client-bedrock-runtime';import{getTranslation as _0xadc9ae}from'../utils/common-translations.js';export default class H extends _0x40c9fa{static get[_0x488c('0x20')](){return _0x488c('0x1a');}constructor(_0x2cdfd5){super(_0x2cdfd5),_0x2cdfd5['config']['get'](_0x488c('0x19'))||(_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')]('ai.aws.requestParameters.model',_0x488c('0x2d')),_0x2cdfd5[_0x488c('0x29')]['define']('ai.aws.requestParameters.max_tokens_to_sample',0x7d0),_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')](_0x488c('0x3e'),0x1),_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')](_0x488c('0x40'),0x1),_0x2cdfd5[_0x488c('0x29')][_0x488c('0x27')](_0x488c('0x3'),0xfa),_0x2cdfd5[_0x488c('0x29')]['define'](_0x488c('0x1e'),_0x488c('0x18')),_0x2cdfd5['config']['define'](_0x488c('0x9'),!0x0)),this[_0x488c('0x15')]=_0x2cdfd5['config'][_0x488c('0x10')](_0x488c('0x36')),this[_0x488c('0x13')]=_0x2cdfd5[_0x488c('0x29')][_0x488c('0x10')]('ai.aws.bedrockClientConfig'),this[_0x488c('0x2e')]=_0x2cdfd5[_0x488c('0x29')][_0x488c('0x10')](_0x488c('0x31')),this[_0x488c('0x24')]=_0x2cdfd5[_0x488c('0x29')][_0x488c('0x10')](_0x488c('0x19'));}async['sendRequest']({query:_0x5eb52e,context:_0xe8ef47,onData:_0x2fd2b9,actionId:_0x3dcee4}){const {model:_0x50813b,stream:_0x49350e,..._0x1be1ac}=await this[_0x488c('0x21')](this[_0x488c('0x24')],_0x3dcee4),_0x5d2e52={'prompt':await this[_0x488c('0x4')](_0x5eb52e,_0xe8ef47,_0x50813b,_0x3dcee4),..._0x1be1ac};this[_0x488c('0x15')]?await this['_processProxyRequest'](_0x5d2e52,_0x50813b,_0x49350e,_0x2fd2b9,_0x3dcee4):await this['_processAWSRequest'](_0x5d2e52,_0x50813b,_0x49350e,_0x2fd2b9);}async[_0x488c('0x4')](_0x27eac9,_0x34747d,_0x1c5d7a,_0x167a70){let _0x5f50ee,_0x240113;return _0x34747d?(_0x5f50ee=_0x488c('0x34'),_0x240113=_0x488c('0x3a')+_0x27eac9+_0x488c('0x44')+(_0x34747d[_0x488c('0x1f')]('<')?_0x34747d:_0x488c('0x35')+_0x34747d+_0x488c('0x22'))):(_0x5f50ee='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x240113=_0x27eac9),_0x488c('0x2a')==this[_0x488c('0x2f')](_0x1c5d7a)?_0x488c('0x16')+_0x5f50ee+_0x488c('0x43')+_0x240113+_0x488c('0x45'):_0x488c('0x38')+_0x5f50ee+'\x0a'+_0x240113+_0x488c('0x46');}[_0x488c('0x2f')](_0x5d1154){if(/^anthropic\.claude/[_0x488c('0x17')](_0x5d1154))return _0x488c('0x30');if(/^ai21\.j2/['test'](_0x5d1154))return _0x488c('0x14');if(/^cohere\.command/['test'](_0x5d1154))return _0x488c('0x1b');if(/^meta\.llama/[_0x488c('0x17')](_0x5d1154))return _0x488c('0x2a');throw new _0x5a7d01(_0xadc9ae(this['editor'][_0x488c('0x5')],_0x488c('0x39'),_0x5d1154));}async[_0x488c('0xe')](_0x34ff56,_0x45fd63,_0x4e148e,_0x5e1c1a,_0x232ce8){const _0x371cde={'method':_0x488c('0x42'),'headers':await this[_0x488c('0x0')](this[_0x488c('0x2e')],_0x232ce8),'body':JSON[_0x488c('0x2c')]({..._0x34ff56,'model':_0x45fd63,'stream':_0x4e148e}),'signal':this['abortController'][_0x488c('0x33')]},_0x2c1d49=await fetch(this['_apiUrl'],_0x371cde);_0x4e148e?await this[_0x488c('0x3f')](_0x2c1d49,_0x45fd63,_0x5e1c1a):await this[_0x488c('0x2')](_0x2c1d49,_0x45fd63,_0x5e1c1a);}async[_0x488c('0x23')](_0x186cd1,_0x16f840,_0x3221cb,_0x407b7b){const _0x4e2959=new _0x54d077(this['_bedrockClientConfig']),_0x17596f={'body':JSON[_0x488c('0x2c')](_0x186cd1),'contentType':_0x488c('0x6'),'accept':_0x488c('0x6'),'modelId':_0x16f840};let _0x26911e;if(_0x3221cb){const _0x33964b=new _0x2a7aa7(_0x17596f);_0x26911e=await _0x4e2959['send'](_0x33964b,{'abortSignal':this[_0x488c('0x3b')][_0x488c('0x33')]}),await this[_0x488c('0x37')](_0x26911e,_0x16f840,_0x407b7b);}else{const _0x952260=new _0x30fcdb(_0x17596f);_0x26911e=await _0x4e2959[_0x488c('0x11')](_0x952260,{'abortSignal':this[_0x488c('0x3b')][_0x488c('0x33')]}),await this[_0x488c('0x2')](_0x26911e,_0x16f840,_0x407b7b);}}async[_0x488c('0x37')](_0x13c319,_0x2cde77,_0x26afae){const _0x540fc0=_0x13c319[_0x488c('0x12')],_0x2f419f=new TextDecoder(_0x488c('0x1d'));let _0x177336='';for await(const _0x38b4fc of _0x540fc0)if(_0x38b4fc[_0x488c('0x3c')]){const _0x24731a=_0x2f419f[_0x488c('0x3d')](_0x38b4fc[_0x488c('0x3c')][_0x488c('0xf')]),_0x24bea2=JSON['parse'](_0x24731a);_0x177336+=this[_0x488c('0x1')](_0x24bea2,_0x2cde77),_0x26afae(_0x177336);}return Promise[_0x488c('0x8')]();}async[_0x488c('0x3f')](_0x230a56,_0x1f9b13,_0x3652a0){const _0x5566c5=_0x230a56[_0x488c('0x12')],_0x55fdf9=new TextDecoder('utf-8'),_0x2cfcb3=_0x5566c5[_0x488c('0x7')]();let _0x37d72f='',_0x2a99ed='',_0x2ba91c=!0x1;for(;!_0x2ba91c;){const {done:_0x5c3510,value:_0x200a10}=await _0x2cfcb3[_0x488c('0x28')]();if(_0x2ba91c=_0x5c3510,_0x2ba91c)break;const _0x51398e=(_0x37d72f+_0x55fdf9['decode'](_0x200a10))[_0x488c('0x32')]('\x0a')[_0x488c('0xc')](_0x1779dc=>{try{return _0x37d72f='',JSON[_0x488c('0xd')](_0x1779dc);}catch(_0x53d2e8){return _0x37d72f=_0x1779dc,null;}})['filter'](_0x2c24c9=>null!==_0x2c24c9);_0x51398e['length']&&(_0x2a99ed+=_0x51398e[_0x488c('0xc')](_0x1893da=>this['_getGeneratedText'](_0x1893da,_0x1f9b13))['join'](''),_0x3652a0(_0x2a99ed));}return Promise['resolve']();}async[_0x488c('0x2')](_0x218434,_0x37abea,_0x2d5da2){let _0x18fe71;return _0x18fe71=_0x218434 instanceof Response?await _0x218434['json']():JSON['parse'](Buffer[_0x488c('0xb')](_0x218434[_0x488c('0x12')])[_0x488c('0x2b')]('utf8')),(_0x2d5da2(this[_0x488c('0x1')](_0x18fe71,_0x37abea)),Promise[_0x488c('0x8')]());}[_0x488c('0x1')](_0x53b390,_0x59454c){switch(this[_0x488c('0x2f')](_0x59454c)){case'anthropic.claude':return _0x53b390[_0x488c('0x1c')];case _0x488c('0x14'):return _0x53b390[_0x488c('0x26')][0x0]['data'][_0x488c('0x41')];case'cohere.command':return _0x53b390[_0x488c('0xa')][0x0][_0x488c('0x41')];case _0x488c('0x2a'):return _0x53b390[_0x488c('0x25')];}}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2b0f=['_readStaticResponse','ai.openAI.requestParameters.stream','_requestParameters','startsWith','join','ai.openAI.requestParameters.max_tokens','\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a','config','resolve','delta','data:\x20','get','choices','define','stringify','text','ai.openAI.requestParameters.top_p','read','message','pluginName','ai.openAI.requestHeaders','getReader','</span>','_prepareRequestHeaders','POST','json','AI_ERROR_MODERATION','body','_isBufferIncomplete','prepareMessages','system','ai.openAI.requestParameters.model','user','Instruction:\x0a','abortController','editor','[DONE]','length','stream','parse','_readStreamableResponse','ai.openAI.requestParameters.temperature','AI_ERROR_CONTEXT_LENGTH','Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.','signal','_cleanUpData','reject','_requestHeaders','split','replace','_apiUrl','content','map','context_length_exceeded','locale','decode','ai.openAI.apiUrl'];(function(_0x54c0a4,_0x2b0fc0){const _0x1d1c92=function(_0x1376ee){while(--_0x1376ee){_0x54c0a4['push'](_0x54c0a4['shift']());}};_0x1d1c92(++_0x2b0fc0);}(_0x2b0f,0x1c8));const _0x1d1c=function(_0x54c0a4,_0x2b0fc0){_0x54c0a4=_0x54c0a4-0x0;let _0x1d1c92=_0x2b0f[_0x54c0a4];return _0x1d1c92;};import{default as _0x5e9e3c}from'./aitextadapter.js';import{AIRequestError as _0x12def1}from'./aiadapter.js';import{getTranslation as _0x4dafd2}from'../utils/common-translations.js';export default class M extends _0x5e9e3c{static get[_0x1d1c('0x13')](){return'OpenAITextAdapter';}constructor(_0x1ea76f){super(_0x1ea76f),_0x1ea76f[_0x1d1c('0x7')][_0x1d1c('0xd')](_0x1d1c('0x38'),'https://api.openai.com/v1/chat/completions'),_0x1ea76f['config'][_0x1d1c('0xd')](_0x1d1c('0x1f'),'gpt-3.5-turbo'),_0x1ea76f['config'][_0x1d1c('0xd')](_0x1d1c('0x5'),0x7d0),_0x1ea76f['config'][_0x1d1c('0xd')](_0x1d1c('0x29'),0x1),_0x1ea76f[_0x1d1c('0x7')][_0x1d1c('0xd')](_0x1d1c('0x10'),0x1),_0x1ea76f[_0x1d1c('0x7')][_0x1d1c('0xd')](_0x1d1c('0x1'),!0x0),this[_0x1d1c('0x32')]=_0x1ea76f['config']['get']('ai.openAI.apiUrl'),this[_0x1d1c('0x2f')]=_0x1ea76f['config']['get'](_0x1d1c('0x14'))||{},this[_0x1d1c('0x2')]=_0x1ea76f['config'][_0x1d1c('0xb')]('ai.openAI.requestParameters');}async['sendRequest']({query:_0x43bd94,context:_0xc154d8,onData:_0x2fdd82,actionId:_0x3cc313}){const _0x1680ca=this[_0x1d1c('0x23')][_0x1d1c('0x36')],_0x54640b=await this[_0x1d1c('0x1d')](_0x43bd94,_0xc154d8,_0x3cc313),_0x3caf8c=await this[_0x1d1c('0x17')](this['_requestHeaders'],_0x3cc313),_0x204f99=await this['_prepareRequestParameters'](this[_0x1d1c('0x2')],_0x3cc313),_0x1677db={'messages':_0x54640b,..._0x204f99},_0xf6ce2e={'method':_0x1d1c('0x18'),'headers':_0x3caf8c,'body':JSON[_0x1d1c('0xe')](_0x1677db),'signal':this[_0x1d1c('0x22')][_0x1d1c('0x2c')]},_0x1afe5f=await fetch(this[_0x1d1c('0x32')],_0xf6ce2e);if(_0x1afe5f['ok'])return _0x204f99[_0x1d1c('0x26')]?await this[_0x1d1c('0x28')](_0x1afe5f,_0x2fdd82):await this[_0x1d1c('0x0')](_0x1afe5f,_0x2fdd82),Promise[_0x1d1c('0x8')]();{const _0x36abf7=await _0x1afe5f[_0x1d1c('0xf')]();return _0x36abf7['includes'](_0x1d1c('0x35'))?Promise[_0x1d1c('0x2e')](new _0x12def1(_0x4dafd2(_0x1680ca,_0x1d1c('0x2a')))):_0x36abf7['includes']('Moderation')?Promise[_0x1d1c('0x2e')](new _0x12def1(_0x4dafd2(_0x1680ca,_0x1d1c('0x1a')))):Promise[_0x1d1c('0x2e')](new Error(_0x36abf7));}}async[_0x1d1c('0x1d')](_0x44939a,_0x5eaf46,_0xf10ed1){let _0x488305,_0xc14d92;return _0x5eaf46?(_0x488305=_0x1d1c('0x2b'),_0xc14d92=_0x1d1c('0x21')+_0x44939a+_0x1d1c('0x6')+(_0x5eaf46[_0x1d1c('0x3')]('<')?_0x5eaf46:'<span>'+_0x5eaf46+_0x1d1c('0x16'))):(_0x488305='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0xc14d92=_0x44939a),[{'role':_0x1d1c('0x1e'),'content':_0x488305},{'role':_0x1d1c('0x20'),'content':_0xc14d92}];}async['_readStreamableResponse'](_0x12133f,_0x1c0132){const _0x24fb38=_0x12133f[_0x1d1c('0x1b')][_0x1d1c('0x15')](),_0x4d26fe=new TextDecoder();let _0x88fc6a='',_0x38c65a='',_0x5c2f20='',_0x5125ce=!0x1;for(;!_0x5125ce;){const {done:_0x4909e3,value:_0x14121d}=await _0x24fb38[_0x1d1c('0x11')](),_0x40a1a9=_0x88fc6a+_0x4d26fe[_0x1d1c('0x37')](_0x14121d);let _0x2e9d4b='';_0x5125ce=_0x4909e3;try{_0x2e9d4b=this[_0x1d1c('0x2d')](_0x40a1a9),_0x88fc6a='';}catch(_0x2b526c){_0x88fc6a=_0x40a1a9;continue;}_0x38c65a+=_0x2e9d4b,!_0x5125ce&&this[_0x1d1c('0x1c')](_0x38c65a)||_0x38c65a&&(_0x5c2f20+=_0x38c65a,_0x38c65a='',_0x1c0132(_0x5c2f20));}return Promise['resolve']();}async[_0x1d1c('0x0')](_0x49c350,_0x522e6a){return _0x522e6a((await _0x49c350[_0x1d1c('0x19')]())[_0x1d1c('0xc')][0x0][_0x1d1c('0x12')]['content']),Promise[_0x1d1c('0x8')]();}[_0x1d1c('0x1c')](_0x3dc68f){const _0x2a7a6f=_0x3dc68f['split']('<')[_0x1d1c('0x25')]!==_0x3dc68f[_0x1d1c('0x30')]('>')[_0x1d1c('0x25')],_0x3907e1=_0x3dc68f[_0x1d1c('0x25')]<0x1e;return _0x2a7a6f&&_0x3907e1;}['_cleanUpData'](_0x6978){return _0x6978[_0x1d1c('0x30')](/\n(?![^{]*\})/g)[_0x1d1c('0x34')](_0x2a3c89=>_0x2a3c89[_0x1d1c('0x31')](_0x1d1c('0xa'),''))['filter'](_0x1f6d16=>_0x1f6d16&&_0x1f6d16['length']>0x0&&_0x1d1c('0x24')!==_0x1f6d16)[_0x1d1c('0x34')](_0x3a6c48=>{const {choices:_0x4d4ade}=JSON[_0x1d1c('0x27')](_0x3a6c48);if(_0x4d4ade[0x0]&&_0x4d4ade[0x0][_0x1d1c('0x9')]&&_0x4d4ade[0x0][_0x1d1c('0x9')][_0x1d1c('0x33')])return _0x4d4ade[0x0][_0x1d1c('0x9')][_0x1d1c('0x33')];})['filter'](_0x337bc5=>_0x337bc5)[_0x1d1c('0x4')]('');}}
|
package/src/aiassistant.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4047=['_licenseKeyCheckInterval','Professional','Translate\x20to\x20%0','English','translateEnglish','filter','Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.','ai.aiAssistant.extraCommandGroups','confident','info','continue','Business','Translate\x20the\x20content\x20to\x20Spanish\x20language.','pluginName','translateHindi','Arabic','poetic','simplifyLanguage','locale','ai.aiAssistant.removeCommands','Translate\x20the\x20content\x20to\x20English\x20language.','changeTone','Continue','makeShorter','get','makeLonger','Edit\x20or\x20review','aiLicenseKeyValid','Confident','translate','direct','German','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','legal','casual','professional','forEach','Friendly','French','Make\x20longer','translateSpanish','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','generate','editOrReview','Translate\x20the\x20content\x20to\x20French\x20language.','init','licenseKey','commands','ai.aiAssistant.commands','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.','Translate\x20the\x20content\x20to\x20Hindi\x20language.','Translate\x20the\x20content\x20to\x20Arabic\x20language.','Simplified\x20Chinese','requires','Poetic','friendly','Direct','includes','groupId','Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.','translatePortuguese','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','aiLicenseKeyTrialLimit:operations','Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.','Translate\x20the\x20content\x20to\x20German\x20language.','translateChinese','config','Spanish','Generate\x20from\x20selection','translateArabic','ai-invalid-license-key','set','Make\x20shorter','destroy','aiLicenseKeyTrial','You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20ai\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.','AIAssistant','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','aiLicenseKeyInvalid','define','Summarize','Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.','Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.','Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','Simplify\x20language'];(function(_0x4e4168,_0x4047ce){const _0x1201df=function(_0x5da9bd){while(--_0x5da9bd){_0x4e4168['push'](_0x4e4168['shift']());}};_0x1201df(++_0x4047ce);}(_0x4047,0x1ad));const _0x1201=function(_0x4e4168,_0x4047ce){_0x4e4168=_0x4e4168-0x0;let _0x1201df=_0x4047[_0x4e4168];return _0x1201df;};import{CKEditorError as _0x3cd7f7}from'ckeditor5/src/utils.js';import{Plugin as _0x125298}from'ckeditor5/src/core.js';import _0x128af5 from'./aiassistantui.js';import _0x13240d from'./aiassistantediting.js';import{getTranslation as _0x4b6a32}from'./utils/common-translations.js';export default class r extends _0x125298{static get[_0x1201('0x3d')](){return[_0x128af5,_0x13240d];}static get[_0x1201('0x13')](){return _0x1201('0x54');}constructor(_0x9ecaa0){super(_0x9ecaa0);const _0x23942f=_0x9ecaa0[_0x1201('0x4a')];_0x23942f[_0x1201('0x0')](_0x1201('0x38'),getDefaultCommands(_0x9ecaa0[_0x1201('0x18')])),_0x23942f['define'](_0x1201('0xd'),[]),_0x23942f[_0x1201('0x0')](_0x1201('0x19'),[]);const _0xecdcea=_0x23942f[_0x1201('0x1e')](_0x1201('0x38')),_0x3ca675=_0x23942f['get'](_0x1201('0xd')),_0x472234=_0x23942f[_0x1201('0x1e')](_0x1201('0x19'));_0x3ca675[_0x1201('0x2c')](_0x334e09=>{const _0x51adf6=_0xecdcea['find'](_0x47c9c7=>_0x47c9c7[_0x1201('0x42')]===_0x334e09[_0x1201('0x42')]);_0x51adf6?_0x51adf6[_0x1201('0x37')]=_0x51adf6[_0x1201('0x37')]['concat'](_0x334e09['commands']):_0xecdcea['push'](_0x334e09);}),_0xecdcea['forEach'](_0xcd14bb=>{_0xcd14bb['commands']=_0xcd14bb[_0x1201('0x37')][_0x1201('0xb')](_0x4ffef9=>!_0x472234[_0x1201('0x41')](_0x4ffef9['id']));}),_0x23942f[_0x1201('0x4f')](_0x1201('0x38'),_0xecdcea);}[_0x1201('0x35')](){const _0xbb6be9=this['editor'];this[_0x1201('0x36')]=_0xbb6be9[_0x1201('0x4a')]['get'](_0x1201('0x36')),this[_0x1201('0x6')]=setInterval(()=>{let _0x2f3f1b;for(const _0x2174d0 in _0xbb6be9){const _0x2087c0=_0x2174d0,_0x532e93=_0xbb6be9[_0x2087c0];if(_0x1201('0x52')===_0x532e93||_0x1201('0x56')===_0x532e93||_0x1201('0x21')===_0x532e93||_0x1201('0x46')===_0x532e93){delete _0xbb6be9[_0x2087c0],_0x2f3f1b=_0x532e93;break;}}if(_0x1201('0x56')===_0x2f3f1b)throw clearInterval(this[_0x1201('0x6')]),new _0x3cd7f7(_0x1201('0x4e'),null);if(_0x1201('0x52')===_0x2f3f1b&&console[_0x1201('0xf')](_0x1201('0x53')),_0x1201('0x46')===_0x2f3f1b)throw clearInterval(this[_0x1201('0x6')]),new _0x3cd7f7('ai-trial-license-key-reached-limit-changes',null);_0x1201('0x21')===_0x2f3f1b&&clearInterval(this[_0x1201('0x6')]);},0x3e8);}[_0x1201('0x51')](){this[_0x1201('0x6')]&&clearInterval(this[_0x1201('0x6')]);}}export function getDefaultCommands(_0x5476d3){return[{'groupId':_0x1201('0x33'),'groupLabel':_0x4b6a32(_0x5476d3,_0x1201('0x20')),'commands':[{'id':'improveWriting','label':_0x4b6a32(_0x5476d3,'Improve\x20writing'),'prompt':_0x1201('0xc')},{'id':_0x1201('0x1d'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x50')),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':_0x1201('0x1f'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x2f')),'prompt':_0x1201('0x26')},{'id':_0x1201('0x17'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x5')),'prompt':_0x1201('0x45')}]},{'groupId':_0x1201('0x32'),'groupLabel':_0x4b6a32(_0x5476d3,_0x1201('0x4c')),'commands':[{'id':'summarize','label':_0x4b6a32(_0x5476d3,_0x1201('0x1')),'prompt':_0x1201('0x2')},{'id':_0x1201('0x10'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x1c')),'prompt':_0x1201('0x55')}]},{'groupId':_0x1201('0x1b'),'groupLabel':_0x4b6a32(_0x5476d3,'Change\x20tone'),'commands':[{'id':_0x1201('0x2b'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x7')),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':_0x1201('0x2a'),'label':_0x4b6a32(_0x5476d3,'Casual'),'prompt':_0x1201('0x4')},{'id':_0x1201('0x24'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x40')),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':_0x1201('0xe'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x22')),'prompt':_0x1201('0x39')},{'id':_0x1201('0x3f'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x2d')),'prompt':_0x1201('0x3')}]},{'groupId':'changeStyle','groupLabel':_0x4b6a32(_0x5476d3,'Change\x20style'),'commands':[{'id':'business','label':_0x4b6a32(_0x5476d3,_0x1201('0x11')),'prompt':_0x1201('0x47')},{'id':_0x1201('0x29'),'label':_0x4b6a32(_0x5476d3,'Legal'),'prompt':_0x1201('0x27')},{'id':'journalism','label':_0x4b6a32(_0x5476d3,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':_0x1201('0x16'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x3e')),'prompt':_0x1201('0x28')}]},{'groupId':_0x1201('0x23'),'groupLabel':_0x4b6a32(_0x5476d3,'Translate'),'commands':[{'id':_0x1201('0xa'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x9'))]),'prompt':_0x1201('0x1a')},{'id':_0x1201('0x30'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x4b'))]),'prompt':_0x1201('0x12')},{'id':_0x1201('0x44'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,'Portuguese')]),'prompt':_0x1201('0x31')},{'id':'translateGerman','label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x25'))]),'prompt':_0x1201('0x48')},{'id':'translateFrench','label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x2e'))]),'prompt':_0x1201('0x34')},{'id':_0x1201('0x49'),'label':_0x4b6a32(_0x5476d3,'Translate\x20to\x20%0',[_0x4b6a32(_0x5476d3,_0x1201('0x3c'))]),'prompt':_0x1201('0x43')},{'id':_0x1201('0x14'),'label':_0x4b6a32(_0x5476d3,'Translate\x20to\x20%0',[_0x4b6a32(_0x5476d3,'Hindi')]),'prompt':_0x1201('0x3a')},{'id':_0x1201('0x4d'),'label':_0x4b6a32(_0x5476d3,_0x1201('0x8'),[_0x4b6a32(_0x5476d3,_0x1201('0x15'))]),'prompt':_0x1201('0x3b')}]}];}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2782=['processor','ck-fake-ai-selection','ck-fake-ai-selection-candidate','get','end','conversion','model','document','addMarker','markerToElement','push','selection','insertContentBelow','getRange','ai.useTheme','from','editor','ai-ui-candidate','markers','data','isAtEnd','hideFakeVisualSelection','canEditAt','start','init','isContent','getSelectedBlocks','pluginName','AIAssistantEditing','createSelection','config','showFakeVisualSelection','change','getFirstRange','toView','updateMarker','ck-ai-assistant-ui_theme','span','ai-ui','length','toModel','setSelection','ck-fake-ai-selection_collapsed','pop','insertContent','removeMarker','getLastPosition','for','editingDowncast','has','schema'];(function(_0x24cb2d,_0x278274){const _0x28abe5=function(_0xb5d823){while(--_0xb5d823){_0x24cb2d['push'](_0x24cb2d['shift']());}};_0x28abe5(++_0x278274);}(_0x2782,0xfe));const _0x28ab=function(_0x24cb2d,_0x278274){_0x24cb2d=_0x24cb2d-0x0;let _0x28abe5=_0x2782[_0x24cb2d];return _0x28abe5;};import{Plugin as _0x3c9018}from'ckeditor5/src/core.js';const s=_0x28ab('0x27'),c=_0x28ab('0x12');export default class i extends _0x3c9018{static get[_0x28ab('0x1c')](){return _0x28ab('0x1d');}[_0x28ab('0x19')](){const {editor:_0x180c81}=this,_0x46b55d=[_0x28ab('0x2')];_0x180c81[_0x28ab('0x1f')][_0x28ab('0x4')](_0x28ab('0xf'))&&_0x46b55d[_0x28ab('0xb')](_0x28ab('0x25')),_0x180c81[_0x28ab('0x6')]['for'](_0x28ab('0x31'))['markerToHighlight']({'model':s,'view':{'classes':_0x46b55d}}),_0x180c81['conversion'][_0x28ab('0x30')](_0x28ab('0x31'))[_0x28ab('0xa')]({'model':s,'view':{'name':'span','classes':['ck-fake-ai-selection',_0x28ab('0x2b')]}}),_0x180c81[_0x28ab('0x6')][_0x28ab('0x30')](_0x28ab('0x31'))['markerToHighlight']({'model':c,'view':{'classes':[_0x28ab('0x3')]}}),_0x180c81[_0x28ab('0x6')][_0x28ab('0x30')](_0x28ab('0x31'))['markerToElement']({'model':c,'view':{'name':_0x28ab('0x26'),'classes':['ck-fake-ai-selection-candidate',_0x28ab('0x2b')]}});}[_0x28ab('0x20')](_0x5ecd80){const _0x52866e=this[_0x28ab('0x11')]['model'],_0x4306db=_0x5ecd80?c:s;_0x52866e[_0x28ab('0x21')](_0x5df0b2=>{const _0x2a66dd=_0x52866e[_0x28ab('0x8')][_0x28ab('0xc')][_0x28ab('0x22')]();if(_0x52866e['markers'][_0x28ab('0x32')](_0x4306db))_0x5df0b2[_0x28ab('0x24')](_0x4306db,{'range':_0x2a66dd});else{if(_0x2a66dd[_0x28ab('0x18')][_0x28ab('0x15')]){const _0x359c41=_0x2a66dd[_0x28ab('0x18')]['getLastMatchingPosition'](({item:_0x42b487})=>!_0x52866e[_0x28ab('0x0')][_0x28ab('0x1a')](_0x42b487),{'boundaries':_0x2a66dd});_0x5df0b2[_0x28ab('0x9')](_0x4306db,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5df0b2['createRange'](_0x359c41,_0x2a66dd[_0x28ab('0x5')])});}else _0x5df0b2['addMarker'](_0x4306db,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2a66dd});}});}[_0x28ab('0x16')](_0x5de48a){const _0x8f25f6=this[_0x28ab('0x11')]['model'],_0x506be8=_0x5de48a?c:s;_0x8f25f6[_0x28ab('0x13')][_0x28ab('0x32')](_0x506be8)&&_0x8f25f6[_0x28ab('0x21')](_0x2feff8=>{_0x2feff8[_0x28ab('0x2e')](_0x506be8);});}[_0x28ab('0x2d')](_0x5af56c,_0x2399ff){const _0x569475=_0x2399ff||this[_0x28ab('0x11')][_0x28ab('0x7')][_0x28ab('0x13')]['get'](s)[_0x28ab('0xe')]();if(!this[_0x28ab('0x11')]['model'][_0x28ab('0x17')](_0x569475))return;const _0x539fd7=this[_0x28ab('0x11')][_0x28ab('0x14')][_0x28ab('0x1')][_0x28ab('0x23')](_0x5af56c),_0x518b92=this[_0x28ab('0x11')][_0x28ab('0x14')][_0x28ab('0x29')](_0x539fd7);this['editor'][_0x28ab('0x7')]['change'](_0x2cc78f=>{this['hideFakeVisualSelection']();const _0x5eef1e=this['editor']['model'][_0x28ab('0x2d')](_0x518b92,_0x569475);_0x5eef1e&&_0x2cc78f[_0x28ab('0x2a')](_0x5eef1e);});}[_0x28ab('0xd')](_0x41318f){const {model:_0x5aef15}=this[_0x28ab('0x11')],_0xf56b2d=Array[_0x28ab('0x10')](_0x5aef15[_0x28ab('0x1e')](this[_0x28ab('0x11')]['model'][_0x28ab('0x13')]['get'](s)['getRange']())[_0x28ab('0x1b')]()),_0x3c0f2a=_0xf56b2d[_0x28ab('0x28')]?_0x5aef15['createPositionAfter'](_0xf56b2d[_0x28ab('0x2c')]()):_0x5aef15[_0x28ab('0x8')][_0x28ab('0xc')][_0x28ab('0x2f')]();this[_0x28ab('0x2d')](_0x41318f,_0x3c0f2a);}}
|