@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.
Files changed (92) hide show
  1. package/README.md +6 -18
  2. package/esm/index.es.js +34 -101
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  5. package/esm/typings/src/_packages/node.index.d.ts +0 -2
  6. package/esm/typings/src/_packages/types.index.d.ts +22 -0
  7. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  8. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -4
  9. package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +1 -1
  10. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +1 -0
  11. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
  12. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  13. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
  14. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  15. package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +1 -1
  16. package/esm/typings/src/book-components/Qr/useQrCode.d.ts +1 -1
  17. package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +1 -1
  18. package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
  19. package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -1
  20. package/esm/typings/src/cli/cli-commands/list-models.d.ts +1 -1
  21. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +1 -1
  22. package/esm/typings/src/cli/cli-commands/login.d.ts +1 -1
  23. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  24. package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -1
  25. package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
  26. package/esm/typings/src/cli/cli-commands/start-agents-server.d.ts +1 -1
  27. package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
  28. package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -1
  29. package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +1 -1
  30. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -29
  31. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +107 -0
  32. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +129 -0
  33. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
  34. package/esm/typings/src/config.d.ts +1 -1
  35. package/esm/typings/src/errors/0-index.d.ts +3 -0
  36. package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
  37. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -1
  38. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
  39. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +1 -1
  40. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
  41. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  42. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  43. package/esm/typings/src/llm-providers/agent/Agent.d.ts +5 -2
  44. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
  45. package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +4 -2
  46. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +4 -3
  47. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -1
  48. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  49. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  50. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  51. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
  52. package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
  53. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +0 -19
  54. package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +1 -1
  55. package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +5 -1
  56. package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +1 -1
  57. package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -1
  58. package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +4 -1
  59. package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +1 -1
  60. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +4 -1
  61. package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
  62. package/esm/typings/src/types/typeAliases.d.ts +19 -1
  63. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  64. package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
  65. package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
  66. package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
  67. package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
  68. package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
  69. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
  70. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +1 -1
  71. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +1 -1
  72. package/esm/typings/src/utils/files/$induceBookDownload.d.ts +2 -2
  73. package/esm/typings/src/utils/files/$induceFileDownload.d.ts +2 -2
  74. package/esm/typings/src/utils/files/ObjectUrl.d.ts +1 -1
  75. package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +6 -0
  76. package/esm/typings/src/utils/organization/$side_effect.d.ts +1 -1
  77. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +25 -0
  78. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  79. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  80. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  81. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  82. package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
  83. package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +1 -1
  84. package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
  85. package/esm/typings/src/version.d.ts +1 -1
  86. package/package.json +2 -2
  87. package/umd/index.umd.js +34 -101
  88. package/umd/index.umd.js.map +1 -1
  89. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.d.ts +0 -89
  90. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.test.d.ts +0 -1
  91. package/esm/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
  92. package/esm/typings/src/execution/utils/logLlmCall.d.ts +0 -8
package/README.md CHANGED
@@ -9,8 +9,8 @@ Turn your company's scattered knowledge into AI ready Books
9
9
 
10
10
 
11
11
 
