@promptbook/ollama 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 +34 -101
- 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 +34 -101
- 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
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/book
|
|
20
20
|
*/
|
|
21
|
-
const BOOK_LANGUAGE_VERSION = '
|
|
21
|
+
const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
22
22
|
/**
|
|
23
23
|
* The version of the Promptbook engine
|
|
24
24
|
*
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -839,6 +839,23 @@
|
|
|
839
839
|
* TODO: Maybe connect with textures
|
|
840
840
|
*/
|
|
841
841
|
|
|
842
|
+
/**
|
|
843
|
+
* Makes color transformer which returns a grayscale version of the color
|
|
844
|
+
*
|
|
845
|
+
* @param amount from 0 to 1
|
|
846
|
+
*
|
|
847
|
+
* @public exported from `@promptbook/color`
|
|
848
|
+
*/
|
|
849
|
+
function grayscale(amount) {
|
|
850
|
+
return ({ red, green, blue, alpha }) => {
|
|
851
|
+
const average = (red + green + blue) / 3;
|
|
852
|
+
red = Math.round(average * amount + red * (1 - amount));
|
|
853
|
+
green = Math.round(average * amount + green * (1 - amount));
|
|
854
|
+
blue = Math.round(average * amount + blue * (1 - amount));
|
|
855
|
+
return Color.fromValues(red, green, blue, alpha);
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
|
|
842
859
|
/**
|
|
843
860
|
* Converts HSL values to RGB values
|
|
844
861
|
*
|
|
@@ -954,102 +971,6 @@
|
|
|
954
971
|
* TODO: Maybe implement by mix+hsl
|
|
955
972
|
*/
|
|
956
973
|
|
|
957
|
-
/**
|
|
958
|
-
* Calculates distance between two colors
|
|
959
|
-
*
|
|
960
|
-
* @param color1 first color
|
|
961
|
-
* @param color2 second color
|
|
962
|
-
*
|
|
963
|
-
* Note: This function is inefficient. Use colorDistanceSquared instead if possible.
|
|
964
|
-
*
|
|
965
|
-
* @public exported from `@promptbook/color`
|
|
966
|
-
*/
|
|
967
|
-
/**
|
|
968
|
-
* Calculates distance between two colors without square root
|
|
969
|
-
*
|
|
970
|
-
* @param color1 first color
|
|
971
|
-
* @param color2 second color
|
|
972
|
-
*
|
|
973
|
-
* @public exported from `@promptbook/color`
|
|
974
|
-
*/
|
|
975
|
-
function colorDistanceSquared(color1, color2) {
|
|
976
|
-
const rmean = (color1.red + color2.red) / 2;
|
|
977
|
-
const r = color1.red - color2.red;
|
|
978
|
-
const g = color1.green - color2.green;
|
|
979
|
-
const b = color1.blue - color2.blue;
|
|
980
|
-
const weightR = 2 + rmean / 256;
|
|
981
|
-
const weightG = 4.0;
|
|
982
|
-
const weightB = 2 + (255 - rmean) / 256;
|
|
983
|
-
const distance = weightR * r * r + weightG * g * g + weightB * b * b;
|
|
984
|
-
return distance;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
/**
|
|
988
|
-
* Makes color transformer which finds the nearest color from the given list
|
|
989
|
-
*
|
|
990
|
-
* @param colors array of colors to choose from
|
|
991
|
-
*
|
|
992
|
-
* @public exported from `@promptbook/color`
|
|
993
|
-
*/
|
|
994
|
-
function nearest(...colors) {
|
|
995
|
-
return (color) => {
|
|
996
|
-
const distances = colors.map((c) => colorDistanceSquared(c, color));
|
|
997
|
-
const minDistance = Math.min(...distances);
|
|
998
|
-
const minIndex = distances.indexOf(minDistance);
|
|
999
|
-
const nearestColor = colors[minIndex];
|
|
1000
|
-
return nearestColor;
|
|
1001
|
-
};
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
/**
|
|
1005
|
-
* Color transformer which returns the negative color
|
|
1006
|
-
*
|
|
1007
|
-
* @public exported from `@promptbook/color`
|
|
1008
|
-
*/
|
|
1009
|
-
function negative(color) {
|
|
1010
|
-
const r = 255 - color.red;
|
|
1011
|
-
const g = 255 - color.green;
|
|
1012
|
-
const b = 255 - color.blue;
|
|
1013
|
-
return Color.fromValues(r, g, b, color.alpha);
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Makes color transformer which finds the furthest color from the given list
|
|
1018
|
-
*
|
|
1019
|
-
* @param colors array of colors to choose from
|
|
1020
|
-
*
|
|
1021
|
-
* @public exported from `@promptbook/color`
|
|
1022
|
-
*/
|
|
1023
|
-
function furthest(...colors) {
|
|
1024
|
-
return (color) => {
|
|
1025
|
-
const furthestColor = negative(nearest(...colors.map(negative))(color));
|
|
1026
|
-
return furthestColor;
|
|
1027
|
-
};
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* Makes color transformer which finds the best text color (black or white) for the given background color
|
|
1031
|
-
*
|
|
1032
|
-
* @public exported from `@promptbook/color`
|
|
1033
|
-
*/
|
|
1034
|
-
furthest(Color.get('white'), Color.from('black'));
|
|
1035
|
-
|
|
1036
|
-
/**
|
|
1037
|
-
* Makes color transformer which returns a grayscale version of the color
|
|
1038
|
-
*
|
|
1039
|
-
* @param amount from 0 to 1
|
|
1040
|
-
*
|
|
1041
|
-
* @public exported from `@promptbook/color`
|
|
1042
|
-
*/
|
|
1043
|
-
function grayscale(amount) {
|
|
1044
|
-
return ({ red, green, blue, alpha }) => {
|
|
1045
|
-
const average = (red + green + blue) / 3;
|
|
1046
|
-
red = Math.round(average * amount + red * (1 - amount));
|
|
1047
|
-
green = Math.round(average * amount + green * (1 - amount));
|
|
1048
|
-
blue = Math.round(average * amount + blue * (1 - amount));
|
|
1049
|
-
return Color.fromValues(red, green, blue, alpha);
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
974
|
/**
|
|
1054
975
|
* Makes color transformer which saturate the given color
|
|
1055
976
|
*
|
|
@@ -1565,6 +1486,7 @@
|
|
|
1565
1486
|
/**
|
|
1566
1487
|
* Generates random token
|
|
1567
1488
|
*
|
|
1489
|
+
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
1568
1490
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
1569
1491
|
*
|
|
1570
1492
|
* @private internal helper function
|
|
@@ -1574,6 +1496,7 @@
|
|
|
1574
1496
|
return crypto.randomBytes(randomness).toString('hex');
|
|
1575
1497
|
}
|
|
1576
1498
|
/**
|
|
1499
|
+
* TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
1577
1500
|
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
1578
1501
|
*/
|
|
1579
1502
|
|
|
@@ -2033,7 +1956,7 @@
|
|
|
2033
1956
|
/**
|
|
2034
1957
|
* List of available OpenAI models with pricing
|
|
2035
1958
|
*
|
|
2036
|
-
* Note: Synced with official API docs at 2025-
|
|
1959
|
+
* Note: Synced with official API docs at 2025-11-19
|
|
2037
1960
|
*
|
|
2038
1961
|
* @see https://platform.openai.com/docs/models/
|
|
2039
1962
|
* @see https://openai.com/api/pricing/
|
|
@@ -2043,11 +1966,21 @@
|
|
|
2043
1966
|
name: 'OPENAI_MODELS',
|
|
2044
1967
|
value: [
|
|
2045
1968
|
/**/
|
|
1969
|
+
{
|
|
1970
|
+
modelVariant: 'CHAT',
|
|
1971
|
+
modelTitle: 'gpt-5.1',
|
|
1972
|
+
modelName: 'gpt-5.1',
|
|
1973
|
+
modelDescription: 'The best model for coding and agentic tasks with configurable reasoning effort.',
|
|
1974
|
+
pricing: {
|
|
1975
|
+
prompt: pricing(`$1.25 / 1M tokens`),
|
|
1976
|
+
output: pricing(`$10.00 / 1M tokens`),
|
|
1977
|
+
},
|
|
1978
|
+
},
|
|
2046
1979
|
{
|
|
2047
1980
|
modelVariant: 'CHAT',
|
|
2048
1981
|
modelTitle: 'gpt-5',
|
|
2049
1982
|
modelName: 'gpt-5',
|
|
2050
|
-
modelDescription: "OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window. Features revolutionary improvements in complex problem-solving, scientific reasoning, and creative tasks. Demonstrates human-level performance across diverse domains with enhanced safety measures and alignment. Represents the next generation of AI with superior understanding, nuanced responses, and advanced multimodal capabilities.",
|
|
1983
|
+
modelDescription: "OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window. Features revolutionary improvements in complex problem-solving, scientific reasoning, and creative tasks. Demonstrates human-level performance across diverse domains with enhanced safety measures and alignment. Represents the next generation of AI with superior understanding, nuanced responses, and advanced multimodal capabilities. DEPRECATED: Use gpt-5.1 instead.",
|
|
2051
1984
|
pricing: {
|
|
2052
1985
|
prompt: pricing(`$1.25 / 1M tokens`),
|
|
2053
1986
|
output: pricing(`$10.00 / 1M tokens`),
|
|
@@ -3794,7 +3727,7 @@
|
|
|
3794
3727
|
...ollamaOptions,
|
|
3795
3728
|
apiKey: 'ollama',
|
|
3796
3729
|
isProxied: false, // <- Note: Ollama is always local
|
|
3797
|
-
};
|
|
3730
|
+
}; /* <- Note: [🤛] */
|
|
3798
3731
|
super(openAiCompatibleOptions);
|
|
3799
3732
|
}
|
|
3800
3733
|
get title() {
|