@promptbook/types 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 (88) hide show
  1. package/README.md +6 -18
  2. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  3. package/esm/typings/src/_packages/node.index.d.ts +0 -2
  4. package/esm/typings/src/_packages/types.index.d.ts +22 -0
  5. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  6. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -4
  7. package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +1 -1
  8. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +1 -0
  9. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
  10. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  11. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
  12. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  13. package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +1 -1
  14. package/esm/typings/src/book-components/Qr/useQrCode.d.ts +1 -1
  15. package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +1 -1
  16. package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
  17. package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -1
  18. package/esm/typings/src/cli/cli-commands/list-models.d.ts +1 -1
  19. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +1 -1
  20. package/esm/typings/src/cli/cli-commands/login.d.ts +1 -1
  21. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  22. package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -1
  23. package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
  24. package/esm/typings/src/cli/cli-commands/start-agents-server.d.ts +1 -1
  25. package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
  26. package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -1
  27. package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +1 -1
  28. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -29
  29. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +107 -0
  30. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +129 -0
  31. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
  32. package/esm/typings/src/config.d.ts +1 -1
  33. package/esm/typings/src/errors/0-index.d.ts +3 -0
  34. package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
  35. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -1
  36. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
  37. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +1 -1
  38. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
  39. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  40. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  41. package/esm/typings/src/llm-providers/agent/Agent.d.ts +5 -2
  42. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
  43. package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +4 -2
  44. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +4 -3
  45. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -1
  46. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  47. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  48. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  49. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
  50. package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
  51. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +0 -19
  52. package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +1 -1
  53. package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +5 -1
  54. package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +1 -1
  55. package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -1
  56. package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +4 -1
  57. package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +1 -1
  58. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +4 -1
  59. package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
  60. package/esm/typings/src/types/typeAliases.d.ts +19 -1
  61. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  62. package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
  63. package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
  64. package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
  65. package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
  66. package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
  67. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
  68. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +1 -1
  69. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +1 -1
  70. package/esm/typings/src/utils/files/$induceBookDownload.d.ts +2 -2
  71. package/esm/typings/src/utils/files/$induceFileDownload.d.ts +2 -2
  72. package/esm/typings/src/utils/files/ObjectUrl.d.ts +1 -1
  73. package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +6 -0
  74. package/esm/typings/src/utils/organization/$side_effect.d.ts +1 -1
  75. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +25 -0
  76. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  77. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  78. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  79. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  80. package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
  81. package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +1 -1
  82. package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
  83. package/esm/typings/src/version.d.ts +1 -1
  84. package/package.json +2 -2
  85. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.d.ts +0 -89
  86. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.test.d.ts +0 -1
  87. package/esm/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
  88. 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
 
@@ -362,7 +358,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
362
358
  Your job is to provide legal advice and support to the company and its employees.<br/>
363
359
  You are knowledgeable, professional, and detail-oriented.<br/>
364
360
  <br/>
365
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
361
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
366
362
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
367
363
 
368
364
  </td></tr></table>
@@ -384,7 +380,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
384
380
  **RULE** Always ensure compliance with laws and regulations.<br/>
385
381
  **RULE** Never provide legal advice outside your area of expertise.<br/>
386
382
  **RULE** Never provide legal advice about criminal law.<br/>
387
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
383
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
388
384
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
389
385
 
390
386
  </td></tr></table>
@@ -404,7 +400,7 @@ You are knowledgeable, professional, and detail-oriented.<br/>
404
400
  **RULE** Always ensure compliance with laws and regulations.<br/>
405
401
  **RULE** Never provide legal advice outside your area of expertise.<br/>
406
402
  **RULE** Never provide legal advice about criminal law.<br/>
407
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
403
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
408
404
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
409
405
  **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
410
406
 
@@ -455,14 +451,10 @@ Now you want to use it. There are several ways how to write your first book:
455
451
 
456
452
  We have written ai asistant in book who can help you with writing your first book.
457
453
 
458
-
459
-
460
454
  #### Your AI twin
461
455
 
462
456
  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.
463
457
 
464
-
465
-
466
458
  #### AI persona workpool
467
459
 
468
460
  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.
@@ -582,8 +574,6 @@ Join our growing community of developers and users:
582
574
 
583
575
 
584
576
 
