@promptbook/website-crawler 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 +47 -114
  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 +47 -114
  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
 
@@ -116,7 +112,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
116
112
  Your job is to provide legal advice and support to the company and its employees.<br/>
117
113
  You are knowledgeable, professional, and detail-oriented.<br/>
118
114
  <br/>
119
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
115
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
120
116
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
121
117
 
122
118
  </td></tr></table>
@@ -138,7 +134,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
138
134
  **RULE** Always ensure compliance with laws and regulations.<br/>
139
135
  **RULE** Never provide legal advice outside your area of expertise.<br/>
140
136
  **RULE** Never provide legal advice about criminal law.<br/>
141
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
137
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
142
138
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
143
139
 
144
140
  </td></tr></table>
@@ -158,7 +154,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
158
154
  **RULE** Always ensure compliance with laws and regulations.<br/>
159
155
  **RULE** Never provide legal advice outside your area of expertise.<br/>
160
156
  **RULE** Never provide legal advice about criminal law.<br/>
161
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
157
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
162
158
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
163
159
  **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
164
160
 
@@ -209,14 +205,10 @@ Now you want to use it. There are several ways how to write your first book:
209
205
 
210
206
  We have written ai asistant in book who can help you with writing your first book.
211
207
 
212
-
213
-
214
208
  #### Your AI twin
215
209
 
216
210
  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.
217
211
 
218
-
219
-
220
212
  #### AI persona workpool
221
213
 
222
214
  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.
@@ -336,8 +328,6 @@ Join our growing community of developers and users:
336
328
 
337
329
 
338
330
 
339
-
340
-
341
331
  ## 📚 Documentation
342
332
 
343
333
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -414,8 +404,6 @@ The following glossary is used to clarify certain concepts:
414
404
 
415
405
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
416
406
 
417
-
418
-
419
407
  ### 💯 Core concepts
420
408
 
421
409
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -20,14 +20,14 @@ import { Converter } from 'showdown';
20
20
  * @generated
21
21
  * @see https://github.com/webgptorg/book
22
22
  */
23
- const BOOK_LANGUAGE_VERSION = '1.0.0';
23
+ const BOOK_LANGUAGE_VERSION = '2.0.0';
24
24
  /**
25
25
  * The version of the Promptbook engine
26
26
  *
27
27
  * @generated
28
28
  * @see https://github.com/webgptorg/promptbook
29
29
  */
30
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-42';
30
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
31
31
  /**
32
32
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
33
33
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -735,6 +735,23 @@ class Color {
735
735
  * TODO: Maybe connect with textures
736
736
  */
737
737
 
738
+ /**
739
+ * Makes color transformer which returns a grayscale version of the color
740
+ *
741
+ * @param amount from 0 to 1
742
+ *
743
+ * @public exported from `@promptbook/color`
744
+ */
745
+ function grayscale(amount) {
746
+ return ({ red, green, blue, alpha }) => {
747
+ const average = (red + green + blue) / 3;
748
+ red = Math.round(average * amount + red * (1 - amount));
749
+ green = Math.round(average * amount + green * (1 - amount));
750
+ blue = Math.round(average * amount + blue * (1 - amount));
751
+ return Color.fromValues(red, green, blue, alpha);
752
+ };
753
+ }
754
+
738
755
  /**
739
756
  * Converts HSL values to RGB values
740
757
  *
@@ -850,102 +867,6 @@ function lighten(amount) {
850
867
  * TODO: Maybe implement by mix+hsl
851
868
  */
852
869
 
853
- /**
854
- * Calculates distance between two colors
855
- *
856
- * @param color1 first color
857
- * @param color2 second color
858
- *
859
- * Note: This function is inefficient. Use colorDistanceSquared instead if possible.
860
- *
861
- * @public exported from `@promptbook/color`
862
- */
863
- /**
864
- * Calculates distance between two colors without square root
865
- *
866
- * @param color1 first color
867
- * @param color2 second color
868
- *
869
- * @public exported from `@promptbook/color`
870
- */
871
- function colorDistanceSquared(color1, color2) {
872
- const rmean = (color1.red + color2.red) / 2;
873
- const r = color1.red - color2.red;
874
- const g = color1.green - color2.green;
875
- const b = color1.blue - color2.blue;
876
- const weightR = 2 + rmean / 256;
877
- const weightG = 4.0;
878
- const weightB = 2 + (255 - rmean) / 256;
879
- const distance = weightR * r * r + weightG * g * g + weightB * b * b;
880
- return distance;
881
- }
882
-
883
- /**
884
- * Makes color transformer which finds the nearest color from the given list
885
- *
886
- * @param colors array of colors to choose from
887
- *
888
- * @public exported from `@promptbook/color`
889
- */
890
- function nearest(...colors) {
891
- return (color) => {
892
- const distances = colors.map((c) => colorDistanceSquared(c, color));
893
- const minDistance = Math.min(...distances);
894
- const minIndex = distances.indexOf(minDistance);
895
- const nearestColor = colors[minIndex];
896
- return nearestColor;
897
- };
898
- }
899
-
900
- /**
901
- * Color transformer which returns the negative color
902
- *
903
- * @public exported from `@promptbook/color`
904
- */
905
- function negative(color) {
906
- const r = 255 - color.red;
907
- const g = 255 - color.green;
908
- const b = 255 - color.blue;
909
- return Color.fromValues(r, g, b, color.alpha);
910
- }
911
-
912
- /**
913
- * Makes color transformer which finds the furthest color from the given list
914
- *
915
- * @param colors array of colors to choose from
916
- *
917
- * @public exported from `@promptbook/color`
918
- */
919
- function furthest(...colors) {
920
- return (color) => {
921
- const furthestColor = negative(nearest(...colors.map(negative))(color));
922
- return furthestColor;
923
- };
924
- }
925
- /**
926
- * Makes color transformer which finds the best text color (black or white) for the given background color
927
- *
928
- * @public exported from `@promptbook/color`
929
- */
930
- furthest(Color.get('white'), Color.from('black'));
931
-
932
- /**
933
- * Makes color transformer which returns a grayscale version of the color
934
- *
935
- * @param amount from 0 to 1
936
- *
937
- * @public exported from `@promptbook/color`
938
- */
939
- function grayscale(amount) {
940
- return ({ red, green, blue, alpha }) => {
941
- const average = (red + green + blue) / 3;
942
- red = Math.round(average * amount + red * (1 - amount));
943
- green = Math.round(average * amount + green * (1 - amount));
944
- blue = Math.round(average * amount + blue * (1 - amount));
945
- return Color.fromValues(red, green, blue, alpha);
946
- };
947
- }
948
-
949
870
  /**
950
871
  * Makes color transformer which saturate the given color
951
872
  *
@@ -3182,6 +3103,7 @@ class MissingToolsError extends Error {
3182
3103
  /**
3183
3104
  * Generates random token
3184
3105
  *
3106
+ * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
3185
3107
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
3186
3108
  *
3187
3109
  * @private internal helper function
@@ -3191,6 +3113,7 @@ function $randomToken(randomness) {
3191
3113
  return randomBytes(randomness).toString('hex');
3192
3114
  }
3193
3115
  /**
3116
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
3194
3117
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
3195
3118
  */
