@promptbook/markdown-utils 0.103.0-48 → 0.103.0-50
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/servers.d.ts +1 -0
- package/esm/typings/src/_packages/components.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +12 -2
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +20 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +14 -8
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
- package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +28 -0
- package/esm/typings/src/commitments/index.d.ts +2 -1
- package/esm/typings/src/config.d.ts +1 -0
- package/esm/typings/src/errors/DatabaseError.d.ts +2 -2
- package/esm/typings/src/errors/WrappedError.d.ts +2 -2
- package/esm/typings/src/execution/ExecutionTask.d.ts +2 -2
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +6 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +19 -3
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +13 -1
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +11 -2
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +6 -1
- package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
- package/esm/typings/src/utils/color/Color.d.ts +7 -0
- package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
- package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
- package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
- package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
- package/esm/typings/src/utils/organization/$side_effect.d.ts +2 -2
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
- package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
- package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
- package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
- package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +22 -4
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -23,7 +23,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-50';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -502,6 +502,9 @@ class Color {
|
|
|
502
502
|
if (hex.length === 3) {
|
|
503
503
|
return Color.fromHex3(hex);
|
|
504
504
|
}
|
|
505
|
+
if (hex.length === 4) {
|
|
506
|
+
return Color.fromHex4(hex);
|
|
507
|
+
}
|
|
505
508
|
if (hex.length === 6) {
|
|
506
509
|
return Color.fromHex6(hex);
|
|
507
510
|
}
|
|
@@ -522,6 +525,19 @@ class Color {
|
|
|
522
525
|
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
523
526
|
return take(new Color(r, g, b));
|
|
524
527
|
}
|
|
528
|
+
/**
|
|
529
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
530
|
+
*
|
|
531
|
+
* @param color in hex for example `09df`
|
|
532
|
+
* @returns Color object
|
|
533
|
+
*/
|
|
534
|
+
static fromHex4(hex) {
|
|
535
|
+
const r = parseInt(hex.substr(0, 1), 16) * 16;
|
|
536
|
+
const g = parseInt(hex.substr(1, 1), 16) * 16;
|
|
537
|
+
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
538
|
+
const a = parseInt(hex.substr(3, 1), 16) * 16;
|
|
539
|
+
return take(new Color(r, g, b, a));
|
|
540
|
+
}
|
|
525
541
|
/**
|
|
526
542
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
527
543
|
*
|
|
@@ -712,7 +728,8 @@ class Color {
|
|
|
712
728
|
* @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
|
|
713
729
|
*/
|
|
714
730
|
static isHexColorString(value) {
|
|
715
|
-
return typeof value === 'string' &&
|
|
731
|
+
return (typeof value === 'string' &&
|
|
732
|
+
/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
|
|
716
733
|
}
|
|
717
734
|
/**
|
|
718
735
|
* Creates new Color object
|
|
@@ -1045,6 +1062,7 @@ const PROMPTBOOK_COLOR = Color.fromHex('#79EAFD');
|
|
|
1045
1062
|
({
|
|
1046
1063
|
TITLE: Color.fromHex('#244EA8'),
|
|
1047
1064
|
LINE: Color.fromHex('#eeeeee'),
|
|
1065
|
+
SEPARATOR: Color.fromHex('#cccccc'),
|
|
1048
1066
|
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
1049
1067
|
PARAMETER: Color.fromHex('#8e44ad'),
|
|
1050
1068
|
});
|
|
@@ -1895,7 +1913,7 @@ function deepClone(objectValue) {
|
|
|
1895
1913
|
TODO: [🧠] Is there a better implementation?
|
|
1896
1914
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
1897
1915
|
> for (const propertyName of propertyNames) {
|
|
1898
|
-
> const value = (objectValue as
|
|
1916
|
+
> const value = (objectValue as chococake)[propertyName];
|
|
1899
1917
|
> if (value && typeof value === 'object') {
|
|
1900
1918
|
> deepClone(value);
|
|
1901
1919
|
> }
|
|
@@ -2742,7 +2760,7 @@ class DatabaseError extends Error {
|
|
|
2742
2760
|
}
|
|
2743
2761
|
}
|
|
2744
2762
|
/**
|
|
2745
|
-
* TODO:
|
|
2763
|
+
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
2746
2764
|
*/
|
|
2747
2765
|
|
|
2748
2766
|
/**
|