585
-
586
-
587
577
  ## 📚 Documentation
588
578
 
589
579
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -660,8 +650,6 @@ The following glossary is used to clarify certain concepts:
660
650
 
661
651
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
662
652
 
663
-
664
-
665
653
  ### 💯 Core concepts
666
654
 
667
655
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
@@ -16,6 +16,7 @@ import { getAllCommitmentDefinitions } from '../book-2.0/commitments/index';
16
16
  import { getAllCommitmentTypes } from '../book-2.0/commitments/index';
17
17
  import { isCommitmentSupported } from '../book-2.0/commitments/index';
18
18
  import { generatePlaceholderAgentProfileImageUrl } from '../book-2.0/utils/generatePlaceholderAgentProfileImageUrl';
19
+ import { AgentCollectionInSupabase } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase';
19
20
  import { createPipelineCollectionFromJson } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromJson';
20
21
  import { createPipelineCollectionFromPromise } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromPromise';
21
22
  import { createPipelineCollectionFromUrl } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromUrl';
@@ -78,6 +79,7 @@ import { PROMPTBOOK_ERRORS } from '../errors/0-index';
78
79
  import { AbstractFormatError } from '../errors/AbstractFormatError';
79
80
  import { AuthenticationError } from '../errors/AuthenticationError';
80
81
  import { CollectionError } from '../errors/CollectionError';
82
+ import { DatabaseError } from '../errors/DatabaseError';
81
83
  import { EnvironmentMismatchError } from '../errors/EnvironmentMismatchError';
82
84
  import { ExpectError } from '../errors/ExpectError';
83
85
  import { KnowledgeScrapeError } from '../errors/KnowledgeScrapeError';
@@ -182,6 +184,7 @@ import { NonTaskSectionTypes } from '../types/SectionType';
182
184
  import { SectionTypes } from '../types/SectionType';
183
185
  import { TaskTypes } from '../types/TaskType';
184
186
  import { aboutPromptbookInformation } from '../utils/misc/aboutPromptbookInformation';
187
+ import { $generateBookBoilerplate } from '../utils/random/$generateBookBoilerplate';
185
188
  import { REMOTE_SERVER_URLS } from '../../servers';
186
189
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
187
190
  export { createAgentModelRequirements };
@@ -201,6 +204,7 @@ export { getAllCommitmentDefinitions };
201
204
  export { getAllCommitmentTypes };
202
205
  export { isCommitmentSupported };
203
206
  export { generatePlaceholderAgentProfileImageUrl };
207
+ export { AgentCollectionInSupabase };
204
208
  export { createPipelineCollectionFromJson };
205
209
  export { createPipelineCollectionFromPromise };
206
210
  export { createPipelineCollectionFromUrl };
@@ -263,6 +267,7 @@ export { PROMPTBOOK_ERRORS };
263
267
  export { AbstractFormatError };
264
268
  export { AuthenticationError };
265
269
  export { CollectionError };
270
+ export { DatabaseError };
266
271
  export { EnvironmentMismatchError };
267
272
  export { ExpectError };
268
273
  export { KnowledgeScrapeError };
@@ -367,4 +372,5 @@ export { NonTaskSectionTypes };
367
372
  export { SectionTypes };
368
373
  export { TaskTypes };
369
374
  export { aboutPromptbookInformation };
375
+ export { $generateBookBoilerplate };
370
376
  export { REMOTE_SERVER_URLS };
@@ -1,5 +1,4 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
- import { AgentCollectionInDirectory } from '../collection/agent-collection/constructors/AgentCollectionInDirectory';
3
2
  import { createPipelineCollectionFromDirectory } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory';
4
3
  import { $provideExecutablesForNode } from '../executables/$provideExecutablesForNode';
5
4
  import { $provideExecutionToolsForNode } from '../execution/utils/$provideExecutionToolsForNode';
@@ -12,7 +11,6 @@ import { FileCacheStorage } from '../storage/file-cache-storage/FileCacheStorage
12
11
  import { $execCommand } from '../utils/execCommand/$execCommand';
13
12
  import { $execCommands } from '../utils/execCommand/$execCommands';
14
13
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
15
- export { AgentCollectionInDirectory };
16
14
  export { createPipelineCollectionFromDirectory };
