@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.
Files changed (92) hide show
  1. package/README.md +6 -18
  2. package/esm/index.es.js +19 -98
  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 +19 -98
  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
 
@@ -118,7 +114,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
118
114
  Your job is to provide legal advice and support to the company and its employees.<br/>
119
115
  You are knowledgeable, professional, and detail-oriented.<br/>
120
116
  <br/>
121
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
117
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
122
118
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
123
119
 
124
120
  </td></tr></table>
@@ -140,7 +136,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
140
136
  **RULE** Always ensure compliance with laws and regulations.<br/>
141
137
  **RULE** Never provide legal advice outside your area of expertise.<br/>
142
138
  **RULE** Never provide legal advice about criminal law.<br/>
143
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
139
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
144
140
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
145
141
 
146
142
  </td></tr></table>
@@ -160,7 +156,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
160
156
  **RULE** Always ensure compliance with laws and regulations.<br/>
161
157
  **RULE** Never provide legal advice outside your area of expertise.<br/>
162
158
  **RULE** Never provide legal advice about criminal law.<br/>
163
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
159
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
164
160
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
165
161
  **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
166
162
 
@@ -211,14 +207,10 @@ Now you want to use it. There are several ways how to write your first book:
211
207
 
212
208
  We have written ai asistant in book who can help you with writing your first book.
213
209
 
214
-
215
-
216
210
  #### Your AI twin
217
211
 
218
212
  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.
219
213
 
220
-
221
-
222
214
  #### AI persona workpool
223
215
 
224
216
  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.
@@ -338,8 +330,6 @@ Join our growing community of developers and users:
338
330
 
339
331
 
340
332
 
341
-
342
-
343
333
  ## 📚 Documentation
344
334
 
345
335
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -416,8 +406,6 @@ The following glossary is used to clarify certain concepts:
416
406
 
417
407
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
418
408
 
419
-
420
-
421
409
  ### 💯 Core concepts
422
410
 
423
411
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -10,14 +10,14 @@ import hexEncoder from 'crypto-js/enc-hex';
10
10
  * @generated
11
11
  * @see https://github.com/webgptorg/book
12
12
  */
13
- const BOOK_LANGUAGE_VERSION = '1.0.0';
13
+ const BOOK_LANGUAGE_VERSION = '2.0.0';
14
14
  /**
15
15
  * The version of the Promptbook engine
16
16
  *
17
17
  * @generated
18
18
  * @see https://github.com/webgptorg/promptbook
19
19
  */
20
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-42';
20
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
21
21
  /**
22
22
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
23
23
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -681,6 +681,23 @@ class Color {
681
681
  * TODO: Maybe connect with textures
682
682
  */
683
683
 
684
+ /**
685
+ * Makes color transformer which returns a grayscale version of the color
686
+ *
687
+ * @param amount from 0 to 1
688
+ *
689
+ * @public exported from `@promptbook/color`
690
+ */
691
+ function grayscale(amount) {
692
+ return ({ red, green, blue, alpha }) => {
693
+ const average = (red + green + blue) / 3;
694
+ red = Math.round(average * amount + red * (1 - amount));
695
+ green = Math.round(average * amount + green * (1 - amount));
696
+ blue = Math.round(average * amount + blue * (1 - amount));
697
+ return Color.fromValues(red, green, blue, alpha);
698
+ };
699
+ }
700
+
684
701
  /**
685
702
  * Converts HSL values to RGB values
686
703
  *
@@ -796,102 +813,6 @@ function lighten(amount) {
796
813
  * TODO: Maybe implement by mix+hsl
797
814
  */
798
815
 
799
- /**
800
- * Calculates distance between two colors
801
- *
802
- * @param color1 first color
803
- * @param color2 second color
804
- *
805
- * Note: This function is inefficient. Use colorDistanceSquared instead if possible.
806
- *
807
- * @public exported from `@promptbook/color`
808
- */
809
- /**
810
- * Calculates distance between two colors without square root
811
- *
812
- * @param color1 first color
813
- * @param color2 second color
814
- *
815
- * @public exported from `@promptbook/color`
816
- */
817
- function colorDistanceSquared(color1, color2) {
818
- const rmean = (color1.red + color2.red) / 2;
819
- const r = color1.red - color2.red;
820
- const g = color1.green - color2.green;
821
- const b = color1.blue - color2.blue;
822
- const weightR = 2 + rmean / 256;
823
- const weightG = 4.0;
824
- const weightB = 2 + (255 - rmean) / 256;
825
- const distance = weightR * r * r + weightG * g * g + weightB * b * b;
826
- return distance;
827
- }
828
-
829
- /**
830
- * Makes color transformer which finds the nearest color from the given list
831
- *
832
- * @param colors array of colors to choose from
833
- *
834
- * @public exported from `@promptbook/color`
835
- */
836
- function nearest(...colors) {
837
- return (color) => {
838
- const distances = colors.map((c) => colorDistanceSquared(c, color));
839
- const minDistance = Math.min(...distances);
840
- const minIndex = distances.indexOf(minDistance);
841
- const nearestColor = colors[minIndex];
842
- return nearestColor;
843
- };
844
- }
845
-
846
- /**
847
- * Color transformer which returns the negative color
848
- *
849
- * @public exported from `@promptbook/color`
850
- */
851
- function negative(color) {
852
- const r = 255 - color.red;
853
- const g = 255 - color.green;
854
- const b = 255 - color.blue;
855
- return Color.fromValues(r, g, b, color.alpha);
856
- }
857
-
858
- /**
859
- * Makes color transformer which finds the furthest color from the given list
860
- *
861
- * @param colors array of colors to choose from
862
- *
863
- * @public exported from `@promptbook/color`
864
- */
865
- function furthest(...colors) {
866
- return (color) => {
867
- const furthestColor = negative(nearest(...colors.map(negative))(color));
868
- return furthestColor;
869
- };
870
- }
871
- /**
872
- * Makes color transformer which finds the best text color (black or white) for the given background color
873
- *
874
- * @public exported from `@promptbook/color`
875
- */
876
- furthest(Color.get('white'), Color.from('black'));
877
-
878
- /**
879
- * Makes color transformer which returns a grayscale version of the color
880
- *
881
- * @param amount from 0 to 1
882
- *
883
- * @public exported from `@promptbook/color`
884
- */
885
- function grayscale(amount) {
886
- return ({ red, green, blue, alpha }) => {
887
- const average = (red + green + blue) / 3;
888
- red = Math.round(average * amount + red * (1 - amount));
889
- green = Math.round(average * amount + green * (1 - amount));
890
- blue = Math.round(average * amount + blue * (1 - amount));
891
- return Color.fromValues(red, green, blue, alpha);
892
- };
893
- }
894
-
895
816
  /**
896
817
  * Makes color transformer which saturate the given color
897
818
  *