@promptbook/core 0.103.0-43 โ 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 +186 -27
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +8 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +5 -0
- package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -28
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +61 -9
- package/esm/typings/src/errors/DatabaseError.d.ts +3 -0
- 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/CreateAgentLlmExecutionToolsOptions.d.ts +2 -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/types/typeAliases.d.ts +19 -1
- package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +5 -2
- 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 +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +190 -31
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
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
|
|
|
@@ -380,7 +376,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
|
|
|
380
376
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
381
377
|
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
382
378
|
<br/>
|
|
383
|
-
**KNOWLEDGE**
|
|
379
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
384
380
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
385
381
|
|
|
386
382
|
</td></tr></table>
|
|
@@ -402,7 +398,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
402
398
|
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
403
399
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
404
400
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
405
|
-
**KNOWLEDGE**
|
|
401
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
406
402
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
407
403
|
|
|
408
404
|
</td></tr></table>
|
|
@@ -422,7 +418,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
422
418
|
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
423
419
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
424
420
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
425
|
-
**KNOWLEDGE**
|
|
421
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
426
422
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
427
423
|
**ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
|
|
428
424
|
|
|
@@ -473,14 +469,10 @@ Now you want to use it. There are several ways how to write your first book:
|
|
|
473
469
|
|
|
474
470
|
We have written ai asistant in book who can help you with writing your first book.
|
|
475
471
|
|
|
476
|
-
|
|
477
|
-
|
|
478
472
|
#### Your AI twin
|
|
479
473
|
|
|
480
474
|
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.
|
|
481
475
|
|
|
482
|
-
|
|
483
|
-
|
|
484
476
|
#### AI persona workpool
|
|
485
477
|
|
|
486
478
|
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.
|
|
@@ -600,8 +592,6 @@ Join our growing community of developers and users:
|
|
|
600
592
|
|
|
601
593
|
|
|
602
594
|
|
|
603
|
-
|
|
604
|
-
|
|
605
595
|
## ๐ Documentation
|
|
606
596
|
|
|
607
597
|
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
@@ -678,8 +668,6 @@ The following glossary is used to clarify certain concepts:
|
|
|
678
668
|
|
|
679
669
|
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
680
670
|
|
|
681
|
-
|
|
682
|
-
|
|
683
671
|
### ๐ฏ Core concepts
|
|
684
672
|
|
|
685
673
|
- [๐ Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
package/esm/index.es.js
CHANGED
|
@@ -8,8 +8,8 @@ import { basename, join, dirname, isAbsolute } from 'path';
|
|
|
8
8
|
import { SHA256 } from 'crypto-js';
|
|
9
9
|
import { lookup, extension } from 'mime-types';
|
|
10
10
|
import { parse, unparse } from 'papaparse';
|
|
11
|
-
import colors from 'colors';
|
|
12
11
|
import moment from 'moment';
|
|
12
|
+
import colors from 'colors';
|
|
13
13
|
import Bottleneck from 'bottleneck';
|
|
14
14
|
import OpenAI from 'openai';
|
|
15
15
|
|
|
@@ -20,14 +20,14 @@ import OpenAI from 'openai';
|
|
|
20
20
|
* @generated
|
|
21
21
|
* @see https://github.com/webgptorg/book
|
|
22
22
|
*/
|
|
23
|
-
const BOOK_LANGUAGE_VERSION = '
|
|
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-
|
|
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
|
|
@@ -2776,6 +2776,9 @@ class DatabaseError extends Error {
|
|
|
2776
2776
|
Object.setPrototypeOf(this, DatabaseError.prototype);
|
|
2777
2777
|
}
|
|
2778
2778
|
}
|
|
2779
|
+
/**
|
|
2780
|
+
* TODO: !!!! Explain that NotFoundError (!!! and other specific errors) has priority over DatabaseError in some contexts
|
|
2781
|
+
*/
|
|
2779
2782
|
|
|
2780
2783
|
/**
|
|
2781
2784
|
* This error type indicates that you try to use a feature that is not available in the current environment
|
|
@@ -2881,6 +2884,7 @@ function $randomToken(randomness) {
|
|
|
2881
2884
|
return randomBytes(randomness).toString('hex');
|
|
2882
2885
|
}
|
|
2883
2886
|
/**
|
|
2887
|
+
* TODO: [๐คถ] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
2884
2888
|
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
2885
2889
|
*/
|
|
2886
2890
|
|
|
@@ -3778,6 +3782,7 @@ function joinLlmExecutionTools(title, ...llmExecutionTools) {
|
|
|
3778
3782
|
return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
|
|
3779
3783
|
}
|
|
3780
3784
|
/**
|
|
3785
|
+
* TODO: [๐] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
3781
3786
|
* TODO: [๐ทโโ๏ธ] @@@ Manual about construction of llmTools
|
|
3782
3787
|
*/
|
|
3783
3788
|
|
|
@@ -3794,6 +3799,7 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
|
|
|
3794
3799
|
return llmTools;
|
|
3795
3800
|
}
|
|
3796
3801
|
/**
|
|
3802
|
+
* TODO: [๐] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
3797
3803
|
* TODO: [๐ทโโ๏ธ] @@@ Manual about construction of llmTools
|
|
3798
3804
|
*/
|
|
3799
3805
|
|
|
@@ -9904,25 +9910,26 @@ const spaceTrim = spaceTrim$2;
|
|
|
9904
9910
|
* @public exported from `@promptbook/core`
|
|
9905
9911
|
* <- TODO: !!! Move to `@promptbook/supabase` package
|
|
9906
9912
|
*/
|
|
9907
|
-
class AgentCollectionInSupabase {
|
|
9913
|
+
class AgentCollectionInSupabase /* TODO: !!!! implements AgentCollection */ {
|
|
9908
9914
|
/**
|
|
9909
9915
|
* @param rootPath - path to the directory with agents
|
|
9910
|
-
* @param tools - Execution tools to be used in `Agent` itself and listing the agents
|
|
9916
|
+
* @param tools - Execution tools to be used in !!! `Agent` itself and listing the agents
|
|
9911
9917
|
* @param options - Options for the collection creation
|
|
9912
9918
|
*/
|
|
9913
|
-
constructor(supabaseClient,
|
|
9919
|
+
constructor(supabaseClient,
|
|
9920
|
+
/// TODO: !!! Remove> private readonly tools?: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>,
|
|
9921
|
+
options) {
|
|
9914
9922
|
this.supabaseClient = supabaseClient;
|
|
9915
|
-
this.tools = tools;
|
|
9916
9923
|
this.options = options;
|
|
9917
|
-
/**
|
|
9918
|
-
* Cached defined execution tools
|
|
9919
|
-
*/
|
|
9920
|
-
this._definedTools = null;
|
|
9921
9924
|
const { isVerbose = DEFAULT_IS_VERBOSE } = options || {};
|
|
9922
9925
|
if (isVerbose) {
|
|
9923
|
-
console.info(
|
|
9926
|
+
console.info(`Creating pipeline collection from supabase...`);
|
|
9924
9927
|
}
|
|
9925
9928
|
}
|
|
9929
|
+
/**
|
|
9930
|
+
* Cached defined execution tools
|
|
9931
|
+
*/
|
|
9932
|
+
// !!! private _definedTools: ExecutionTools | null = null;
|
|
9926
9933
|
/*
|
|
9927
9934
|
TODO: !!! Use or remove
|
|
9928
9935
|
/**
|
|
@@ -9964,10 +9971,9 @@ class AgentCollectionInSupabase {
|
|
|
9964
9971
|
}
|
|
9965
9972
|
/**
|
|
9966
9973
|
* !!!
|
|
9967
|
-
|
|
9968
|
-
async spawnAgent(agentName) {
|
|
9969
|
-
|
|
9970
|
-
/*
|
|
9974
|
+
* /
|
|
9975
|
+
public async spawnAgent(agentName: string_agent_name): Promise<Agent> {
|
|
9976
|
+
|
|
9971
9977
|
// <- TODO: !!! ENOENT: no such file or directory, open 'C:\Users\me\work\ai\promptbook\agents\examples\Asistent pro Lล VP.book
|
|
9972
9978
|
const { isVerbose = DEFAULT_IS_VERBOSE } = this.options || {};
|
|
9973
9979
|
const tools = await this.getTools();
|
|
@@ -10015,7 +10021,30 @@ class AgentCollectionInSupabase {
|
|
|
10015
10021
|
}
|
|
10016
10022
|
|
|
10017
10023
|
return agent;
|
|
10018
|
-
|
|
10024
|
+
* /
|
|
10025
|
+
}
|
|
10026
|
+
*/
|
|
10027
|
+
/**
|
|
10028
|
+
* !!!@@@
|
|
10029
|
+
*/
|
|
10030
|
+
async getAgentSource(agentName) {
|
|
10031
|
+
const result = await this.supabaseClient
|
|
10032
|
+
.from('AgentCollection' /* <- TODO: !!!! Change to `Agent` */)
|
|
10033
|
+
.select('agentSource')
|
|
10034
|
+
.eq('agentName', agentName)
|
|
10035
|
+
.single();
|
|
10036
|
+
if (result.error) {
|
|
10037
|
+
throw new DatabaseError(spaceTrim((block) => `
|
|
10038
|
+
|
|
10039
|
+
Error fetching agent "${agentName}" from Supabase:
|
|
10040
|
+
|
|
10041
|
+
${block(result.error.message)}
|
|
10042
|
+
`));
|
|
10043
|
+
// <- TODO: !!! First check if the error is "not found" and throw `NotFoundError` instead then throw `DatabaseError`
|
|
10044
|
+
}
|
|
10045
|
+
const agentSource = new BehaviorSubject(result.data.agentSource);
|
|
10046
|
+
// <- TODO: !!!! Dynamic updates
|
|
10047
|
+
return agentSource;
|
|
10019
10048
|
}
|
|
10020
10049
|
/**
|
|
10021
10050
|
* Creates a new agent in the collection
|
|
@@ -10052,6 +10081,7 @@ class AgentCollectionInSupabase {
|
|
|
10052
10081
|
}
|
|
10053
10082
|
}
|
|
10054
10083
|
/**
|
|
10084
|
+
* TODO: !!!! Implement it here correctly and update JSDoc comments here, and on interface + other implementations
|
|
10055
10085
|
* TODO: Write unit test
|
|
10056
10086
|
* TODO: [๐ง ][๐] `AgentXxx` vs `AgentsXxx` naming convention
|
|
10057
10087
|
*/
|
|
@@ -15099,7 +15129,7 @@ function pricing(value) {
|
|
|
15099
15129
|
/**
|
|
15100
15130
|
* List of available OpenAI models with pricing
|
|
15101
15131
|
*
|
|
15102
|
-
* Note: Synced with official API docs at 2025-
|
|
15132
|
+
* Note: Synced with official API docs at 2025-11-19
|
|
15103
15133
|
*
|
|
15104
15134
|
* @see https://platform.openai.com/docs/models/
|
|
15105
15135
|
* @see https://openai.com/api/pricing/
|
|
@@ -15109,11 +15139,21 @@ const OPENAI_MODELS = exportJson({
|
|
|
15109
15139
|
name: 'OPENAI_MODELS',
|
|
15110
15140
|
value: [
|
|
15111
15141
|
/**/
|
|
15142
|
+
{
|
|
15143
|
+
modelVariant: 'CHAT',
|
|
15144
|
+
modelTitle: 'gpt-5.1',
|
|
15145
|
+
modelName: 'gpt-5.1',
|
|
15146
|
+
modelDescription: 'The best model for coding and agentic tasks with configurable reasoning effort.',
|
|
15147
|
+
pricing: {
|
|
15148
|
+
prompt: pricing(`$1.25 / 1M tokens`),
|
|
15149
|
+
output: pricing(`$10.00 / 1M tokens`),
|
|
15150
|
+
},
|
|
15151
|
+
},
|
|
15112
15152
|
{
|
|
15113
15153
|
modelVariant: 'CHAT',
|
|
15114
15154
|
modelTitle: 'gpt-5',
|
|
15115
15155
|
modelName: 'gpt-5',
|
|
15116
|
-
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.",
|
|
15156
|
+
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.",
|
|
15117
15157
|
pricing: {
|
|
15118
15158
|
prompt: pricing(`$1.25 / 1M tokens`),
|
|
15119
15159
|
output: pricing(`$10.00 / 1M tokens`),
|
|
@@ -16674,11 +16714,11 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
|
|
|
16674
16714
|
if (!this.isCreatingNewAssistantsAllowed) {
|
|
16675
16715
|
throw new NotAllowed(`Creating new assistants is not allowed. Set \`isCreatingNewAssistantsAllowed: true\` in options to enable this feature.`);
|
|
16676
16716
|
}
|
|
16677
|
-
await this.playground();
|
|
16717
|
+
// await this.playground();
|
|
16678
16718
|
const { name, instructions } = options;
|
|
16679
16719
|
const client = await this.getClient();
|
|
16680
|
-
|
|
16681
|
-
TODO: !!!
|
|
16720
|
+
/*/
|
|
16721
|
+
//TODO: !!!
|
|
16682
16722
|
async function downloadFile(url: string, folder = './tmp'): Promise<string> {
|
|
16683
16723
|
const filename = path.basename(url.split('?')[0]);
|
|
16684
16724
|
const filepath = path.join(folder, filename);
|
|
@@ -16722,8 +16762,8 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
|
|
|
16722
16762
|
const file = await uploadFileToOpenAI(filepath);
|
|
16723
16763
|
uploadedFiles.push(file.id);
|
|
16724
16764
|
}
|
|
16725
|
-
|
|
16726
|
-
alert('!!!! Creating new OpenAI assistant');
|
|
16765
|
+
/**/
|
|
16766
|
+
// alert('!!!! Creating new OpenAI assistant');
|
|
16727
16767
|
// 3๏ธโฃ Create assistant with uploaded files
|
|
16728
16768
|
const assistant = await client.beta.assistants.create({
|
|
16729
16769
|
name,
|
|
@@ -16884,15 +16924,27 @@ class AgentLlmExecutionTools {
|
|
|
16884
16924
|
const chatPrompt = prompt;
|
|
16885
16925
|
let underlyingLlmResult;
|
|
16886
16926
|
if (OpenAiAssistantExecutionTools.isOpenAiAssistantExecutionTools(this.options.llmTools)) {
|
|
16927
|
+
if (this.options.isVerbose) {
|
|
16928
|
+
console.log(`Creating new OpenAI Assistant for agent ${this.title}...`);
|
|
16929
|
+
}
|
|
16887
16930
|
// <- TODO: !!! Check also `isCreatingNewAssistantsAllowed` and warn about it
|
|
16888
16931
|
const assistant = await this.options.llmTools.createNewAssistant({
|
|
16889
16932
|
name: this.title,
|
|
16890
16933
|
instructions: modelRequirements.systemMessage,
|
|
16934
|
+
/*
|
|
16935
|
+
!!!
|
|
16936
|
+
metadata: {
|
|
16937
|
+
agentModelName: this.modelName,
|
|
16938
|
+
}
|
|
16939
|
+
*/
|
|
16891
16940
|
});
|
|
16892
16941
|
// <- TODO: !!! Cache the assistant in prepareCache
|
|
16893
16942
|
underlyingLlmResult = await assistant.callChatModel(chatPrompt);
|
|
16894
16943
|
}
|
|
16895
16944
|
else {
|
|
16945
|
+
if (this.options.isVerbose) {
|
|
16946
|
+
console.log(`Creating Assistant ${this.title} on generic LLM execution tools...`);
|
|
16947
|
+
}
|
|
16896
16948
|
// Create modified chat prompt with agent system message
|
|
16897
16949
|
const modifiedChatPrompt = {
|
|
16898
16950
|
...chatPrompt,
|
|
@@ -16973,6 +17025,7 @@ class Agent {
|
|
|
16973
17025
|
*/
|
|
16974
17026
|
getLlmExecutionTools() {
|
|
16975
17027
|
const llmTools = new AgentLlmExecutionTools({
|
|
17028
|
+
isVerbose: this.options.isVerbose,
|
|
16976
17029
|
llmTools: getSingleLlmExecutionTools(this.options.executionTools.llm),
|
|
16977
17030
|
agentSource: this.agentSource.value, // <- TODO: !!!! Allow to pass BehaviorSubject<string_book> OR refresh llmExecutionTools.callChat on agentSource change
|
|
16978
17031
|
});
|
|
@@ -18293,6 +18346,105 @@ function aboutPromptbookInformation(options) {
|
|
|
18293
18346
|
* TODO: [๐ฝ] Unite branding and make single place for it
|
|
18294
18347
|
*/
|
|
18295
18348
|
|
|
18349
|
+
/**
|
|
18350
|
+
* Pick random item from the received array
|
|
18351
|
+
*
|
|
18352
|
+
* @private internal helper function
|
|
18353
|
+
*/
|
|
18354
|
+
function $randomItem(...items) {
|
|
18355
|
+
if (items.length === 0) {
|
|
18356
|
+
throw new Error(`Not enough items`);
|
|
18357
|
+
}
|
|
18358
|
+
return items[Math.floor(Math.random( /* <- TODO: [๐] Probably use seed random */) * items.length)];
|
|
18359
|
+
}
|
|
18360
|
+
/**
|
|
18361
|
+
* TODO: [๐คถ] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
18362
|
+
*/
|
|
18363
|
+
|
|
18364
|
+
const FIRSTNAMES = [
|
|
18365
|
+
'Paul',
|
|
18366
|
+
'George',
|
|
18367
|
+
'Adam',
|
|
18368
|
+
'Lucy',
|
|
18369
|
+
'Sophia',
|
|
18370
|
+
'Emma',
|
|
18371
|
+
'Olivia',
|
|
18372
|
+
'Noah',
|
|
18373
|
+
'Liam',
|
|
18374
|
+
'Ethan',
|
|
18375
|
+
'Ava',
|
|
18376
|
+
'Mia',
|
|
18377
|
+
'Isabella',
|
|
18378
|
+
'James',
|
|
18379
|
+
'Benjamin',
|
|
18380
|
+
'Elijah',
|
|
18381
|
+
'Sophia',
|
|
18382
|
+
'Charlotte',
|
|
18383
|
+
'Amelia',
|
|
18384
|
+
'Harper',
|
|
18385
|
+
'Alexander',
|
|
18386
|
+
'William',
|
|
18387
|
+
'Michael',
|
|
18388
|
+
'Daniel',
|
|
18389
|
+
'Matthew',
|
|
18390
|
+
'Joseph',
|
|
18391
|
+
'David',
|
|
18392
|
+
'Samuel',
|
|
18393
|
+
'Henry',
|
|
18394
|
+
'Jack',
|
|
18395
|
+
'Sebastian',
|
|
18396
|
+
'Gabriel',
|
|
18397
|
+
'Anthony',
|
|
18398
|
+
'Christopher',
|
|
18399
|
+
];
|
|
18400
|
+
const LASTNAMES_WITH_COLORS = [
|
|
18401
|
+
{ lastname: 'Green', color: '#008000' },
|
|
18402
|
+
{ lastname: 'Brown', color: '#A52A2A' },
|
|
18403
|
+
{ lastname: 'Black', color: '#000000' },
|
|
18404
|
+
{ lastname: 'White', color: '#FFFFFF' },
|
|
18405
|
+
{ lastname: 'Gray', color: '#808080' },
|
|
18406
|
+
{ lastname: 'Blue', color: '#0000FF' },
|
|
18407
|
+
];
|
|
18408
|
+
/**
|
|
18409
|
+
*
|
|
18410
|
+
* @private internal helper function
|
|
18411
|
+
*/
|
|
18412
|
+
function $randomFullnameWithColor() {
|
|
18413
|
+
const firstname = $randomItem(...FIRSTNAMES);
|
|
18414
|
+
const { lastname, color } = $randomItem(...LASTNAMES_WITH_COLORS);
|
|
18415
|
+
return {
|
|
18416
|
+
fullname: `${firstname} ${lastname}`,
|
|
18417
|
+
color,
|
|
18418
|
+
};
|
|
18419
|
+
}
|
|
18420
|
+
/**
|
|
18421
|
+
* TODO: [๐คถ] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
18422
|
+
*/
|
|
18423
|
+
|
|
18424
|
+
const PERSONALITIES = [
|
|
18425
|
+
'Friendly and helpful AI agent.',
|
|
18426
|
+
'Professional and efficient virtual assistant.',
|
|
18427
|
+
'Creative and imaginative digital companion.',
|
|
18428
|
+
'Knowledgeable and informative AI guide.',
|
|
18429
|
+
'Empathetic and understanding support bot.',
|
|
18430
|
+
'Energetic and enthusiastic conversational partner.',
|
|
18431
|
+
'Calm and patient virtual helper.',
|
|
18432
|
+
'Curious and inquisitive AI explorer.',
|
|
18433
|
+
'Witty and humorous digital friend.',
|
|
18434
|
+
'Serious and focused AI consultant.',
|
|
18435
|
+
];
|
|
18436
|
+
/**
|
|
18437
|
+
* @@@@
|
|
18438
|
+
*
|
|
18439
|
+
* @private internal helper function
|
|
18440
|
+
*/
|
|
18441
|
+
function $randomAgentPersona() {
|
|
18442
|
+
return $randomItem(...PERSONALITIES);
|
|
18443
|
+
}
|
|
18444
|
+
/**
|
|
18445
|
+
* TODO: [๐คถ] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
18446
|
+
*/
|
|
18447
|
+
|
|
18296
18448
|
/**
|
|
18297
18449
|
* Generates boilerplate for a new agent book
|
|
18298
18450
|
*
|
|
@@ -18304,20 +18456,27 @@ function aboutPromptbookInformation(options) {
|
|
|
18304
18456
|
function $generateBookBoilerplate(options) {
|
|
18305
18457
|
// eslint-disable-next-line prefer-const
|
|
18306
18458
|
let { agentName, parentAgentName = 'Adam', personaDescription, meta } = options || {};
|
|
18459
|
+
// eslint-disable-next-line prefer-const
|
|
18460
|
+
let { image, color, ...restMeta } = meta || {};
|
|
18307
18461
|
if (!agentName) {
|
|
18308
|
-
|
|
18309
|
-
|
|
18462
|
+
const randomFullnameWithColor = $randomFullnameWithColor();
|
|
18463
|
+
agentName = randomFullnameWithColor.fullname;
|
|
18464
|
+
color = color || randomFullnameWithColor.color;
|
|
18310
18465
|
}
|
|
18311
18466
|
if (!personaDescription) {
|
|
18312
|
-
personaDescription =
|
|
18467
|
+
personaDescription = $randomAgentPersona();
|
|
18313
18468
|
}
|
|
18314
18469
|
const agentSource = validateBook(spaceTrim$1((block) => `
|
|
18315
18470
|
${agentName}
|
|
18316
18471
|
|
|
18472
|
+
META COLOR ${color || '#3498db' /* <- TODO: !!!! Best default color */}
|
|
18317
18473
|
PERSONA ${block(personaDescription)}
|
|
18318
18474
|
`));
|
|
18319
18475
|
return agentSource;
|
|
18320
18476
|
}
|
|
18477
|
+
/**
|
|
18478
|
+
* TODO: [๐คถ] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
18479
|
+
*/
|
|
18321
18480
|
|
|
18322
18481
|
export { $bookTranspilersRegister, $generateBookBoilerplate, $llmToolsMetadataRegister, $llmToolsRegister, $scrapersMetadataRegister, $scrapersRegister, ADMIN_EMAIL, ADMIN_GITHUB_NAME, API_REQUEST_TIMEOUT, AbstractFormatError, Agent, AgentCollectionInSupabase, AgentLlmExecutionTools, AuthenticationError, BIG_DATASET_TRESHOLD, BOOK_LANGUAGE_VERSION, BlackholeStorage, BoilerplateError, BoilerplateFormfactorDefinition, CLAIM, CLI_APP_ID, CallbackInterfaceTools, ChatbotFormfactorDefinition, CollectionError, CompletionFormfactorDefinition, CsvFormatError, CsvFormatParser, DEFAULT_AGENTS_DIRNAME, DEFAULT_BOOK, DEFAULT_BOOKS_DIRNAME, DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, DEFAULT_BOOK_TITLE, DEFAULT_CSV_SETTINGS, DEFAULT_DOWNLOAD_CACHE_DIRNAME, DEFAULT_EXECUTION_CACHE_DIRNAME, DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME, DEFAULT_INTERMEDIATE_FILES_STRATEGY, DEFAULT_IS_AUTO_INSTALLED, DEFAULT_IS_VERBOSE, DEFAULT_MAX_EXECUTION_ATTEMPTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, DEFAULT_MAX_PARALLEL_COUNT, DEFAULT_MAX_REQUESTS_PER_MINUTE, DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME, DEFAULT_PROMPT_TASK_TITLE, DEFAULT_REMOTE_SERVER_URL, DEFAULT_SCRAPE_CACHE_DIRNAME, DEFAULT_TASK_SIMULATED_DURATION_MS, DEFAULT_TASK_TITLE, DatabaseError, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, FAILED_VALUE_PLACEHOLDER, FORMFACTOR_DEFINITIONS, FormattedBookInMarkdownTranspiler, GENERIC_PIPELINE_INTERFACE, GeneratorFormfactorDefinition, GenericFormfactorDefinition, ImageGeneratorFormfactorDefinition, KnowledgeScrapeError, LimitReachedError, MANDATORY_CSV_SETTINGS, MAX_FILENAME_LENGTH, MODEL_ORDERS, MODEL_TRUST_LEVELS, MODEL_VARIANTS, MatcherFormfactorDefinition, MemoryStorage, MissingToolsError, MultipleLlmExecutionTools, NAME, NonTaskSectionTypes, NotAllowed, NotFoundError, NotYetImplementedCommitmentDefinition, NotYetImplementedError, ORDER_OF_PIPELINE_JSON, OpenAiSdkTranspiler, PADDING_LINES, PENDING_VALUE_PLACEHOLDER, PLAYGROUND_APP_ID, PROMPTBOOK_CHAT_COLOR, PROMPTBOOK_COLOR, PROMPTBOOK_ENGINE_VERSION, PROMPTBOOK_ERRORS, PROMPTBOOK_LOGO_URL, PROMPTBOOK_SYNTAX_COLORS, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, PromptbookFetchError, REMOTE_SERVER_URLS, RESERVED_PARAMETER_NAMES, SET_IS_VERBOSE, SectionTypes, SheetsFormfactorDefinition, TaskTypes, TextFormatParser, TranslatorFormfactorDefinition, UNCERTAIN_USAGE, UNCERTAIN_ZERO_VALUE, USER_CHAT_COLOR, UnexpectedError, WrappedError, ZERO_USAGE, ZERO_VALUE, _AgentMetadata, _AgentRegistration, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _BoilerplateScraperMetadataRegistration, _DeepseekMetadataRegistration, _DocumentScraperMetadataRegistration, _GoogleMetadataRegistration, _LegacyDocumentScraperMetadataRegistration, _MarkdownScraperMetadataRegistration, _MarkitdownScraperMetadataRegistration, _OllamaMetadataRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiCompatibleMetadataRegistration, _OpenAiMetadataRegistration, _PdfScraperMetadataRegistration, _WebsiteScraperMetadataRegistration, aboutPromptbookInformation, addUsage, book, cacheLlmTools, compilePipeline, computeCosineSimilarity, countUsage, createAgentLlmExecutionTools, createAgentModelRequirements, createAgentModelRequirementsWithCommitments, createBasicAgentModelRequirements, createEmptyAgentModelRequirements, createLlmToolsFromConfiguration, createPipelineCollectionFromJson, createPipelineCollectionFromPromise, createPipelineCollectionFromUrl, createPipelineExecutor, createPipelineSubcollection, embeddingVectorToString, executionReportJsonToString, extractParameterNamesFromTask, filterModels, generatePlaceholderAgentProfileImageUrl, getAllCommitmentDefinitions, getAllCommitmentTypes, getCommitmentDefinition, getPipelineInterface, getSingleLlmExecutionTools, identificationToPromptbookToken, isCommitmentSupported, isPassingExpectations, isPipelineImplementingInterface, isPipelineInterfacesEqual, isPipelinePrepared, isValidBook, isValidPipelineString, joinLlmExecutionTools, limitTotalUsage, makeKnowledgeSourceHandler, migratePipeline, padBook, parseAgentSource, parseParameters, parsePipeline, pipelineCollectionToJson, pipelineJsonToString, prepareKnowledgePieces, preparePersona, preparePipeline, prettifyPipelineString, promptbookFetch, promptbookTokenToIdentification, unpreparePipeline, usageToHuman, usageToWorktime, validateBook, validatePipeline, validatePipelineString };
|
|
18323
18482
|
//# sourceMappingURL=index.es.js.map
|