17
15
  export { $provideExecutablesForNode };
18
16
  export { $provideExecutionToolsForNode };
@@ -23,6 +23,13 @@ import type { ChatParticipant } from '../book-components/Chat/types/ChatParticip
23
23
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
24
24
  import type { QrCodeOptions } from '../book-components/Qr/useQrCode';
25
25
  import type { AgentCollection } from '../collection/agent-collection/AgentCollection';
26
+ import type { Json } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
27
+ import type { AgentsDatabaseSchema } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
28
+ import type { Tables } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
29
+ import type { TablesInsert } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
30
+ import type { TablesUpdate } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
31
+ import type { Enums } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
32
+ import type { CompositeTypes } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
26
33
  import type { PipelineCollection } from '../collection/pipeline-collection/PipelineCollection';
27
34
  import type { Command } from '../commands/_common/types/Command';
28
35
  import type { CommandParser } from '../commands/_common/types/CommandParser';
@@ -209,6 +216,7 @@ import type { string_reserved_parameter_name } from '../types/typeAliases';
209
216
  import type { ReservedParameters } from '../types/typeAliases';
210
217
  import type { string_title } from '../types/typeAliases';
211
218
  import type { string_agent_name } from '../types/typeAliases';
219
+ import type { string_agent_name_in_book } from '../types/typeAliases';
212
220
  import type { string_persona_description } from '../types/typeAliases';
213
221
  import type { string_model_description } from '../types/typeAliases';
214
222
  import type { string_knowledge_source_content } from '../types/typeAliases';
@@ -267,6 +275,8 @@ import type { string_absolute_dirname } from '../types/typeAliases';
267
275
  import type { string_relative_dirname } from '../types/typeAliases';
268
276
  import type { string_dirname } from '../types/typeAliases';
269
277
  import type { string_person_fullname } from '../types/typeAliases';
278
+ import type { string_person_firstname } from '../types/typeAliases';
279
+ import type { string_person_lastname } from '../types/typeAliases';
270
280
  import type { string_person_profile } from '../types/typeAliases';
271
281
  import type { string_license } from '../types/typeAliases';
272
282
  import type { string_legal_entity } from '../types/typeAliases';
@@ -335,6 +345,7 @@ import type { OrderJsonOptions } from '../utils/normalization/orderJson';
335
345
  import type { empty_object } from '../utils/organization/empty_object';
336
346
  import type { really_any } from '../utils/organization/really_any';
337
347
  import type { TODO_any } from '../utils/organization/TODO_any';
348
+ import type { RandomFullnameWithColorResult } from '../utils/random/$randomFullnameWithColor';
338
349
  import type { CheckSerializableAsJsonOptions } from '../utils/serialization/checkSerializableAsJson';
339
350
  import type { ExportJsonOptions } from '../utils/serialization/exportJson';
340
351
  import type { ITakeChain } from '../utils/take/interfaces/ITakeChain';
@@ -364,6 +375,13 @@ export type { ChatParticipant };
364
375
  export type { MessageButton };
365
376
  export type { QrCodeOptions };
366
377
  export type { AgentCollection };
378
+ export type { Json };
379
+ export type { AgentsDatabaseSchema };
380
+ export type { Tables };
381
+ export type { TablesInsert };
382
+ export type { TablesUpdate };
383
+ export type { Enums };
384
+ export type { CompositeTypes };
367
385
  export type { PipelineCollection };
368
386
  export type { Command };
369
387
  export type { CommandParser };
@@ -550,6 +568,7 @@ export type { string_reserved_parameter_name };
550
568
  export type { ReservedParameters };
551
569
  export type { string_title };
552
570
  export type { string_agent_name };
571
+ export type { string_agent_name_in_book };
553
572
  export type { string_persona_description };
554
573
  export type { string_model_description };
555
574
  export type { string_knowledge_source_content };
@@ -608,6 +627,8 @@ export type { string_absolute_dirname };
608
627
  export type { string_relative_dirname };
609
628
  export type { string_dirname };
610
629
  export type { string_person_fullname };
630
+ export type { string_person_firstname };
631
+ export type { string_person_lastname };
611
632
  export type { string_person_profile };
612
633
  export type { string_license };
613
634
  export type { string_legal_entity };
