@promptbook/website-crawler 0.103.0-56 → 0.103.0-67
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/esm/index.es.js +22 -4
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +2 -2
- package/esm/typings/src/_packages/types.index.d.ts +6 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +3 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +4 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +4 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +3 -1
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/Color.d.ts +1 -1
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +6 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +3 -3
- package/umd/index.umd.js +22 -4
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +0 -29
package/esm/index.es.js
CHANGED
|
@@ -27,7 +27,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
27
27
|
* @generated
|
|
28
28
|
* @see https://github.com/webgptorg/promptbook
|
|
29
29
|
*/
|
|
30
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
30
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-67';
|
|
31
31
|
/**
|
|
32
32
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
33
33
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -337,15 +337,33 @@ class Color {
|
|
|
337
337
|
* @param color
|
|
338
338
|
* @returns Color object
|
|
339
339
|
*/
|
|
340
|
-
static from(color) {
|
|
341
|
-
if (color
|
|
340
|
+
static from(color, _isSingleValue = false) {
|
|
341
|
+
if (color === '') {
|
|
342
|
+
throw new Error(`Can not create color from empty string`);
|
|
343
|
+
}
|
|
344
|
+
else if (color instanceof Color) {
|
|
342
345
|
return take(color);
|
|
343
346
|
}
|
|
344
347
|
else if (Color.isColor(color)) {
|
|
345
348
|
return take(color);
|
|
346
349
|
}
|
|
347
350
|
else if (typeof color === 'string') {
|
|
348
|
-
|
|
351
|
+
try {
|
|
352
|
+
return Color.fromString(color);
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
356
|
+
if (_isSingleValue) {
|
|
357
|
+
throw error;
|
|
358
|
+
}
|
|
359
|
+
const parts = color.split(/[\s+,;|]/);
|
|
360
|
+
if (parts.length > 0) {
|
|
361
|
+
return Color.from(parts[0].trim(), true);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
throw new Error(`Can not create color from given string "${color}"`);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
349
367
|
}
|
|
350
368
|
else {
|
|
351
369
|
console.error({ color });
|