@promptbook/remote-client 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 +38 -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 +38 -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/README.md
CHANGED
|
@@ -9,8 +9,8 @@ Turn your company's scattered knowledge into AI ready Books
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
[ Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
|
|
13
|
+
[ Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
|
|
14
14
|
[](https://snyk.io/test/github/webgptorg/promptbook)
|
|
15
15
|
[](https://github.com/webgptorg/promptbook/actions/workflows/test-books.yml)
|
|
16
16
|
[](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
|
-
-
|
|
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**
|
|
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**
|
|
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**
|
|
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
|
@@ -13,14 +13,14 @@ import { basename } from 'path';
|
|
|
13
13
|
* @generated
|
|
14
14
|
* @see https://github.com/webgptorg/book
|
|
15
15
|
*/
|
|
16
|
-
const BOOK_LANGUAGE_VERSION = '
|
|
16
|
+
const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
17
17
|
/**
|
|
18
18
|
* The version of the Promptbook engine
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
23
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -82,6 +82,22 @@ class CollectionError extends Error {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* This error indicates error from the database
|
|
87
|
+
*
|
|
88
|
+
* @public exported from `@promptbook/core`
|
|
89
|
+
*/
|
|
90
|
+
class DatabaseError extends Error {
|
|
91
|
+
constructor(message) {
|
|
92
|
+
super(message);
|
|
93
|
+
this.name = 'DatabaseError';
|
|
94
|
+
Object.setPrototypeOf(this, DatabaseError.prototype);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* TODO: !!!! Explain that NotFoundError (!!! and other specific errors) has priority over DatabaseError in some contexts
|
|
99
|
+
*/
|
|
100
|
+
|
|
85
101
|
/**
|
|
86
102
|
* This error type indicates that you try to use a feature that is not available in the current environment
|
|
87
103
|
*
|
|
@@ -223,6 +239,7 @@ class ParseError extends Error {
|
|
|
223
239
|
/**
|
|
224
240
|
* Generates random token
|
|
225
241
|
*
|
|
242
|
+
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
226
243
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
227
244
|
*
|
|
228
245
|
* @private internal helper function
|
|
@@ -232,6 +249,7 @@ function $randomToken(randomness) {
|
|
|
232
249
|
return randomBytes(randomness).toString('hex');
|
|
233
250
|
}
|
|
234
251
|
/**
|
|
252
|
+
* TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
235
253
|
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
236
254
|
*/
|
|
237
255
|
|
|
@@ -951,6 +969,23 @@ class Color {
|
|
|
951
969
|
* TODO: Maybe connect with textures
|
|
952
970
|
*/
|
|
953
971
|
|
|
972
|
+
/**
|
|
973
|
+
* Makes color transformer which returns a grayscale version of the color
|
|
974
|
+
*
|
|
975
|
+
* @param amount from 0 to 1
|
|
976
|
+
*
|
|
977
|
+
* @public exported from `@promptbook/color`
|
|
978
|
+
*/
|
|
979
|
+
function grayscale(amount) {
|
|
980
|
+
return ({ red, green, blue, alpha }) => {
|
|
981
|
+
const average = (red + green + blue) / 3;
|
|
982
|
+
red = Math.round(average * amount + red * (1 - amount));
|
|
983
|
+
green = Math.round(average * amount + green * (1 - amount));
|
|
984
|
+
blue = Math.round(average * amount + blue * (1 - amount));
|
|
985
|
+
return Color.fromValues(red, green, blue, alpha);
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
|
|
954
989
|
/**
|
|
955
990
|
* Converts HSL values to RGB values
|
|
956
991
|
*
|
|
@@ -1066,102 +1101,6 @@ function lighten(amount) {
|
|
|
1066
1101
|
* TODO: Maybe implement by mix+hsl
|
|
1067
1102
|
*/
|
|
1068
1103
|
|
|
1069
|
-
/**
|
|
1070
|
-
* Calculates distance between two colors
|
|
1071
|
-
*
|
|
1072
|
-
* @param color1 first color
|
|
1073
|
-
* @param color2 second color
|
|
1074
|
-
*
|
|
1075
|
-
* Note: This function is inefficient. Use colorDistanceSquared instead if possible.
|
|
1076
|
-
*
|
|
1077
|
-
* @public exported from `@promptbook/color`
|
|
1078
|
-
*/
|
|
1079
|
-
/**
|
|
1080
|
-
* Calculates distance between two colors without square root
|
|
1081
|
-
*
|
|
1082
|
-
* @param color1 first color
|
|
1083
|
-
* @param color2 second color
|
|
1084
|
-
*
|
|
1085
|
-
* @public exported from `@promptbook/color`
|
|
1086
|
-
*/
|
|
1087
|
-
function colorDistanceSquared(color1, color2) {
|
|
1088
|
-
const rmean = (color1.red + color2.red) / 2;
|
|
1089
|
-
const r = color1.red - color2.red;
|
|
1090
|
-
const g = color1.green - color2.green;
|
|
1091
|
-
const b = color1.blue - color2.blue;
|
|
1092
|
-
const weightR = 2 + rmean / 256;
|
|
1093
|
-
const weightG = 4.0;
|
|
1094
|
-
const weightB = 2 + (255 - rmean) / 256;
|
|
1095
|
-
const distance = weightR * r * r + weightG * g * g + weightB * b * b;
|
|
1096
|
-
return distance;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* Makes color transformer which finds the nearest color from the given list
|
|
1101
|
-
*
|
|
1102
|
-
* @param colors array of colors to choose from
|
|
1103
|
-
*
|
|
1104
|
-
* @public exported from `@promptbook/color`
|
|
1105
|
-
*/
|
|
1106
|
-
function nearest(...colors) {
|
|
1107
|
-
return (color) => {
|
|
1108
|
-
const distances = colors.map((c) => colorDistanceSquared(c, color));
|
|
1109
|
-
const minDistance = Math.min(...distances);
|
|
1110
|
-
const minIndex = distances.indexOf(minDistance);
|
|
1111
|
-
const nearestColor = colors[minIndex];
|
|
1112
|
-
return nearestColor;
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
/**
|
|
1117
|
-
* Color transformer which returns the negative color
|
|
1118
|
-
*
|
|
1119
|
-
* @public exported from `@promptbook/color`
|
|
1120
|
-
*/
|
|
1121
|
-
function negative(color) {
|
|
1122
|
-
const r = 255 - color.red;
|
|
1123
|
-
const g = 255 - color.green;
|
|
1124
|
-
const b = 255 - color.blue;
|
|
1125
|
-
return Color.fromValues(r, g, b, color.alpha);
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* Makes color transformer which finds the furthest color from the given list
|
|
1130
|
-
*
|
|
1131
|
-
* @param colors array of colors to choose from
|
|
1132
|
-
*
|
|
1133
|
-
* @public exported from `@promptbook/color`
|
|
1134
|
-
*/
|
|
1135
|
-
function furthest(...colors) {
|
|
1136
|
-
return (color) => {
|
|
1137
|
-
const furthestColor = negative(nearest(...colors.map(negative))(color));
|
|
1138
|
-
return furthestColor;
|
|
1139
|
-
};
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* Makes color transformer which finds the best text color (black or white) for the given background color
|
|
1143
|
-
*
|
|
1144
|
-
* @public exported from `@promptbook/color`
|
|
1145
|
-
*/
|
|
1146
|
-
furthest(Color.get('white'), Color.from('black'));
|
|
1147
|
-
|
|
1148
|
-
/**
|
|
1149
|
-
* Makes color transformer which returns a grayscale version of the color
|
|
1150
|
-
*
|
|
1151
|
-
* @param amount from 0 to 1
|
|
1152
|
-
*
|
|
1153
|
-
* @public exported from `@promptbook/color`
|
|
1154
|
-
*/
|
|
1155
|
-
function grayscale(amount) {
|
|
1156
|
-
return ({ red, green, blue, alpha }) => {
|
|
1157
|
-
const average = (red + green + blue) / 3;
|
|
1158
|
-
red = Math.round(average * amount + red * (1 - amount));
|
|
1159
|
-
green = Math.round(average * amount + green * (1 - amount));
|
|
1160
|
-
blue = Math.round(average * amount + blue * (1 - amount));
|
|
1161
|
-
return Color.fromValues(red, green, blue, alpha);
|
|
1162
|
-
};
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
1104
|
/**
|
|
1166
1105
|
* Makes color transformer which saturate the given color
|
|
1167
1106
|
*
|
|
@@ -1439,6 +1378,7 @@ const PROMPTBOOK_ERRORS = {
|
|
|
1439
1378
|
UnexpectedError,
|
|
1440
1379
|
WrappedError,
|
|
1441
1380
|
NotAllowed,
|
|
1381
|
+
DatabaseError,
|
|
1442
1382
|
// TODO: [🪑]> VersionMismatchError,
|
|
1443
1383
|
};
|
|
1444
1384
|
/**
|