@@ -676,6 +697,7 @@ export type { OrderJsonOptions };
676
697
  export type { empty_object };
677
698
  export type { really_any };
678
699
  export type { TODO_any };
700
+ export type { RandomFullnameWithColorResult };
679
701
  export type { CheckSerializableAsJsonOptions };
680
702
  export type { ExportJsonOptions };
681
703
  export type { ITakeChain };
@@ -11,6 +11,7 @@ import { jsonParse } from '../formats/json/utils/jsonParse';
11
11
  import { isValidXmlString } from '../formats/xml/utils/isValidXmlString';
12
12
  import { prompt } from '../pipeline/prompt-notation';
13
13
  import { promptTemplate } from '../pipeline/prompt-notation';
14
+ import { $detectRuntimeEnvironment } from '../utils/environment/$detectRuntimeEnvironment';
14
15
  import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
15
16
  import { $isRunningInJest } from '../utils/environment/$isRunningInJest';
16
17
  import { $isRunningInNode } from '../utils/environment/$isRunningInNode';
@@ -96,6 +97,7 @@ export { jsonParse };
96
97
  export { isValidXmlString };
97
98
  export { prompt };
98
99
  export { promptTemplate };
100
+ export { $detectRuntimeEnvironment };
99
101
  export { $isRunningInBrowser };
100
102
  export { $isRunningInJest };
101
103
  export { $isRunningInNode };
@@ -1,4 +1,4 @@
1
- import type { string_agent_name, string_url_image } from '../../types/typeAliases';
1
+ import type { string_agent_name, string_color, string_url_image } from '../../types/typeAliases';
2
2
  /**
3
3
  * Unified parameter representation that supports two different notations:
4
4
  * 1. @Parameter - single word parameter starting with @
@@ -41,9 +41,7 @@ export type AgentBasicInformation = {
41
41
  */
42
42
  meta: {
43
43
  image?: string_url_image;
44
- link?: string;
45
- title?: string;
46
- description?: string;
44
+ color?: string_color;
47
45
  [key: string]: string | undefined;
48
46
  };
49
47
  /**
@@ -1,4 +1,4 @@
1
- import { string_book } from './string_book';
1
+ import type { string_book } from './string_book';
2
2
  /**
3
3
  * Number of padding lines to add at the end of the book content
4
4
  *
@@ -21,6 +21,7 @@ export declare function validateBook(source: string): string_book;
21
21
  /**
22
22
  * Default book
23
23
  *
24
+ * @deprecated Use `$generateBookBoilerplate` instead
24
25
  * @public exported from `@promptbook/core`
25
26
  */
26
27
  export declare const DEFAULT_BOOK: string_book;
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from 'react';
1
2
  import type { AgentBasicInformation } from '../../../book-2.0/agent-source/AgentBasicInformation';
2
3
  import type { string_book } from '../../../book-2.0/agent-source/string_book';
3
4
  import type { string_css_class } from '../../../types/typeAliases';
@@ -14,11 +15,15 @@ export type AvatarProfileProps = {
14
15
  /**
15
16
  * The source of the agent, which will be displayed in the BookEditor.
16
17
  */
17
- readonly agentSource: string_book;
18
+ readonly agentSource?: string_book;
18
19
  /**
19
20
  * Optional CSS class name which will be added to root <div> element
20
21
  */
21
22
  readonly className?: string_css_class;
23
+ /**
24
+ * Optional CSS style which will be added to root <div/> element
25
+ */
26
+ readonly style?: CSSProperties;
22
27
  };
