@promptbook/remote-server 0.101.0-0 → 0.101.0-10
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/README.md +45 -0
- package/esm/index.es.js +31 -6
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +18 -0
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +6 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +41 -3
- package/esm/typings/src/book-2.0/agent-source/parseParameters.d.ts +13 -0
- package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +8 -2
- package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +59 -0
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +8 -2
- package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +45 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +46 -0
- package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +47 -0
- package/esm/typings/src/book-2.0/commitments/META/META.d.ts +62 -0
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +8 -2
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +8 -2
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +8 -2
- package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +46 -0
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +8 -2
- package/esm/typings/src/book-2.0/commitments/index.d.ts +7 -3
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/MockedChat.d.ts +46 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/index.d.ts +3 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +10 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +3 -0
- package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +0 -5
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +28 -2
- package/esm/typings/src/book-components/Chat/Chat/constants.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/examples/ChatMarkdownDemo.d.ts +16 -0
- package/esm/typings/src/book-components/Chat/utils/renderMarkdown.d.ts +21 -0
- package/esm/typings/src/book-components/Chat/utils/renderMarkdown.test.d.ts +1 -0
- package/esm/typings/src/book-components/icons/ArrowIcon.d.ts +9 -0
- package/esm/typings/src/book-components/icons/ResetIcon.d.ts +6 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +8 -0
- package/esm/typings/src/book-components/icons/TemplateIcon.d.ts +8 -0
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +2 -0
- package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +2 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextQuotes.d.ts +1 -0
- package/esm/typings/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -0
- package/esm/typings/src/utils/markdown/prettifyMarkdown.d.ts +8 -0
- package/esm/typings/src/utils/markdown/promptbookifyAiText.d.ts +1 -0
- package/esm/typings/src/utils/normalization/capitalize.d.ts +2 -0
- package/esm/typings/src/utils/normalization/decapitalize.d.ts +3 -1
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.d.ts +2 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +2 -0
- package/esm/typings/src/utils/parseNumber.d.ts +1 -0
- package/esm/typings/src/utils/removeEmojis.d.ts +2 -0
- package/esm/typings/src/utils/removeQuotes.d.ts +1 -0
- package/esm/typings/src/utils/serialization/deepClone.d.ts +1 -0
- package/esm/typings/src/utils/trimCodeBlock.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +1 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +36 -10
- package/umd/index.umd.js.map +1 -1
package/umd/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('colors'), require('express'), require('express-openapi-validator'), require('http'), require('socket.io'), require('spacetrim'), require('swagger-ui-express'), require('waitasecond'), require('crypto'), require('child_process'), require('fs/promises'), require('path'), require('rxjs'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'colors', 'express', 'express-openapi-validator', 'http', 'socket.io', 'spacetrim', 'swagger-ui-express', 'waitasecond', 'crypto', 'child_process', 'fs/promises', 'path', 'rxjs', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.colors, global.express, global.OpenApiValidator, global.http, global.socket_io, global.spaceTrim, global.swaggerUi, global.waitasecond, global.crypto, global.child_process, global.promises, global.path, global.rxjs, global.
|
|
5
|
-
})(this, (function (exports, colors, express, OpenApiValidator, http, socket_io, spaceTrim, swaggerUi, waitasecond, crypto, child_process, promises, path, rxjs,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('colors'), require('express'), require('express-openapi-validator'), require('http'), require('socket.io'), require('spacetrim'), require('swagger-ui-express'), require('waitasecond'), require('crypto'), require('child_process'), require('fs/promises'), require('path'), require('rxjs'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('crypto-js'), require('mime-types'), require('papaparse')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'colors', 'express', 'express-openapi-validator', 'http', 'socket.io', 'spacetrim', 'swagger-ui-express', 'waitasecond', 'crypto', 'child_process', 'fs/promises', 'path', 'rxjs', 'crypto-js/enc-hex', 'crypto-js/sha256', 'crypto-js', 'mime-types', 'papaparse'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.colors, global.express, global.OpenApiValidator, global.http, global.socket_io, global.spaceTrim, global.swaggerUi, global.waitasecond, global.crypto, global.child_process, global.promises, global.path, global.rxjs, global.hexEncoder, global.sha256, global.cryptoJs, global.mimeTypes, global.papaparse));
|
|
5
|
+
})(this, (function (exports, colors, express, OpenApiValidator, http, socket_io, spaceTrim, swaggerUi, waitasecond, crypto, child_process, promises, path, rxjs, hexEncoder, sha256, cryptoJs, mimeTypes, papaparse) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -30,8 +30,6 @@
|
|
|
30
30
|
var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
|
31
31
|
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
|
|
32
32
|
var swaggerUi__default = /*#__PURE__*/_interopDefaultLegacy(swaggerUi);
|
|
33
|
-
var parserHtml__default = /*#__PURE__*/_interopDefaultLegacy(parserHtml);
|
|
34
|
-
var parserMarkdown__default = /*#__PURE__*/_interopDefaultLegacy(parserMarkdown);
|
|
35
33
|
var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
|
|
36
34
|
var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
|
|
37
35
|
|
|
@@ -49,7 +47,7 @@
|
|
|
49
47
|
* @generated
|
|
50
48
|
* @see https://github.com/webgptorg/promptbook
|
|
51
49
|
*/
|
|
52
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-
|
|
50
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-10';
|
|
53
51
|
/**
|
|
54
52
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
55
53
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1314,6 +1312,7 @@
|
|
|
1314
1312
|
/**
|
|
1315
1313
|
* Creates a deep clone of the given object
|
|
1316
1314
|
*
|
|
1315
|
+
* Note: [🔂] This function is idempotent.
|
|
1317
1316
|
* Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
|
|
1318
1317
|
*
|
|
1319
1318
|
* @param objectValue The object to clone.
|
|
@@ -1479,6 +1478,7 @@
|
|
|
1479
1478
|
/**
|
|
1480
1479
|
* Tests if given string is valid URL.
|
|
1481
1480
|
*
|
|
1481
|
+
* Note: [🔂] This function is idempotent.
|
|
1482
1482
|
* Note: Dataurl are considered perfectly valid.
|
|
1483
1483
|
* Note: There are two similar functions:
|
|
1484
1484
|
* - `isValidUrl` which tests any URL
|
|
@@ -2387,10 +2387,20 @@
|
|
|
2387
2387
|
* @private withing the package because of HUGE size of prettier dependency
|
|
2388
2388
|
*/
|
|
2389
2389
|
function prettifyMarkdown(content) {
|
|
2390
|
+
// In browser/Next.js environments, just return the original content
|
|
2391
|
+
// since prettier parsers are not available and would cause bundling issues
|
|
2392
|
+
if (typeof window !== 'undefined') {
|
|
2393
|
+
return content;
|
|
2394
|
+
}
|
|
2390
2395
|
try {
|
|
2391
|
-
|
|
2396
|
+
// Use dynamic require to avoid static imports that cause bundling issues
|
|
2397
|
+
// This will only work in Node.js environments
|
|
2398
|
+
const prettierStandalone = eval('require')('prettier/standalone');
|
|
2399
|
+
const parserMarkdown = eval('require')('prettier/parser-markdown');
|
|
2400
|
+
const parserHtml = eval('require')('prettier/parser-html');
|
|
2401
|
+
return prettierStandalone.format(content, {
|
|
2392
2402
|
parser: 'markdown',
|
|
2393
|
-
plugins: [
|
|
2403
|
+
plugins: [parserMarkdown, parserHtml],
|
|
2394
2404
|
// TODO: DRY - make some import or auto-copy of .prettierrc
|
|
2395
2405
|
endOfLine: 'lf',
|
|
2396
2406
|
tabWidth: 4,
|
|
@@ -2416,6 +2426,8 @@
|
|
|
2416
2426
|
/**
|
|
2417
2427
|
* Makes first letter of a string uppercase
|
|
2418
2428
|
*
|
|
2429
|
+
* Note: [🔂] This function is idempotent.
|
|
2430
|
+
*
|
|
2419
2431
|
* @public exported from `@promptbook/utils`
|
|
2420
2432
|
*/
|
|
2421
2433
|
function capitalize(word) {
|
|
@@ -3256,6 +3268,8 @@
|
|
|
3256
3268
|
/**
|
|
3257
3269
|
* Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
|
|
3258
3270
|
*
|
|
3271
|
+
* Note: [🔂] This function is idempotent.
|
|
3272
|
+
*
|
|
3259
3273
|
* @param text The text string to be converted to SCREAMING_CASE format.
|
|
3260
3274
|
* @returns The normalized text in SCREAMING_CASE format.
|
|
3261
3275
|
* @example 'HELLO_WORLD'
|
|
@@ -3311,6 +3325,8 @@
|
|
|
3311
3325
|
/**
|
|
3312
3326
|
* Normalizes a text string to snake_case format.
|
|
3313
3327
|
*
|
|
3328
|
+
* Note: [🔂] This function is idempotent.
|
|
3329
|
+
*
|
|
3314
3330
|
* @param text The text string to be converted to snake_case format.
|
|
3315
3331
|
* @returns The normalized text in snake_case format.
|
|
3316
3332
|
* @example 'hello_world'
|
|
@@ -3728,6 +3744,8 @@
|
|
|
3728
3744
|
/**
|
|
3729
3745
|
* Removes diacritic marks (accents) from characters in a string.
|
|
3730
3746
|
*
|
|
3747
|
+
* Note: [🔂] This function is idempotent.
|
|
3748
|
+
*
|
|
3731
3749
|
* @param input The string containing diacritics to be normalized.
|
|
3732
3750
|
* @returns The string with diacritics removed or normalized.
|
|
3733
3751
|
* @public exported from `@promptbook/utils`
|
|
@@ -3882,6 +3900,8 @@
|
|
|
3882
3900
|
/**
|
|
3883
3901
|
* Removes emojis from a string and fix whitespaces
|
|
3884
3902
|
*
|
|
3903
|
+
* Note: [🔂] This function is idempotent.
|
|
3904
|
+
*
|
|
3885
3905
|
* @param text with emojis
|
|
3886
3906
|
* @returns text without emojis
|
|
3887
3907
|
* @public exported from `@promptbook/utils`
|
|
@@ -7040,7 +7060,9 @@
|
|
|
7040
7060
|
*/
|
|
7041
7061
|
|
|
7042
7062
|
/**
|
|
7043
|
-
* Makes first letter of a string
|
|
7063
|
+
* Makes first letter of a string lowercase
|
|
7064
|
+
*
|
|
7065
|
+
* Note: [🔂] This function is idempotent.
|
|
7044
7066
|
*
|
|
7045
7067
|
* @public exported from `@promptbook/utils`
|
|
7046
7068
|
*/
|
|
@@ -7110,6 +7132,8 @@
|
|
|
7110
7132
|
/**
|
|
7111
7133
|
* Take every whitespace (space, new line, tab) and replace it with a single space
|
|
7112
7134
|
*
|
|
7135
|
+
* Note: [🔂] This function is idempotent.
|
|
7136
|
+
*
|
|
7113
7137
|
* @public exported from `@promptbook/utils`
|
|
7114
7138
|
*/
|
|
7115
7139
|
function normalizeWhitespaces(sentence) {
|
|
@@ -7119,6 +7143,7 @@
|
|
|
7119
7143
|
/**
|
|
7120
7144
|
* Removes quotes from a string
|
|
7121
7145
|
*
|
|
7146
|
+
* Note: [🔂] This function is idempotent.
|
|
7122
7147
|
* Tip: This is very useful for post-processing of the result of the LLM model
|
|
7123
7148
|
* Note: This function removes only the same quotes from the beginning and the end of the string
|
|
7124
7149
|
* Note: There are two similar functions:
|
|
@@ -7142,6 +7167,7 @@
|
|
|
7142
7167
|
/**
|
|
7143
7168
|
* Function trimCodeBlock will trim starting and ending code block from the string if it is present.
|
|
7144
7169
|
*
|
|
7170
|
+
* Note: [🔂] This function is idempotent.
|
|
7145
7171
|
* Note: This is useful for post-processing of the result of the chat LLM model
|
|
7146
7172
|
* when the model wraps the result in the (markdown) code block.
|
|
7147
7173
|
*
|