@promptbook/editable 0.103.0-42 → 0.103.0-44
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 +6 -18
- package/esm/index.es.js +19 -98
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +6 -0
- package/esm/typings/src/_packages/node.index.d.ts +0 -2
- package/esm/typings/src/_packages/types.index.d.ts +22 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -4
- package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +1 -1
- package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +1 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +1 -1
- package/esm/typings/src/book-components/Qr/useQrCode.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/list-models.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/login.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/start-agents-server.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -1
- package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +1 -1
- package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -29
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +107 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +129 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
- package/esm/typings/src/config.d.ts +1 -1
- package/esm/typings/src/errors/0-index.d.ts +3 -0
- package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -1
- package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
- package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +5 -2
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +4 -2
- package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +4 -3
- package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
- package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +0 -19
- package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +1 -1
- package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +5 -1
- package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +1 -1
- package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -1
- package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +4 -1
- package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +1 -1
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +4 -1
- package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +19 -1
- package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
- package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
- package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +1 -1
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +1 -1
- package/esm/typings/src/utils/files/$induceBookDownload.d.ts +2 -2
- package/esm/typings/src/utils/files/$induceFileDownload.d.ts +2 -2
- package/esm/typings/src/utils/files/ObjectUrl.d.ts +1 -1
- package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +6 -0
- package/esm/typings/src/utils/organization/$side_effect.d.ts +1 -1
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +25 -0
- package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
- package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
- package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
- package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +1 -1
- package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +19 -98
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.d.ts +0 -89
- package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.test.d.ts +0 -1
- package/esm/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
- package/esm/typings/src/execution/utils/logLlmCall.d.ts +0 -8
package/umd/index.umd.js
CHANGED
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
* @generated
|
|
17
17
|
* @see https://github.com/webgptorg/book
|
|
18
18
|
*/
|
|
19
|
-
const BOOK_LANGUAGE_VERSION = '
|
|
19
|
+
const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
20
20
|
/**
|
|
21
21
|
* The version of the Promptbook engine
|
|
22
22
|
*
|
|
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-44';
|
|
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
|
|
@@ -687,6 +687,23 @@
|
|
|
687
687
|
* TODO: Maybe connect with textures
|
|
688
688
|
*/
|
|
689
689
|
|
|
690
|
+
/**
|
|
691
|
+
* Makes color transformer which returns a grayscale version of the color
|
|
692
|
+
*
|
|
693
|
+
* @param amount from 0 to 1
|
|
694
|
+
*
|
|
695
|
+
* @public exported from `@promptbook/color`
|
|
696
|
+
*/
|
|
697
|
+
function grayscale(amount) {
|
|
698
|
+
return ({ red, green, blue, alpha }) => {
|
|
699
|
+
const average = (red + green + blue) / 3;
|
|
700
|
+
red = Math.round(average * amount + red * (1 - amount));
|
|
701
|
+
green = Math.round(average * amount + green * (1 - amount));
|
|
702
|
+
blue = Math.round(average * amount + blue * (1 - amount));
|
|
703
|
+
return Color.fromValues(red, green, blue, alpha);
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
|
|
690
707
|
/**
|
|
691
708
|
* Converts HSL values to RGB values
|
|
692
709
|
*
|
|
@@ -802,102 +819,6 @@
|
|
|
802
819
|
* TODO: Maybe implement by mix+hsl
|
|
803
820
|
*/
|
|
804
821
|
|
|
805
|
-
/**
|
|
806
|
-
* Calculates distance between two colors
|
|
807
|
-
*
|
|
808
|
-
* @param color1 first color
|
|
809
|
-
* @param color2 second color
|
|
810
|
-
*
|
|
811
|
-
* Note: This function is inefficient. Use colorDistanceSquared instead if possible.
|
|
812
|
-
*
|
|
813
|
-
* @public exported from `@promptbook/color`
|
|
814
|
-
*/
|
|
815
|
-
/**
|
|
816
|
-
* Calculates distance between two colors without square root
|
|
817
|
-
*
|
|
818
|
-
* @param color1 first color
|
|
819
|
-
* @param color2 second color
|
|
820
|
-
*
|
|
821
|
-
* @public exported from `@promptbook/color`
|
|
822
|
-
*/
|
|
823
|
-
function colorDistanceSquared(color1, color2) {
|
|
824
|
-
const rmean = (color1.red + color2.red) / 2;
|
|
825
|
-
const r = color1.red - color2.red;
|
|
826
|
-
const g = color1.green - color2.green;
|
|
827
|
-
const b = color1.blue - color2.blue;
|
|
828
|
-
const weightR = 2 + rmean / 256;
|
|
829
|
-
const weightG = 4.0;
|
|
830
|
-
const weightB = 2 + (255 - rmean) / 256;
|
|
831
|
-
const distance = weightR * r * r + weightG * g * g + weightB * b * b;
|
|
832
|
-
return distance;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* Makes color transformer which finds the nearest color from the given list
|
|
837
|
-
*
|
|
838
|
-
* @param colors array of colors to choose from
|
|
839
|
-
*
|
|
840
|
-
* @public exported from `@promptbook/color`
|
|
841
|
-
*/
|
|
842
|
-
function nearest(...colors) {
|
|
843
|
-
return (color) => {
|
|
844
|
-
const distances = colors.map((c) => colorDistanceSquared(c, color));
|
|
845
|
-
const minDistance = Math.min(...distances);
|
|
846
|
-
const minIndex = distances.indexOf(minDistance);
|
|
847
|
-
const nearestColor = colors[minIndex];
|
|
848
|
-
return nearestColor;
|
|
849
|
-
};
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* Color transformer which returns the negative color
|
|
854
|
-
*
|
|
855
|
-
* @public exported from `@promptbook/color`
|
|
856
|
-
*/
|
|
857
|
-
function negative(color) {
|
|
858
|
-
const r = 255 - color.red;
|
|
859
|
-
const g = 255 - color.green;
|
|
860
|
-
const b = 255 - color.blue;
|
|
861
|
-
return Color.fromValues(r, g, b, color.alpha);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* Makes color transformer which finds the furthest color from the given list
|
|
866
|
-
*
|
|
867
|
-
* @param colors array of colors to choose from
|
|
868
|
-
*
|
|
869
|
-
* @public exported from `@promptbook/color`
|
|
870
|
-
*/
|
|
871
|
-
function furthest(...colors) {
|
|
872
|
-
return (color) => {
|
|
873
|
-
const furthestColor = negative(nearest(...colors.map(negative))(color));
|
|
874
|
-
return furthestColor;
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Makes color transformer which finds the best text color (black or white) for the given background color
|
|
879
|
-
*
|
|
880
|
-
* @public exported from `@promptbook/color`
|
|
881
|
-
*/
|
|
882
|
-
furthest(Color.get('white'), Color.from('black'));
|
|
883
|
-
|
|
884
|
-
/**
|
|
885
|
-
* Makes color transformer which returns a grayscale version of the color
|
|
886
|
-
*
|
|
887
|
-
* @param amount from 0 to 1
|
|
888
|
-
*
|
|
889
|
-
* @public exported from `@promptbook/color`
|
|
890
|
-
*/
|
|
891
|
-
function grayscale(amount) {
|
|
892
|
-
return ({ red, green, blue, alpha }) => {
|
|
893
|
-
const average = (red + green + blue) / 3;
|
|
894
|
-
red = Math.round(average * amount + red * (1 - amount));
|
|
895
|
-
green = Math.round(average * amount + green * (1 - amount));
|
|
896
|
-
blue = Math.round(average * amount + blue * (1 - amount));
|
|
897
|
-
return Color.fromValues(red, green, blue, alpha);
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
|
|
901
822
|
/**
|
|
902
823
|
* Makes color transformer which saturate the given color
|
|
903
824
|
*
|