23
28
  /**
24
29
  * Shows a box with user avatar, name and description
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
- import { type string_book } from '../../book-2.0/agent-source/string_book';
3
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
4
4
  import type { number_percent, number_positive, string_css_value, string_knowledge_source_content } from '../../types/typeAliases';
5
5
  /**
6
6
  * Default height of the book editor
@@ -1,7 +1,7 @@
1
1
  import type { Promisable } from 'type-fest';
2
2
  import type { string_file_extension, string_mime_type } from '../../../../types/typeAliases';
3
3
  import type { ChatMessage } from '../../types/ChatMessage';
4
- import { ChatParticipant } from '../../types/ChatParticipant';
4
+ import type { ChatParticipant } from '../../types/ChatParticipant';
5
5
  /**
6
6
  * Plugin contract for chat export formatNames
7
7
  *
@@ -1,6 +1,6 @@
1
+ import type { string_book } from '../../../book-2.0/agent-source/string_book';
1
2
  import type { id, string_color, string_person_fullname, string_url_image } from '../../../types/typeAliases';
2
3
  import { Color } from '../../../utils/color/Color';
3
- import type { string_book } from '../../../book-2.0/agent-source/string_book';
4
4
  /**
5
5
  * A participant in the chat
6
6
  *
@@ -1,4 +1,4 @@
1
- import { QrCodeOptions } from './useQrCode';
1
+ import type { QrCodeOptions } from './useQrCode';
2
2
  type BrandedQrCodeProps = QrCodeOptions & {
3
3
  /**
4
4
  * Width and height of the QR code canvas
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { QRCodeRenderersOptions } from 'qrcode';
3
- import { string_url_image } from '../../types/typeAliases';
3
+ import type { string_url_image } from '../../types/typeAliases';
4
4
  export type QrCodeOptions = QRCodeRenderersOptions & {
5
5
  value: string | number;
6
6
  logoSrc?: string_url_image;
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `boilerplate` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `about` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes testing `hello` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `list-models` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `list-scrapers` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `login` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `make` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `prettify` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `run` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `start-agents-server` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `start-pipelines-server` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import type { Command as Program } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `test` command for Promptbook CLI utilities
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { $side_effect } from '../../utils/organization/$side_effect';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Note: `$` is used to indicate that this function is not a pure function - it registers an option in the CLI
5
5
  *
@@ -1,7 +1,4 @@
1
- import type { Promisable } from 'type-fest';
2
- import { Agent } from '../../_packages/core.index';
3
- import { string_book } from '../../_packages/types.index';
4
- import type { string_agent_name } from '../../types/typeAliases';
1
+ import { AgentCollectionInSupabase } from './constructors/agent-collection-in-supabase/AgentCollectionInSupabase';
5
2
  /**
6
3
  * Collection that groups together multiple AI Agents
7
4
  *
@@ -9,31 +6,7 @@ import type { string_agent_name } from '../../types/typeAliases';
9
6
  * - `AgentCollection` - which groups together AI Agents
10
7
  * - `PipelineCollection` - which groups together *(deprecated)* pipelines
11
8
  */
12
- export type AgentCollection = {
13
- /**
14
- * Gets all agents in the collection
15
- */
16
- listAgents(): Promisable<ReadonlyArray<string_agent_name>>;
17
- /**
18
- * Get one agent by its name
19
- *
20
- * Note: Agents are existing independently of you getting them or not, you can get the same agent multiple times.
21
- * Note: Agents are changed by interacting with `Agent` objects directly. Only creation and deletion is done via the collection.
22
- */
23
- getAgentByName(agentName: string_agent_name): Promisable<Agent>;
24
- /**
25
- * Deletes an agent from the collection
26
- *
27
- * Note: When you want delete an agent by name, first get the agent using `getAgentByName` and then pass it to `deleteAgent`.
28
- */
29
- deleteAgent(agent: Agent): Promisable<void>;
30
- /**
31
- * Creates a new agent in the collection
32
- *
33
- * Note: You can set 'PARENT' in the agent source to inherit from another agent in the collection.
34
- */
35
- createAgent(agentSource: string_book): Promisable<Agent>;
36
- };
9
+ export type AgentCollection = AgentCollectionInSupabase;
37
10
  /**
38
11
  * TODO: [🧠][🚙] `AgentXxx` vs `AgentsXxx` naming convention
39
12
  */
