@promptbook/cli 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.
Files changed (27) hide show
  1. package/README.md +6 -18
  2. package/esm/index.es.js +56 -13
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/types.index.d.ts +8 -0
  5. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +5 -0
  6. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -28
  7. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +61 -9
  8. package/esm/typings/src/errors/DatabaseError.d.ts +3 -0
  9. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  10. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  11. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +2 -1
  12. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  13. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  14. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  15. package/esm/typings/src/types/typeAliases.d.ts +19 -1
  16. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  17. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +5 -2
  18. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  19. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  20. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  21. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  22. package/esm/typings/src/utils/random/$randomToken.d.ts +1 -0
  23. package/esm/typings/src/version.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/umd/index.umd.js +56 -13
  26. package/umd/index.umd.js.map +1 -1
  27. 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
- [![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
 
@@ -237,7 +233,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
237
233
  Your job is to provide legal advice and support to the company and its employees.<br/>
238
234
  You are knowledgeable, professional, and detail-oriented.<br/>
239
235
  <br/>
240
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
236
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
241
237
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
242
238
 
243
239
  </td></tr></table>
@@ -259,7 +255,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
259
255
  **RULE** Always ensure compliance with laws and regulations.<br/>
260
256
  **RULE** Never provide legal advice outside your area of expertise.<br/>
261
257
  **RULE** Never provide legal advice about criminal law.<br/>
262
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
258
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
263
259
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
264
260
 
265
261
  </td></tr></table>
@@ -279,7 +275,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
279
275
  **RULE** Always ensure compliance with laws and regulations.<br/>
280
276
  **RULE** Never provide legal advice outside your area of expertise.<br/>
281
277
  **RULE** Never provide legal advice about criminal law.<br/>
282
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
278
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
283
279
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
284
280
  **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
285
281
 
@@ -330,14 +326,10 @@ Now you want to use it. There are several ways how to write your first book:
330
326
 
331
327
  We have written ai asistant in book who can help you with writing your first book.
332
328
 
333
-
334
-
335
329
  #### Your AI twin
336
330
 
337
331
  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.
338
332
 
339
-
340
-
341
333
  #### AI persona workpool
342
334
 
343
335
  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.
@@ -457,8 +449,6 @@ Join our growing community of developers and users:
457
449
 
458
450
 
459
451
 
460
-
461
-
462
452
  ## ๐Ÿ“š Documentation
463
453
 
464
454
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -535,8 +525,6 @@ The following glossary is used to clarify certain concepts:
535
525
 
536
526
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
537
527
 
538
-
539
-
540
528
  ### ๐Ÿ’ฏ Core concepts
541
529
 
542
530
  - [๐Ÿ“š Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -40,14 +40,14 @@ import { Converter } from 'showdown';
40
40
  * @generated
41
41
  * @see https://github.com/webgptorg/book
42
42
  */
43
- const BOOK_LANGUAGE_VERSION = '1.0.0';
43
+ const BOOK_LANGUAGE_VERSION = '2.0.0';
44
44
  /**
45
45
  * The version of the Promptbook engine
46
46
  *
47
47
  * @generated
48
48
  * @see https://github.com/webgptorg/promptbook
49
49
  */
50
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-43';
50
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-44';
51
51
  /**
52
52
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
53
53
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
@@ -3197,6 +3197,9 @@ class DatabaseError extends Error {
3197
3197
  Object.setPrototypeOf(this, DatabaseError.prototype);
3198
3198
  }
3199
3199
  }
3200
+ /**
3201
+ * TODO: !!!! Explain that NotFoundError (!!! and other specific errors) has priority over DatabaseError in some contexts
3202
+ */
3200
3203
 
3201
3204
  /**
3202
3205
  * This error occurs when some expectation is not met in the execution of the pipeline
@@ -3313,6 +3316,7 @@ function $randomToken(randomness) {
3313
3316
  return randomBytes(randomness).toString('hex');
3314
3317
  }
3315
3318
  /**
3319
+ * TODO: [๐Ÿคถ] Maybe export through `@promptbook/utils` or `@promptbook/random` package
3316
3320
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
3317
3321
  */
3318
3322
 
@@ -4675,6 +4679,7 @@ function joinLlmExecutionTools(title, ...llmExecutionTools) {
4675
4679
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4676
4680
  }
4677
4681
  /**
4682
+ * TODO: [๐Ÿ™†] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4678
4683
  * TODO: [๐Ÿ‘ทโ€โ™‚๏ธ] @@@ Manual about construction of llmTools
4679
4684
  */
4680
4685
 
@@ -7322,6 +7327,7 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
7322
7327
  return llmTools;
7323
7328
  }
7324
7329
  /**
7330
+ * TODO: [๐Ÿ™†] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
7325
7331
  * TODO: [๐Ÿ‘ทโ€โ™‚๏ธ] @@@ Manual about construction of llmTools
7326
7332
  */
7327
7333
 
@@ -16697,7 +16703,7 @@ function pricing(value) {
16697
16703
  /**
16698
16704
  * List of available Anthropic Claude models with pricing
16699
16705
  *
16700
- * Note: Synced with official API docs at 2025-08-20
16706
+ * Note: Synced with official API docs at 2025-11-19
16701
16707
  *
16702
16708
  * @see https://docs.anthropic.com/en/docs/models-overview
16703
16709
  * @public exported from `@promptbook/anthropic-claude`
@@ -16705,6 +16711,26 @@ function pricing(value) {
16705
16711
  const ANTHROPIC_CLAUDE_MODELS = exportJson({
16706
16712
  name: 'ANTHROPIC_CLAUDE_MODELS',
16707
16713
  value: [
16714
+ {
16715
+ modelVariant: 'CHAT',
16716
+ modelTitle: 'Claude Sonnet 4.5',
16717
+ modelName: 'claude-sonnet-4-5-20250929',
16718
+ modelDescription: 'Our smartest model for complex agents and coding',
16719
+ pricing: {
16720
+ prompt: pricing(`$3.00 / 1M tokens`),
16721
+ output: pricing(`$15.00 / 1M tokens`),
16722
+ },
16723
+ },
16724
+ {
16725
+ modelVariant: 'CHAT',
16726
+ modelTitle: 'Claude Haiku 4.5',
16727
+ modelName: 'claude-haiku-4-5-20251001',
16728
+ modelDescription: 'Our fastest model with near-frontier intelligence',
16729
+ pricing: {
16730
+ prompt: pricing(`$1.00 / 1M tokens`),
16731
+ output: pricing(`$5.00 / 1M tokens`),
16732
+ },
16733
+ },
16708
16734
  {
16709
16735
  modelVariant: 'CHAT',
16710
16736
  modelTitle: 'Claude Opus 4.1',
@@ -16719,7 +16745,7 @@ const ANTHROPIC_CLAUDE_MODELS = exportJson({
16719
16745
  modelVariant: 'CHAT',
16720
16746
  modelTitle: 'Claude Opus 4',
16721
16747
  modelName: 'claude-opus-4-20250514',
16722
- modelDescription: 'Previous flagship Claude model with 200K token context window. Features very high intelligence and capability with exceptional performance across reasoning, coding, and creative tasks. Maintains strong safety guardrails while delivering sophisticated outputs for complex professional applications.',
16748
+ modelDescription: 'Previous flagship Claude model with 200K token context window. Features very high intelligence and capability with exceptional performance across reasoning, coding, and creative tasks. Maintains strong safety guardrails while delivering sophisticated outputs for complex professional applications. DEPRECATED: Use Claude Opus 4.1 instead.',
16723
16749
  pricing: {
16724
16750
  prompt: pricing(`$15.00 / 1M tokens`),
16725
16751
  output: pricing(`$75.00 / 1M tokens`),
@@ -16729,7 +16755,7 @@ const ANTHROPIC_CLAUDE_MODELS = exportJson({
16729
16755
  modelVariant: 'CHAT',
16730
16756
  modelTitle: 'Claude Sonnet 4',
16731
16757
  modelName: 'claude-sonnet-4-20250514',
16732
- modelDescription: 'High-performance Claude model with exceptional reasoning capabilities and 200K token context window (1M context beta available). Features balanced intelligence and efficiency with enhanced multimodal understanding. Offers optimal performance for most enterprise applications requiring sophisticated AI capabilities.',
16758
+ modelDescription: 'High-performance Claude model with exceptional reasoning capabilities and 200K token context window (1M context beta available). Features balanced intelligence and efficiency with enhanced multimodal understanding. Offers optimal performance for most enterprise applications requiring sophisticated AI capabilities. DEPRECATED: Use Claude Sonnet 4.5 instead.',
16733
16759
  pricing: {
16734
16760
  prompt: pricing(`$3.00 / 1M tokens`),
16735
16761
  output: pricing(`$15.00 / 1M tokens`),
@@ -17258,7 +17284,7 @@ const _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
17258
17284
  /**
17259
17285
  * List of available OpenAI models with pricing
17260
17286
  *
17261
- * Note: Synced with official API docs at 2025-08-20
17287
+ * Note: Synced with official API docs at 2025-11-19
17262
17288
  *
17263
17289
  * @see https://platform.openai.com/docs/models/
17264
17290
  * @see https://openai.com/api/pricing/
@@ -17268,11 +17294,21 @@ const OPENAI_MODELS = exportJson({
17268
17294
  name: 'OPENAI_MODELS',
17269
17295
  value: [
17270
17296
  /**/
17297
+ {
17298
+ modelVariant: 'CHAT',
17299
+ modelTitle: 'gpt-5.1',
17300
+ modelName: 'gpt-5.1',
17301
+ modelDescription: 'The best model for coding and agentic tasks with configurable reasoning effort.',
17302
+ pricing: {
17303
+ prompt: pricing(`$1.25 / 1M tokens`),
17304
+ output: pricing(`$10.00 / 1M tokens`),
17305
+ },
17306
+ },
17271
17307
  {
17272
17308
  modelVariant: 'CHAT',
17273
17309
  modelTitle: 'gpt-5',
17274
17310
  modelName: 'gpt-5',
17275
- 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.",
17311
+ 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.",
17276
17312
  pricing: {
17277
17313
  prompt: pricing(`$1.25 / 1M tokens`),
17278
17314
  output: pricing(`$10.00 / 1M tokens`),
@@ -18707,7 +18743,7 @@ const _GoogleMetadataRegistration = $llmToolsMetadataRegister.register({
18707
18743
  /**
18708
18744
  * List of available Google models with descriptions
18709
18745
  *
18710
- * Note: Synced with official API docs at 2025-08-20
18746
+ * Note: Synced with official API docs at 2025-11-19
18711
18747
  *
18712
18748
  * @see https://ai.google.dev/models/gemini
18713
18749
  * @public exported from `@promptbook/google`
@@ -18715,6 +18751,13 @@ const _GoogleMetadataRegistration = $llmToolsMetadataRegister.register({
18715
18751
  const GOOGLE_MODELS = exportJson({
18716
18752
  name: 'GOOGLE_MODELS',
18717
18753
  value: [
18754
+ {
18755
+ modelVariant: 'CHAT',
18756
+ modelTitle: 'Gemini 3 Pro',
18757
+ modelName: 'gemini-3-pro-preview',
18758
+ modelDescription: 'The best model in the world for multimodal understanding, and our most powerful agentic and vibe-coding model yet, delivering richer visuals and deeper interactivity, all built on a foundation of state-of-the-art reasoning.',
18759
+ // TODO: [๐Ÿง ] Add pricing information for Gemini 3 Pro
18760
+ },
18718
18761
  {
18719
18762
  modelVariant: 'CHAT',
18720
18763
  modelTitle: 'Gemini 2.5 Pro',
@@ -20516,11 +20559,11 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
20516
20559
  if (!this.isCreatingNewAssistantsAllowed) {
20517
20560
  throw new NotAllowed(`Creating new assistants is not allowed. Set \`isCreatingNewAssistantsAllowed: true\` in options to enable this feature.`);
20518
20561
  }
20519
- await this.playground();
20562
+ // await this.playground();
20520
20563
  const { name, instructions } = options;
20521
20564
  const client = await this.getClient();
20522
- /*
20523
- TODO: !!!
20565
+ /*/
20566
+ //TODO: !!!
20524
20567
  async function downloadFile(url: string, folder = './tmp'): Promise<string> {
20525
20568
  const filename = path.basename(url.split('?')[0]);
20526
20569
  const filepath = path.join(folder, filename);
@@ -20564,8 +20607,8 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
20564
20607
  const file = await uploadFileToOpenAI(filepath);
20565
20608
  uploadedFiles.push(file.id);
20566
20609
  }
20567
- */
20568
- alert('!!!! Creating new OpenAI assistant');
20610
+ /**/
20611
+ // alert('!!!! Creating new OpenAI assistant');
20569
20612
  // 3๏ธโƒฃ Create assistant with uploaded files
20570
20613
  const assistant = await client.beta.assistants.create({
20571
20614
  name,