12
- [![NPM Version of ![Promptbook logo - cube with letters P and B](./design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
13
- [![Quality of package ![Promptbook logo - cube with letters P and B](./design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
12
+ [![NPM Version of ![Promptbook logo](./design/logo-h1.png) Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
13
+ [![Quality of package ![Promptbook logo](./design/logo-h1.png) Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
14
14
  [![Known Vulnerabilities](https://snyk.io/test/github/webgptorg/promptbook/badge.svg)](https://snyk.io/test/github/webgptorg/promptbook)
15
15
  [![🧪 Test Books](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml/badge.svg)](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml)
16
16
  [![🧪 Test build](https://github.com/webgptorg/promptbook/actions/workflows/test-build.yml/badge.svg)](https://github.com/webgptorg/promptbook/actions/workflows/test-build.yml)
@@ -23,11 +23,7 @@ Turn your company's scattered knowledge into AI ready Books
23
23
 
24
24
  ## 🌟 New Features
25
25
 
26
- - 🚀 **GPT-5 Support** - Now includes OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window
27
- - 💡 VS Code support for `.book` files with syntax highlighting and IntelliSense
28
- - 🐳 Official Docker image (`hejny/promptbook`) for seamless containerized usage
29
- - 🔥 Native support for OpenAI `o3-mini`, GPT-4 and other leading LLMs
30
- - 🔍 DeepSeek integration for advanced knowledge search
26
+ - **Gemini 3 Support**
31
27
 
32
28
 
33
29
 
@@ -120,7 +116,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
120
116
  Your job is to provide legal advice and support to the company and its employees.<br/>
121
117
  You are knowledgeable, professional, and detail-oriented.<br/>
122
118
  <br/>
123
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
119
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
124
120
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
125
121
 
126
122
  </td></tr></table>
@@ -142,7 +138,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
142
138
  **RULE** Always ensure compliance with laws and regulations.<br/>
143
139
  **RULE** Never provide legal advice outside your area of expertise.<br/>
144
140
  **RULE** Never provide legal advice about criminal law.<br/>
145
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
141
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
146
142
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
147
143
 
148
144
  </td></tr></table>
@@ -162,7 +158,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
162
158
  **RULE** Always ensure compliance with laws and regulations.<br/>
163
159
  **RULE** Never provide legal advice outside your area of expertise.<br/>
164
160
  **RULE** Never provide legal advice about criminal law.<br/>
165
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
161
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
166
162
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
167
163
  **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
168
164
 
@@ -213,14 +209,10 @@ Now you want to use it. There are several ways how to write your first book:
213
209
 
214
210
  We have written ai asistant in book who can help you with writing your first book.
215
211
 
216
-
217
-
218
212
  #### Your AI twin
219
213
 
220
214
  Copy your own behavior, personality, and knowledge into book and create your AI twin. It can help you with your work, personal life, or any other task.
221
215
 
222
-
223
-
224
216
  #### AI persona workpool
225
217
 
226
218
  Or you can pick from our library of pre-written books for various roles and tasks. You can find books for customer support, coding, marketing, sales, HR, legal, and many other roles.
@@ -340,8 +332,6 @@ Join our growing community of developers and users:
340
332
 
341
333
 
342
334
 
343
-
344
-
345
335
  ## 📚 Documentation
346
336
 
347
337
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -418,8 +408,6 @@ The following glossary is used to clarify certain concepts:
418
408
 
419
409
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
420
410
 
421
-
422
-
423
411
  ### 💯 Core concepts
424
412
 
425
413
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -11,14 +11,14 @@ import OpenAI from 'openai';
11
11
  * @generated
12
12
  * @see https://github.com/webgptorg/book
13
13
  */
14
- const BOOK_LANGUAGE_VERSION = '1.0.0';
14
+ const BOOK_LANGUAGE_VERSION = '2.0.0';
15
15
  /**
16
16
  * The version of the Promptbook engine
17
17
  *
18
18
  * @generated
19
19
  * @see https://github.com/webgptorg/promptbook
20
20
  */
21
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-42';
21
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
22
22
  /**
23
23
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
24
24
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -832,6 +832,23 @@ class Color {
832
832
  * TODO: Maybe connect with textures
833
833
  */
834
834
 
835
+ /**
836
+ * Makes color transformer which returns a grayscale version of the color
837
+ *
838
+ * @param amount from 0 to 1
839
+ *
840
+ * @public exported from `@promptbook/color`
841
+ */
842
+ function grayscale(amount) {
843
+ return ({ red, green, blue, alpha }) => {
844
+ const average = (red + green + blue) / 3;
845
+ red = Math.round(average * amount + red * (1 - amount));
846
+ green = Math.round(average * amount + green * (1 - amount));
847
+ blue = Math.round(average * amount + blue * (1 - amount));
848
+ return Color.fromValues(red, green, blue, alpha);
849
+ };
850
+ }
851
+
835
852
  /**
836
853
  * Converts HSL values to RGB values
837
854
  *
@@ -947,102 +964,6 @@ function lighten(amount) {
947
964
  * TODO: Maybe implement by mix+hsl
948
965
  */
949
966
 
950
- /**
951
- * Calculates distance between two colors
952
- *
953
- * @param color1 first color
954
- * @param color2 second color
955
- *
956
- * Note: This function is inefficient. Use colorDistanceSquared instead if possible.
957
- *
958
- * @public exported from `@promptbook/color`
959
- */
960
- /**
961
- * Calculates distance between two colors without square root
962
- *
963
- * @param color1 first color
964
- * @param color2 second color
965
- *
966
- * @public exported from `@promptbook/color`
967
- */
968
- function colorDistanceSquared(color1, color2) {
969
- const rmean = (color1.red + color2.red) / 2;
970
- const r = color1.red - color2.red;
971
- const g = color1.green - color2.green;
972
- const b = color1.blue - color2.blue;
973
- const weightR = 2 + rmean / 256;
974
- const weightG = 4.0;
975
- const weightB = 2 + (255 - rmean) / 256;
976
- const distance = weightR * r * r + weightG * g * g + weightB * b * b;
977
- return distance;
978
- }
979
-
980
- /**
981
- * Makes color transformer which finds the nearest color from the given list
982
- *
983
- * @param colors array of colors to choose from
984
- *
985
- * @public exported from `@promptbook/color`
986
- */
987
- function nearest(...colors) {
988
- return (color) => {
989
- const distances = colors.map((c) => colorDistanceSquared(c, color));
990
- const minDistance = Math.min(...distances);
991
- const minIndex = distances.indexOf(minDistance);
992
- const nearestColor = colors[minIndex];
993
- return nearestColor;
994
- };
995
- }
996
-
997
- /**
998
- * Color transformer which returns the negative color
999
- *
1000
- * @public exported from `@promptbook/color`
1001
- */
1002
- function negative(color) {
1003
- const r = 255 - color.red;
1004
- const g = 255 - color.green;
1005
- const b = 255 - color.blue;
1006
- return Color.fromValues(r, g, b, color.alpha);
1007
- }
1008
-
1009
- /**
1010
- * Makes color transformer which finds the furthest color from the given list
1011
- *
1012
- * @param colors array of colors to choose from
1013
- *
1014
- * @public exported from `@promptbook/color`
1015
- */
1016
- function furthest(...colors) {
1017
- return (color) => {
1018
- const furthestColor = negative(nearest(...colors.map(negative))(color));
1019
- return furthestColor;
1020
- };
1021
- }
1022
- /**
1023
- * Makes color transformer which finds the best text color (black or white) for the given background color
1024
- *
1025
- * @public exported from `@promptbook/color`
1026
- */
1027
- furthest(Color.get('white'), Color.from('black'));
1028
-
1029
- /**
1030
- * Makes color transformer which returns a grayscale version of the color
1031
- *
1032
- * @param amount from 0 to 1
1033
- *
1034
- * @public exported from `@promptbook/color`
1035
- */
1036
- function grayscale(amount) {
1037
- return ({ red, green, blue, alpha }) => {
1038
- const average = (red + green + blue) / 3;
1039
- red = Math.round(average * amount + red * (1 - amount));
1040
- green = Math.round(average * amount + green * (1 - amount));
1041
- blue = Math.round(average * amount + blue * (1 - amount));
1042
- return Color.fromValues(red, green, blue, alpha);
1043
- };
1044
- }
1045
-
1046
967
  /**
1047
968
  * Makes color transformer which saturate the given color
1048
969
  *
@@ -1558,6 +1479,7 @@ exportJson({
1558
1479
  /**
1559
1480
  * Generates random token
1560
1481
  *
1482
+ * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
1561
1483
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
1562
1484
  *
1563
1485
  * @private internal helper function
@@ -1567,6 +1489,7 @@ function $randomToken(randomness) {
1567
1489
  return randomBytes(randomness).toString('hex');
1568
1490
  }
1569
1491
  /**
1492
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
1570
1493
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
1571
1494
  */
1572
1495
 
@@ -2026,7 +1949,7 @@ function pricing(value) {
2026
1949
  /**
2027
1950
  * List of available OpenAI models with pricing
2028
1951
  *
2029
- * Note: Synced with official API docs at 2025-08-20
1952
+ * Note: Synced with official API docs at 2025-11-19
2030
1953
  *
2031
1954
  * @see https://platform.openai.com/docs/models/
2032
1955
  * @see https://openai.com/api/pricing/
@@ -2036,11 +1959,21 @@ const OPENAI_MODELS = exportJson({
2036
1959
  name: 'OPENAI_MODELS',
2037
1960
  value: [
2038
1961
  /**/
1962
+ {
1963
+ modelVariant: 'CHAT',
1964
+ modelTitle: 'gpt-5.1',
1965
+ modelName: 'gpt-5.1',
1966
+ modelDescription: 'The best model for coding and agentic tasks with configurable reasoning effort.',
1967
+ pricing: {
1968
+ prompt: pricing(`$1.25 / 1M tokens`),
1969
+ output: pricing(`$10.00 / 1M tokens`),
1970
+ },
1971
+ },
2039
1972
  {
2040
1973
  modelVariant: 'CHAT',
2041
1974
  modelTitle: 'gpt-5',
2042
1975
  modelName: 'gpt-5',
2043
- 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.",
1976
+ 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.",
2044
1977
  pricing: {
2045
1978
  prompt: pricing(`$1.25 / 1M tokens`),
2046
1979
  output: pricing(`$10.00 / 1M tokens`),
@@ -3787,7 +3720,7 @@ class OllamaExecutionTools extends OpenAiCompatibleExecutionTools {
3787
3720
  ...ollamaOptions,
3788
3721
  apiKey: 'ollama',
3789
3722
  isProxied: false, // <- Note: Ollama is always local
3790
- };
3723
+ }; /* <- Note: [🤛] */
3791
3724
  super(openAiCompatibleOptions);
3792
3725
  }
3793
3726
  get title() {