3196
3119
 
@@ -3309,6 +3232,22 @@ class CollectionError extends Error {
3309
3232
  }
3310
3233
  }
3311
3234
 
3235
+ /**
3236
+ * This error indicates error from the database
3237
+ *
3238
+ * @public exported from `@promptbook/core`
3239
+ */
3240
+ class DatabaseError extends Error {
3241
+ constructor(message) {
3242
+ super(message);
3243
+ this.name = 'DatabaseError';
3244
+ Object.setPrototypeOf(this, DatabaseError.prototype);
3245
+ }
3246
+ }
3247
+ /**
3248
+ * TODO: !!!! Explain that NotFoundError (!!! and other specific errors) has priority over DatabaseError in some contexts
3249
+ */
3250
+
3312
3251
  /**
3313
3252
  * This error occurs when some expectation is not met in the execution of the pipeline
3314
3253
  *
@@ -3389,6 +3328,7 @@ const PROMPTBOOK_ERRORS = {
3389
3328
  UnexpectedError,
3390
3329
  WrappedError,
3391
3330
  NotAllowed,
3331
+ DatabaseError,
3392
3332
  // TODO: [🪑]> VersionMismatchError,
3393
3333
  };
3394
3334
  /**
@@ -4225,6 +4165,7 @@ function joinLlmExecutionTools(title, ...llmExecutionTools) {
4225
4165
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4226
4166
  }
4227
4167
  /**
4168
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4228
4169
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
4229
4170
  */
4230
4171
 
@@ -4241,6 +4182,7 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
4241
4182
  return llmTools;
4242
4183
  }
4243
4184
  /**
4185
+ * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4244
4186
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
4245
4187
  */
4246
4188
 
@@ -5707,18 +5649,6 @@ function templateParameters(template, parameters) {
5707
5649
  return replacedTemplates;
5708
5650
  }
5709
5651
 
5710
- /**
5711
- * Logs an LLM call with the given report.
5712
- *
5713
- * @private internal utility of `createPipelineExecutor`
5714
- */
5715
- function logLlmCall(logLlmCall, report) {
5716
- logLlmCall({
5717
- modelName: 'model' /* <- TODO: How to get model name from the report */,
5718
- report,
5719
- });
5720
- }
5721
-
5722
5652
  /**
5723
5653
  * Extracts all code blocks from markdown.
5724
5654
  *
@@ -6064,7 +5994,7 @@ function validatePromptResult(options) {
6064
5994
  */
6065
5995
  async function executeAttempts(options) {
6066
5996
  const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
6067
- preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall: logLlmCall$1, } = options;
5997
+ preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, logLlmCall, } = options;
6068
5998
  const $ongoingTaskResult = {
6069
5999
  $result: null,
6070
6000
  $resultString: null,
@@ -6326,8 +6256,11 @@ async function executeAttempts(options) {
6326
6256
  : serializeError($ongoingTaskResult.$expectError),
6327
6257
  };
6328
6258
  $executionReport.promptExecutions.push(executionPromptReport);
6329
- if (logLlmCall$1) {
6330
- logLlmCall(logLlmCall$1, executionPromptReport);
6259
+ if (logLlmCall) {
6260
+ logLlmCall({
6261
+ modelName: 'model' /* <- TODO: How to get model name from the report */,
6262
+ report: executionPromptReport,
6263
+ });
6331
6264
  }
6332
6265
  }
6333
6266
  }
@@ -6601,7 +6534,7 @@ async function getKnowledgeForTask(options) {
6601
6534
  },
6602
6535
  content: task.content,
6603
6536
  parameters,
6604
- };
6537
+ }; /* <- Note: [🤛] */
6605
6538
  const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
6606
6539
  const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
6607
6540
  const { index } = knowledgePiece;