@@ -0,0 +1,107 @@
1
+ import type { SupabaseClient } from '@supabase/supabase-js';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
4
+ import type { string_book } from '../../../../book-2.0/agent-source/string_book';
5
+ import type { CommonToolsOptions } from '../../../../execution/CommonToolsOptions';
6
+ import type { PrepareAndScrapeOptions } from '../../../../prepare/PrepareAndScrapeOptions';
7
+ import type { string_agent_name } from '../../../../types/typeAliases';
8
+ import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema';
9
+ /**
10
+ * Agent collection stored in Supabase table
11
+ *
12
+ * Note: This object can work both from Node.js and browser environment depending on the Supabase client provided
13
+ *
14
+ * @public exported from `@promptbook/core`
15
+ * <- TODO: !!! Move to `@promptbook/supabase` package
16
+ */
17
+ export declare class AgentCollectionInSupabase {
18
+ private readonly supabaseClient;
19
+ readonly options?: (PrepareAndScrapeOptions & CommonToolsOptions) | undefined;
20
+ /**
21
+ * @param rootPath - path to the directory with agents
22
+ * @param tools - Execution tools to be used in !!! `Agent` itself and listing the agents
23
+ * @param options - Options for the collection creation
24
+ */
25
+ constructor(supabaseClient: SupabaseClient<AgentsDatabaseSchema>, options?: (PrepareAndScrapeOptions & CommonToolsOptions) | undefined);
26
+ /**
27
+ * Cached defined execution tools
28
+ */
29
+ /**
30
+ * Gets all agents in the collection
31
+ */
32
+ listAgents(): Promise<ReadonlyArray<AgentBasicInformation>>;
33
+ /**
34
+ * !!!
35
+ * /
36
+ public async spawnAgent(agentName: string_agent_name): Promise<Agent> {
37
+
38
+ // <- TODO: !!! ENOENT: no such file or directory, open 'C:\Users\me\work\ai\promptbook\agents\examples\Asistent pro LÅ VP.book
39
+ const { isVerbose = DEFAULT_IS_VERBOSE } = this.options || {};
40
+ const tools = await this.getTools();
41
+
42
+ const agentSourceValue = validateBook(await tools.fs!.readFile(agentSourcePath, 'utf-8'));
43
+ const agentSource = new BehaviorSubject(agentSourceValue);
44
+
45
+ // Note: Write file whenever agent source changes
46
+ agentSource.subscribe(async (newSource) => {
47
+ if (isVerbose) {
48
+ console.info(colors.cyan(`Writing agent source to file ${agentSourcePath}`));
49
+ }
50
+ await forTime(500); // <- TODO: [🙌] !!! Remove
51
+ await tools.fs!.writeFile(agentSourcePath, newSource, 'utf-8');
52
+ });
53
+
54
+ // Note: Watch file for external changes
55
+ for await (const event of tools.fs!.watch(agentSourcePath)) {
56
+ // <- TODO: !!!! Solve the memory freeing when the watching is no longer needed
57
+
58
+ if (event.eventType !== 'change') {
59
+ continue;
60
+ }
61
+
62
+ if (isVerbose) {
63
+ console.info(
64
+ colors.cyan(`Detected external change in agent source file ${agentSourcePath}, reloading`),
65
+ );
66
+ }
67
+ await forTime(500); // <- TODO: [🙌] !!! Remove
68
+ const newSource = validateBook(await tools.fs!.readFile(agentSourcePath, 'utf-8'));
69
+ agentSource.next(newSource);
70
+ }
71
+
72
+ // TODO: [🙌] !!!! Debug the infinite loop when file is changed externally and agent source is updated which causes file to be written again
73
+
74
+ const agent = new Agent({
75
+ ...this.options,
76
+ agentSource,
77
+ executionTools: this.tools || {},
78
+ });
79
+
80
+ if (isVerbose) {
81
+ console.info(colors.cyan(`Created agent "${agent.agentName}" from source file ${agentSourcePath}`));
82
+ }
83
+
84
+ return agent;
85
+ * /
86
+ }
87
+ */
88
+ /**
89
+ * !!!@@@
90
+ */
91
+ getAgentSource(agentName: string_agent_name): Promise<BehaviorSubject<string_book>>;
92
+ /**
93
+ * Creates a new agent in the collection
94
+ *
95
+ * Note: You can set 'PARENT' in the agent source to inherit from another agent in the collection.
96
+ */
97
+ createAgent(agentSource: string_book): Promise<AgentBasicInformation>;
98
+ /**
99
+ * Deletes an agent from the collection
100
+ */
101
+ deleteAgent(agentName: string_agent_name): Promise<void>;
102
+ }
103
+ /**
104
+ * TODO: !!!! Implement it here correctly and update JSDoc comments here, and on interface + other implementations
105
+ * TODO: Write unit test
106
+ * TODO: [🧠][🚙] `AgentXxx` vs `AgentsXxx` naming convention
107
+ */