@promptbook/legacy-documents 0.105.0-8 → 0.105.0

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 (114) hide show
  1. package/README.md +0 -4
  2. package/esm/index.es.js +13 -13
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/components.index.d.ts +20 -0
  6. package/esm/typings/src/_packages/core.index.d.ts +21 -11
  7. package/esm/typings/src/_packages/node.index.d.ts +2 -0
  8. package/esm/typings/src/_packages/openai.index.d.ts +4 -0
  9. package/esm/typings/src/_packages/types.index.d.ts +32 -2
  10. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  11. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +10 -1
  12. package/esm/typings/src/book-2.0/agent-source/parseTeamCommitment.d.ts +28 -0
  13. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  14. package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
  15. package/esm/typings/src/book-components/Chat/AgentChip/AgentChip.d.ts +67 -0
  16. package/esm/typings/src/book-components/Chat/AgentChip/index.d.ts +2 -0
  17. package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +33 -1
  18. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +87 -6
  19. package/esm/typings/src/book-components/Chat/Chat/ChatSoundToggle.d.ts +23 -0
  20. package/esm/typings/src/book-components/Chat/Chat/ClockIcon.d.ts +9 -0
  21. package/esm/typings/src/book-components/Chat/LlmChat/FriendlyErrorMessage.d.ts +20 -0
  22. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +13 -0
  23. package/esm/typings/src/book-components/Chat/SourceChip/SourceChip.d.ts +35 -0
  24. package/esm/typings/src/book-components/Chat/SourceChip/index.d.ts +2 -0
  25. package/esm/typings/src/book-components/Chat/effects/ChatEffectsSystem.d.ts +14 -0
  26. package/esm/typings/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +18 -0
  27. package/esm/typings/src/book-components/Chat/effects/components/HeartsEffect.d.ts +18 -0
  28. package/esm/typings/src/book-components/Chat/effects/configs/defaultEffectConfigs.d.ts +7 -0
  29. package/esm/typings/src/book-components/Chat/effects/index.d.ts +18 -0
  30. package/esm/typings/src/book-components/Chat/effects/types/ChatEffect.d.ts +20 -0
  31. package/esm/typings/src/book-components/Chat/effects/types/ChatEffectConfig.d.ts +21 -0
  32. package/esm/typings/src/book-components/Chat/effects/types/ChatEffectType.d.ts +6 -0
  33. package/esm/typings/src/book-components/Chat/effects/types/ChatEffectsSystemProps.d.ts +32 -0
  34. package/esm/typings/src/book-components/Chat/effects/utils/detectEffects.d.ts +12 -0
  35. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +34 -6
  36. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +8 -0
  37. package/esm/typings/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +12 -0
  38. package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +40 -0
  39. package/esm/typings/src/book-components/Chat/utils/loadAgentProfile.d.ts +69 -0
  40. package/esm/typings/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +53 -0
  41. package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.d.ts +11 -0
  42. package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.test.d.ts +1 -0
  43. package/esm/typings/src/book-components/Chat/utils/toolCallParsing.d.ts +64 -0
  44. package/esm/typings/src/book-components/icons/EmailIcon.d.ts +15 -0
  45. package/esm/typings/src/commitments/TEAM/TEAM.d.ts +45 -0
  46. package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.d.ts +44 -0
  47. package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.test.d.ts +1 -0
  48. package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +19 -1
  49. package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +22 -0
  50. package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +13 -0
  51. package/esm/typings/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +48 -0
  52. package/esm/typings/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +11 -0
  53. package/esm/typings/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +18 -0
  54. package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +46 -0
  55. package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.test.d.ts +1 -0
  56. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +5 -0
  57. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +1 -0
  58. package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +6 -0
  59. package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
  60. package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +6 -0
  61. package/esm/typings/src/commitments/_base/formatOptionalInstructionBlock.d.ts +6 -0
  62. package/esm/typings/src/commitments/_common/commitmentToolFunctions.d.ts +26 -0
  63. package/esm/typings/src/commitments/_common/getAllCommitmentDefinitions.d.ts +8 -0
  64. package/esm/typings/src/commitments/_common/getAllCommitmentTypes.d.ts +8 -0
  65. package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForBrowser.d.ts +9 -0
  66. package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +13 -0
  67. package/esm/typings/src/commitments/_common/getAllCommitmentsToolTitles.d.ts +7 -0
  68. package/esm/typings/src/commitments/_common/getCommitmentDefinition.d.ts +10 -0
  69. package/esm/typings/src/commitments/_common/getGroupedCommitmentDefinitions.d.ts +17 -0
  70. package/esm/typings/src/commitments/_common/isCommitmentSupported.d.ts +9 -0
  71. package/esm/typings/src/commitments/index.d.ts +5 -58
  72. package/esm/typings/src/config.d.ts +6 -0
  73. package/esm/typings/src/constants.d.ts +129 -0
  74. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -0
  75. package/esm/typings/src/execution/AvailableModel.d.ts +5 -4
  76. package/esm/typings/src/execution/PromptResult.d.ts +2 -19
  77. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
  78. package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +1 -0
  79. package/esm/typings/src/llm-providers/agent/Agent.d.ts +15 -1
  80. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +6 -1
  81. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +5 -0
  82. package/esm/typings/src/llm-providers/google/createGoogleExecutionTools.d.ts +1 -0
  83. package/esm/typings/src/llm-providers/openai/OpenAiAgentExecutionTools.d.ts +43 -0
  84. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +4 -2
  85. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +1 -1
  86. package/esm/typings/src/llm-providers/openai/createOpenAiAgentExecutionTools.d.ts +11 -0
  87. package/esm/typings/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +7 -0
  88. package/esm/typings/src/pipeline/prompt-notation.d.ts +27 -2
  89. package/esm/typings/src/pipeline/prompt-notation.test.d.ts +1 -1
  90. package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +1 -0
  91. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -0
  92. package/esm/typings/src/scrapers/_common/register/$provideScriptingForNode.d.ts +1 -0
  93. package/esm/typings/src/search-engines/SearchEngine.d.ts +1 -1
  94. package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +1 -1
  95. package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +1 -1
  96. package/esm/typings/src/search-engines/google/GoogleSearchEngine.d.ts +1 -1
  97. package/esm/typings/src/search-engines/serp/SerpSearchEngine.d.ts +1 -1
  98. package/esm/typings/src/speech-recognition/OpenAiSpeechRecognition.d.ts +3 -0
  99. package/esm/typings/src/types/ModelRequirements.d.ts +6 -0
  100. package/esm/typings/src/types/Prompt.d.ts +12 -0
  101. package/esm/typings/src/types/ToolCall.d.ts +37 -0
  102. package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -2
  103. package/esm/typings/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -1
  104. package/esm/typings/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
  105. package/esm/typings/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -1
  106. package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +1 -3
  107. package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -2
  108. package/esm/typings/src/utils/misc/linguisticHash.d.ts +4 -1
  109. package/esm/typings/src/utils/parameters/templateParameters.d.ts +1 -2
  110. package/esm/typings/src/version.d.ts +1 -1
  111. package/esm/typings/src/wizard/wizard.d.ts +1 -4
  112. package/package.json +2 -2
  113. package/umd/index.umd.js +13 -13
  114. package/umd/index.umd.js.map +1 -1
@@ -1,4 +1,5 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
+ import { getAllCommitmentsToolFunctionsForBrowser } from '../commitments/_common/getAllCommitmentsToolFunctionsForBrowser';
2
3
  import { SimplePromptInterfaceTools } from '../dialogs/simple-prompt/SimplePromptInterfaceTools';
3
4
  import { $provideScrapersForBrowser } from '../scrapers/_common/register/$provideScrapersForBrowser';
4
5
  import { BrowserSpeechRecognition } from '../speech-recognition/BrowserSpeechRecognition';
@@ -9,6 +10,7 @@ import { $induceBookDownload } from '../utils/files/$induceBookDownload';
9
10
  import { $induceFileDownload } from '../utils/files/$induceFileDownload';
10
11
  import { ObjectUrl } from '../utils/files/ObjectUrl';
11
12
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
13
+ export { getAllCommitmentsToolFunctionsForBrowser };
12
14
  export { SimplePromptInterfaceTools };
13
15
  export { $provideScrapersForBrowser };
14
16
  export { BrowserSpeechRecognition };
@@ -13,7 +13,17 @@ import { BookEditor } from '../book-components/BookEditor/BookEditor';
13
13
  import { AgentChat } from '../book-components/Chat/AgentChat/AgentChat';
14
14
  import type { AgentChatProps } from '../book-components/Chat/AgentChat/AgentChatProps';
15
15
  import { Chat } from '../book-components/Chat/Chat/Chat';
16
+ import type { ChatSoundSystem } from '../book-components/Chat/Chat/ChatProps';
16
17
  import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
18
+ import { ChatSoundToggle } from '../book-components/Chat/Chat/ChatSoundToggle';
19
+ import { ChatEffectsSystem } from '../book-components/Chat/effects/ChatEffectsSystem';
20
+ import { ConfettiEffect } from '../book-components/Chat/effects/components/ConfettiEffect';
21
+ import { HeartsEffect } from '../book-components/Chat/effects/components/HeartsEffect';
22
+ import { defaultEffectConfigs } from '../book-components/Chat/effects/configs/defaultEffectConfigs';
23
+ import type { ChatEffect } from '../book-components/Chat/effects/types/ChatEffect';
24
+ import type { ChatEffectConfig } from '../book-components/Chat/effects/types/ChatEffectConfig';
25
+ import type { ChatEffectsSystemProps } from '../book-components/Chat/effects/types/ChatEffectsSystemProps';
26
+ import type { ChatEffectType } from '../book-components/Chat/effects/types/ChatEffectType';
17
27
  import { useChatAutoScroll } from '../book-components/Chat/hooks/useChatAutoScroll';
18
28
  import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
19
29
  import { useSendMessageToLlmChat } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
@@ -71,7 +81,17 @@ export { BookEditor };
71
81
  export { AgentChat };
72
82
  export type { AgentChatProps };
73
83
  export { Chat };
84
+ export type { ChatSoundSystem };
74
85
  export type { ChatProps };
86
+ export { ChatSoundToggle };
87
+ export { ChatEffectsSystem };
88
+ export { ConfettiEffect };
89
+ export { HeartsEffect };
90
+ export { defaultEffectConfigs };
91
+ export type { ChatEffect };
92
+ export type { ChatEffectConfig };
93
+ export type { ChatEffectsSystemProps };
94
+ export type { ChatEffectType };
75
95
  export { useChatAutoScroll };
76
96
  export type { SendMessageToLlmChatFunction };
77
97
  export { useSendMessageToLlmChat };
@@ -21,13 +21,12 @@ import { pipelineCollectionToJson } from '../collection/pipeline-collection/pipe
21
21
  import { createEmptyAgentModelRequirements } from '../commitments/_base/createEmptyAgentModelRequirements';
22
22
  import { createBasicAgentModelRequirements } from '../commitments/_base/createEmptyAgentModelRequirements';
23
23
  import { NotYetImplementedCommitmentDefinition } from '../commitments/_base/NotYetImplementedCommitmentDefinition';
24
- import { getCommitmentDefinition } from '../commitments/index';
25
- import { getAllCommitmentDefinitions } from '../commitments/index';
26
- import { getAllCommitmentTypes } from '../commitments/index';
27
- import { isCommitmentSupported } from '../commitments/index';
28
- import type { GroupedCommitmentDefinition } from '../commitments/index';
29
- import { getGroupedCommitmentDefinitions } from '../commitments/index';
30
- import { getAllCommitmentsToolFunctions } from '../commitments/index';
24
+ import { getAllCommitmentDefinitions } from '../commitments/_common/getAllCommitmentDefinitions';
25
+ import { getAllCommitmentsToolTitles } from '../commitments/_common/getAllCommitmentsToolTitles';
26
+ import { getAllCommitmentTypes } from '../commitments/_common/getAllCommitmentTypes';
27
+ import { getCommitmentDefinition } from '../commitments/_common/getCommitmentDefinition';
28
+ import { getGroupedCommitmentDefinitions } from '../commitments/_common/getGroupedCommitmentDefinitions';
29
+ import { isCommitmentSupported } from '../commitments/_common/isCommitmentSupported';
31
30
  import { NAME } from '../config';
32
31
  import { ADMIN_EMAIL } from '../config';
33
32
  import { PROMPTBOOK_LEGAL_ENTITY } from '../config';
@@ -48,6 +47,7 @@ import { PENDING_VALUE_PLACEHOLDER } from '../config';
48
47
  import { MAX_FILENAME_LENGTH } from '../config';
49
48
  import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
50
49
  import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
50
+ import { DEFAULT_MAX_CONCURRENT_UPLOADS } from '../config';
51
51
  import { DEFAULT_MAX_RECURSION } from '../config';
52
52
  import { DEFAULT_MAX_EXECUTION_ATTEMPTS } from '../config';
53
53
  import { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH } from '../config';
@@ -74,6 +74,11 @@ import { MODEL_TRUST_LEVELS } from '../constants';
74
74
  import { MODEL_ORDERS } from '../constants';
75
75
  import { ORDER_OF_PIPELINE_JSON } from '../constants';
76
76
  import { RESERVED_PARAMETER_NAMES } from '../constants';
77
+ import { LIMITS } from '../constants';
78
+ import { TIME_INTERVALS } from '../constants';
79
+ import { NETWORK_LIMITS } from '../constants';
80
+ import { COLOR_CONSTANTS } from '../constants';
81
+ import { HTTP_STATUS_CODES } from '../constants';
77
82
  import { compilePipeline } from '../conversion/compilePipeline';
78
83
  import { parsePipeline } from '../conversion/parsePipeline';
79
84
  import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
@@ -220,13 +225,12 @@ export { pipelineCollectionToJson };
220
225
  export { createEmptyAgentModelRequirements };
221
226
  export { createBasicAgentModelRequirements };
222
227
  export { NotYetImplementedCommitmentDefinition };
223
- export { getCommitmentDefinition };
224
228
  export { getAllCommitmentDefinitions };
229
+ export { getAllCommitmentsToolTitles };
225
230
  export { getAllCommitmentTypes };
226
- export { isCommitmentSupported };
227
- export type { GroupedCommitmentDefinition };
231
+ export { getCommitmentDefinition };
228
232
  export { getGroupedCommitmentDefinitions };
229
- export { getAllCommitmentsToolFunctions };
233
+ export { isCommitmentSupported };
230
234
  export { NAME };
231
235
  export { ADMIN_EMAIL };
232
236
  export { PROMPTBOOK_LEGAL_ENTITY };
@@ -247,6 +251,7 @@ export { PENDING_VALUE_PLACEHOLDER };
247
251
  export { MAX_FILENAME_LENGTH };
248
252
  export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
249
253
  export { DEFAULT_MAX_PARALLEL_COUNT };
254
+ export { DEFAULT_MAX_CONCURRENT_UPLOADS };
250
255
  export { DEFAULT_MAX_RECURSION };
251
256
  export { DEFAULT_MAX_EXECUTION_ATTEMPTS };
252
257
  export { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH };
@@ -273,6 +278,11 @@ export { MODEL_TRUST_LEVELS };
273
278
  export { MODEL_ORDERS };
274
279
  export { ORDER_OF_PIPELINE_JSON };
275
280
  export { RESERVED_PARAMETER_NAMES };
281
+ export { LIMITS };
282
+ export { TIME_INTERVALS };
283
+ export { NETWORK_LIMITS };
284
+ export { COLOR_CONSTANTS };
285
+ export { HTTP_STATUS_CODES };
276
286
  export { compilePipeline };
277
287
  export { parsePipeline };
278
288
  export { pipelineJsonToString };
@@ -1,5 +1,6 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createPipelineCollectionFromDirectory } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory';
3
+ import { getAllCommitmentsToolFunctionsForNode } from '../commitments/_common/getAllCommitmentsToolFunctionsForNode';
3
4
  import { $provideExecutablesForNode } from '../executables/$provideExecutablesForNode';
4
5
  import { $provideExecutionToolsForNode } from '../execution/utils/$provideExecutionToolsForNode';
5
6
  import { $provideLlmToolsConfigurationFromEnv } from '../llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv';
@@ -12,6 +13,7 @@ import { $execCommand } from '../utils/execCommand/$execCommand';
12
13
  import { $execCommands } from '../utils/execCommand/$execCommands';
13
14
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
14
15
  export { createPipelineCollectionFromDirectory };
16
+ export { getAllCommitmentsToolFunctionsForNode };
15
17
  export { $provideExecutablesForNode };
16
18
  export { $provideExecutionToolsForNode };
17
19
  export { $provideLlmToolsConfigurationFromEnv };
@@ -1,8 +1,10 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
+ import { createOpenAiAgentExecutionTools } from '../llm-providers/openai/createOpenAiAgentExecutionTools';
2
3
  import { createOpenAiAssistantExecutionTools } from '../llm-providers/openai/createOpenAiAssistantExecutionTools';
3
4
  import { createOpenAiCompatibleExecutionTools } from '../llm-providers/openai/createOpenAiCompatibleExecutionTools';
4
5
  import { createOpenAiExecutionTools } from '../llm-providers/openai/createOpenAiExecutionTools';
5
6
  import { OPENAI_MODELS } from '../llm-providers/openai/openai-models';
7
+ import { OpenAiAgentExecutionTools } from '../llm-providers/openai/OpenAiAgentExecutionTools';
6
8
  import { OpenAiAssistantExecutionTools } from '../llm-providers/openai/OpenAiAssistantExecutionTools';
7
9
  import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
8
10
  import { OpenAiCompatibleExecutionTools } from '../llm-providers/openai/OpenAiCompatibleExecutionTools';
@@ -15,10 +17,12 @@ import { _OpenAiRegistration } from '../llm-providers/openai/register-constructo
15
17
  import { _OpenAiAssistantRegistration } from '../llm-providers/openai/register-constructor';
16
18
  import { _OpenAiCompatibleRegistration } from '../llm-providers/openai/register-constructor';
17
19
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
20
+ export { createOpenAiAgentExecutionTools };
18
21
  export { createOpenAiAssistantExecutionTools };
19
22
  export { createOpenAiCompatibleExecutionTools };
20
23
  export { createOpenAiExecutionTools };
21
24
  export { OPENAI_MODELS };
25
+ export { OpenAiAgentExecutionTools };
22
26
  export { OpenAiAssistantExecutionTools };
23
27
  export type { OpenAiAssistantExecutionToolsOptions };
24
28
  export { OpenAiCompatibleExecutionTools };
@@ -9,17 +9,31 @@ import type { AvatarProfileProps } from '../book-components/AvatarProfile/Avatar
9
9
  import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
10
10
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
11
11
  import type { AgentChatProps } from '../book-components/Chat/AgentChat/AgentChatProps';
12
+ import type { AgentChipData } from '../book-components/Chat/AgentChip/AgentChip';
13
+ import type { AgentChipProps } from '../book-components/Chat/AgentChip/AgentChip';
14
+ import type { ChatSoundSystem } from '../book-components/Chat/Chat/ChatProps';
12
15
  import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
16
+ import type { ChatSoundToggleProps } from '../book-components/Chat/Chat/ChatSoundToggle';
17
+ import type { ChatEffect } from '../book-components/Chat/effects/types/ChatEffect';
18
+ import type { ChatEffectConfig } from '../book-components/Chat/effects/types/ChatEffectConfig';
19
+ import type { ChatEffectsSystemProps } from '../book-components/Chat/effects/types/ChatEffectsSystemProps';
20
+ import type { ChatEffectType } from '../book-components/Chat/effects/types/ChatEffectType';
13
21
  import type { ChatAutoScrollConfig } from '../book-components/Chat/hooks/useChatAutoScroll';
14
22
  import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
23
+ import type { FriendlyErrorMessage } from '../book-components/Chat/LlmChat/FriendlyErrorMessage';
15
24
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
16
25
  import type { MockedChatDelayConfig } from '../book-components/Chat/MockedChat/MockedChat';
17
26
  import type { MockedChatProps } from '../book-components/Chat/MockedChat/MockedChat';
18
27
  import type { ChatSaveFormatDefinition } from '../book-components/Chat/save/_common/ChatSaveFormatDefinition';
19
28
  import type { string_chat_format_name } from '../book-components/Chat/save/_common/string_chat_format_name';
29
+ import type { SourceChipProps } from '../book-components/Chat/SourceChip/SourceChip';
30
+ import type { ChatToolCall } from '../book-components/Chat/types/ChatMessage';
20
31
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
21
32
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
33
+ import type { ToolCallChipletInfo } from '../book-components/Chat/utils/getToolCallChipletText';
34
+ import type { ParsedCitation } from '../book-components/Chat/utils/parseCitationsFromContent';
22
35
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
36
+ import type { TeamToolResult } from '../book-components/Chat/utils/toolCallParsing';
23
37
  import type { QrCodeOptions } from '../book-components/Qr/useQrCode';
24
38
  import type { AgentCollection } from '../collection/agent-collection/AgentCollection';
25
39
  import type { AgentCollectionInSupabaseOptions } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions';
@@ -58,7 +72,6 @@ import type { InstrumentCommand } from '../commands/X_INSTRUMENT/InstrumentComma
58
72
  import type { BookCommitment } from '../commitments/_base/BookCommitment';
59
73
  import type { CommitmentDefinition } from '../commitments/_base/CommitmentDefinition';
60
74
  import type { ParsedCommitment } from '../commitments/_base/ParsedCommitment';
61
- import type { GroupedCommitmentDefinition } from '../commitments/index';
62
75
  import type { PrettifyOptions } from '../conversion/prettify/PrettifyOptions';
63
76
  import type { renderPipelineMermaidOptions } from '../conversion/prettify/renderPipelineMermaidOptions';
64
77
  import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/CallbackInterfaceToolsOptions';
@@ -123,6 +136,7 @@ import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-op
123
136
  import type { DeepseekExecutionToolsOptions } from '../llm-providers/deepseek/DeepseekExecutionToolsOptions';
124
137
  import type { GoogleExecutionToolsOptions } from '../llm-providers/google/GoogleExecutionToolsOptions';
125
138
  import type { OllamaExecutionToolsOptions } from '../llm-providers/ollama/OllamaExecutionToolsOptions';
139
+ import type { OpenAiAgentExecutionToolsOptions } from '../llm-providers/openai/OpenAiAgentExecutionTools';
126
140
  import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
127
141
  import type { OpenAiCompatibleExecutionToolsOptions } from '../llm-providers/openai/OpenAiCompatibleExecutionToolsOptions';
128
142
  import type { OpenAiCompatibleExecutionToolsNonProxiedOptions } from '../llm-providers/openai/OpenAiCompatibleExecutionToolsOptions';
@@ -213,6 +227,7 @@ import type { SpeechRecognitionStartOptions } from '../types/SpeechRecognition';
213
227
  import type { SpeechRecognitionState } from '../types/SpeechRecognition';
214
228
  import type { SpeechRecognitionEvent } from '../types/SpeechRecognition';
215
229
  import type { TaskType } from '../types/TaskType';
230
+ import type { ToolCall } from '../types/ToolCall';
216
231
  import type { string_char_emoji } from '../types/typeAliasEmoji';
217
232
  import type { string_business_category_name } from '../types/typeAliases';
218
233
  import type { string_model_name } from '../types/typeAliases';
@@ -389,17 +404,31 @@ export type { AvatarProfileProps };
389
404
  export type { AvatarProfileFromSourceProps };
390
405
  export type { BookEditorProps };
391
406
  export type { AgentChatProps };
407
+ export type { AgentChipData };
408
+ export type { AgentChipProps };
409
+ export type { ChatSoundSystem };
392
410
  export type { ChatProps };
411
+ export type { ChatSoundToggleProps };
412
+ export type { ChatEffect };
413
+ export type { ChatEffectConfig };
414
+ export type { ChatEffectsSystemProps };
415
+ export type { ChatEffectType };
393
416
  export type { ChatAutoScrollConfig };
394
417
  export type { SendMessageToLlmChatFunction };
418
+ export type { FriendlyErrorMessage };
395
419
  export type { LlmChatProps };
396
420
  export type { MockedChatDelayConfig };
397
421
  export type { MockedChatProps };
398
422
  export type { ChatSaveFormatDefinition };
399
423
  export type { string_chat_format_name };
424
+ export type { SourceChipProps };
425
+ export type { ChatToolCall };
400
426
  export type { ChatMessage };
401
427
  export type { ChatParticipant };
428
+ export type { ToolCallChipletInfo };
429
+ export type { ParsedCitation };
402
430
  export type { MessageButton };
431
+ export type { TeamToolResult };
403
432
  export type { QrCodeOptions };
404
433
  export type { AgentCollection };
405
434
  export type { AgentCollectionInSupabaseOptions };
@@ -438,7 +467,6 @@ export type { InstrumentCommand };
438
467
  export type { BookCommitment };
439
468
  export type { CommitmentDefinition };
440
469
  export type { ParsedCommitment };
441
- export type { GroupedCommitmentDefinition };
442
470
  export type { PrettifyOptions };
443
471
  export type { renderPipelineMermaidOptions };
444
472
  export type { CallbackInterfaceToolsOptions };
@@ -503,6 +531,7 @@ export type { AzureOpenAiExecutionToolsOptions };
503
531
  export type { DeepseekExecutionToolsOptions };
504
532
  export type { GoogleExecutionToolsOptions };
505
533
  export type { OllamaExecutionToolsOptions };
534
+ export type { OpenAiAgentExecutionToolsOptions };
506
535
  export type { OpenAiAssistantExecutionToolsOptions };
507
536
  export type { OpenAiCompatibleExecutionToolsOptions };
508
537
  export type { OpenAiCompatibleExecutionToolsNonProxiedOptions };
@@ -593,6 +622,7 @@ export type { SpeechRecognitionStartOptions };
593
622
  export type { SpeechRecognitionState };
594
623
  export type { SpeechRecognitionEvent };
595
624
  export type { TaskType };
625
+ export type { ToolCall };
596
626
  export type { string_char_emoji };
597
627
  export type { string_business_category_name };
598
628
  export type { string_model_name };
@@ -9,6 +9,7 @@ import { isValidCsvString } from '../formats/csv/utils/isValidCsvString';
9
9
  import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
10
10
  import { jsonParse } from '../formats/json/utils/jsonParse';
11
11
  import { isValidXmlString } from '../formats/xml/utils/isValidXmlString';
12
+ import { PromptString } from '../pipeline/prompt-notation';
12
13
  import { prompt } from '../pipeline/prompt-notation';
13
14
  import { promptTemplate } from '../pipeline/prompt-notation';
14
15
  import { $detectRuntimeEnvironment } from '../utils/environment/$detectRuntimeEnvironment';
@@ -99,6 +100,7 @@ export { isValidCsvString };
99
100
  export { isValidJsonString };
100
101
  export { jsonParse };
101
102
  export { isValidXmlString };
103
+ export { PromptString };
102
104
  export { prompt };
103
105
  export { promptTemplate };
104
106
  export { $detectRuntimeEnvironment };
@@ -31,7 +31,7 @@ export type AgentCapability = {
31
31
  /**
32
32
  * The type of the capability
33
33
  */
34
- type: 'browser' | 'search-engine' | 'knowledge' | 'time' | 'inheritance' | 'import';
34
+ type: 'browser' | 'search-engine' | 'knowledge' | 'time' | 'inheritance' | 'import' | 'image-generator' | 'team' | 'email';
35
35
  /**
36
36
  * The label to display for this capability
37
37
  */
@@ -108,6 +108,15 @@ export type AgentBasicInformation = {
108
108
  question: string | null;
109
109
  answer: string;
110
110
  }>;
111
+ /**
112
+ * Knowledge sources (documents, URLs) used by the agent
113
+ * This is parsed from KNOWLEDGE commitments
114
+ * Used for resolving document citations when the agent references sources
115
+ */
116
+ knowledgeSources: Array<{
117
+ url: string;
118
+ filename: string;
119
+ }>;
111
120
  };
112
121
  /**
113
122
  * TODO: [🐱‍🚀] Make all properties of `AgentBasicInformation` readonly
@@ -0,0 +1,28 @@
1
+ import type { string_agent_url } from '../../types/typeAliases';
2
+ /**
3
+ * Parsed TEAM teammate entry.
4
+ *
5
+ * @private
6
+ */
7
+ export type TeamTeammate = {
8
+ url: string_agent_url;
9
+ label: string;
10
+ instructions: string;
11
+ };
12
+ /**
13
+ * Options for parsing TEAM commitment content.
14
+ *
15
+ * @private
16
+ */
17
+ export type ParseTeamCommitmentOptions = {
18
+ strict?: boolean;
19
+ };
20
+ /**
21
+ * Parses TEAM commitment content into teammates with instructions.
22
+ *
23
+ * @private
24
+ */
25
+ export declare function parseTeamCommitmentContent(content: string, options?: ParseTeamCommitmentOptions): TeamTeammate[];
26
+ /**
27
+ * Note: [💞] Ignore a discrepancy between file name and entity name
28
+ */
@@ -55,7 +55,7 @@ export type BookEditorProps = {
55
55
  /**
56
56
  * returns the URL of the uploaded file on CDN or storage
57
57
  */
58
- onFileUpload?(file: File): Promisable<string_knowledge_source_content>;
58
+ onFileUpload?(file: File, onProgress?: (progress: number_percent) => void): Promisable<string_knowledge_source_content>;
59
59
  /**
60
60
  * If true, logs verbose debug info to the console and shows additional visual cues
61
61
  */
@@ -10,4 +10,9 @@ export type AgentChatProps = Omit<LlmChatProps, 'thread' | 'llmTools' | 'initial
10
10
  * The agent to chat with
11
11
  */
12
12
  readonly agent: Agent;
13
+ /**
14
+ * Optional mapping of technical tool names to human-readable titles.
15
+ * e.g., { "web_search": "Searching the web..." }
16
+ */
17
+ readonly toolTitles?: Record<string, string>;
13
18
  };
@@ -0,0 +1,67 @@
1
+ /// <reference types="react" />
2
+ import type { string_url } from '../../../types/typeAliases';
3
+ /**
4
+ * Agent profile information for chip display
5
+ */
6
+ export type AgentChipData = {
7
+ /**
8
+ * Agent URL (required)
9
+ */
10
+ url: string_url;
11
+ /**
12
+ * Agent display name/label
13
+ */
14
+ label?: string;
15
+ /**
16
+ * Agent profile image URL
17
+ */
18
+ imageUrl?: string_url;
19
+ /**
20
+ * Public URL of the agents server (for generating placeholder images)
21
+ */
22
+ publicUrl?: string_url;
23
+ };
24
+ /**
25
+ * Props for AgentChip component
26
+ */
27
+ export type AgentChipProps = {
28
+ /**
29
+ * Agent data to display
30
+ */
31
+ agent: AgentChipData;
32
+ /**
33
+ * Whether this is an ongoing interaction (shows spinner)
34
+ */
35
+ isOngoing?: boolean;
36
+ /**
37
+ * Whether this is clickable (completed state)
38
+ */
39
+ isClickable?: boolean;
40
+ /**
41
+ * Click handler
42
+ */
43
+ onClick?: (event?: React.MouseEvent) => void;
44
+ /**
45
+ * Additional CSS class name
46
+ */
47
+ className?: string;
48
+ };
49
+ /**
50
+ * AgentChip component - displays a chip with agent avatar and name
51
+ *
52
+ * This component is used to display agent interactions in chat messages.
53
+ * It fetches the agent profile if needed and displays the agent's avatar and name.
54
+ *
55
+ * @example
56
+ * ```tsx
57
+ * <AgentChip
58
+ * agent={{ url: 'https://agents.example.com/joe', label: 'Joe' }}
59
+ * isOngoing={false}
60
+ * isClickable={true}
61
+ * onClick={() => console.log('clicked')}
62
+ * />
63
+ * ```
64
+ *
65
+ * @private utility of `ChatMessageItem` component
66
+ */
67
+ export declare function AgentChip({ agent, isOngoing, isClickable, onClick, className }: AgentChipProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { AgentChip } from './AgentChip';
2
+ export type { AgentChipData, AgentChipProps } from './AgentChip';
@@ -2,6 +2,7 @@
2
2
  import type { id } from '../../../types/typeAliases';
3
3
  import type { ChatMessage } from '../types/ChatMessage';
4
4
  import type { ChatParticipant } from '../types/ChatParticipant';
5
+ import { type ParsedCitation } from '../utils/parseCitationsFromContent';
5
6
  import type { ChatProps } from './ChatProps';
6
7
  /**
7
8
  * Props for the `ChatMessageItem` component
@@ -33,11 +34,42 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'participants'> & {
33
34
  * Called when the create agent button is pressed for book code blocks.
34
35
  */
35
36
  onCreateAgent?: (bookContent: string) => void;
37
+ /**
38
+ * Optional mapping of technical tool names to human-readable titles.
39
+ * e.g., { "web_search": "Searching the web..." }
40
+ */
41
+ toolTitles?: Record<string, string>;
42
+ /**
43
+ * Optional metadata about teammates for team tool calls
44
+ * Maps tool name to agent information
45
+ */
46
+ teammates?: TeammatesMap;
47
+ /**
48
+ * Called when a tool call chiplet is clicked.
49
+ */
50
+ onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
51
+ /**
52
+ * Called when a source citation chip is clicked.
53
+ */
54
+ onCitationClick?: (citation: ParsedCitation) => void;
55
+ };
56
+ /**
57
+ * Metadata for a teammate agent tool.
58
+ */
59
+ type TeammateMetadata = {
60
+ url: string;
61
+ label?: string;
62
+ instructions?: string;
63
+ toolName: string;
36
64
  };
65
+ /**
66
+ * Lookup map of teammate metadata by tool name.
67
+ */
68
+ type TeammatesMap = Record<string, TeammateMetadata>;
37
69
  /**
38
70
  * Renders a single chat message item with avatar, content, buttons, and rating.
39
71
  *
40
72
  * @private internal subcomponent of `<Chat>` component
41
73
  */
42
- export declare const ChatMessageItem: import("react").MemoExoticComponent<({ message, participant, participants, isLastMessage, onMessage, setExpandedMessageId, isExpanded, currentRating, handleRating, mode, isCopyButtonEnabled, isFeedbackEnabled, onCopy, onCreateAgent, }: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
74
+ export declare const ChatMessageItem: import("react").MemoExoticComponent<(props: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
43
75
  export {};
@@ -1,11 +1,26 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
+ import { Color } from '../../../_packages/color.index';
4
+ import { SpeechRecognition } from '../../../types/SpeechRecognition';
5
+ import { string_color } from '../../../types/typeAliases';
3
6
  import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
4
7
  import type { ChatMessage } from '../types/ChatMessage';
5
8
  import type { ChatParticipant } from '../types/ChatParticipant';
6
- import { string_color } from '../../../types/typeAliases';
7
- import { Color } from '../../../_packages/color.index';
8
- import { SpeechRecognition } from '../../../types/SpeechRecognition';
9
+ /**
10
+ * Interface for sound system that can be passed to Chat component
11
+ * This allows the chat to trigger sounds without tight coupling
12
+ *
13
+ * @public exported from `@promptbook/components`
14
+ */
15
+ export type ChatSoundSystem = {
16
+ /**
17
+ * @@@
18
+ */
19
+ play(event: string): Promise<void>;
20
+ isEnabled(): boolean;
21
+ setEnabled(enabled: boolean): void;
22
+ toggle(): boolean;
23
+ };
9
24
  /**
10
25
  * @public exported from `@promptbook/components`
11
26
  */
@@ -149,6 +164,26 @@ export type ChatProps = {
149
164
  * Keys should match ChatMessage.from values (e.g., 'USER', 'AGENT_{id}', etc.)
150
165
  */
151
166
  readonly participants?: ReadonlyArray<ChatParticipant>;
167
+ /**
168
+ * Optional mapping of technical tool names to human-readable titles.
169
+ * e.g., { "web_search": "Searching the web..." }
170
+ */
171
+ readonly toolTitles?: Record<string, string>;
172
+ /**
173
+ * Optional metadata about teammates for team tool calls
174
+ * Maps tool name to agent information
175
+ */
176
+ readonly teammates?: Record<string, {
177
+ url: string;
178
+ label?: string;
179
+ instructions?: string;
180
+ toolName: string;
181
+ }>;
182
+ /**
183
+ * Optional callback to create a new agent from the template.
184
+ * If provided, renders the [Create Agent] button for book code blocks.
185
+ */
186
+ onCreateAgent?: (bookContent: string) => void;
152
187
  /**
153
188
  * Optional callback for handling user feedback on messages
154
189
  * When provided, star rating buttons (1-5 stars) will be displayed next to each message
@@ -185,10 +220,56 @@ export type ChatProps = {
185
220
  */
186
221
  isCopyButtonEnabled?: boolean;
187
222
  /**
188
- * Optional callback for creating an agent from a book code block.
189
- * When provided, "Create Agent" buttons will be shown for book code blocks.
223
+ * Called when a tool call chiplet is clicked.
190
224
  */
191
- onCreateAgent?: (bookContent: string) => void;
225
+ onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
226
+ /**
227
+ * Visual style of the chat component
228
+ */
229
+ readonly visual: 'STANDALONE' | 'FULL_PAGE';
230
+ /**
231
+ * Optional array of effect configurations for chat animations
232
+ * When provided, enables visual effects (confetti, hearts, etc.) based on emojis in messages
233
+ *
234
+ * Example:
235
+ * ```typescript
236
+ * [
237
+ * { trigger: '🎉', effectType: 'CONFETTI' },
238
+ * { trigger: /❤️|💙|💚/, effectType: 'HEARTS' }
239
+ * ]
240
+ * ```
241
+ */
242
+ readonly effectConfigs?: ReadonlyArray<{
243
+ trigger: string | RegExp;
244
+ effectType: string;
245
+ }>;
246
+ /**
247
+ * Optional sound system for playing chat sounds
248
+ * When provided, enables sound effects for message events, button clicks, and visual effects
249
+ *
250
+ * The sound system should implement the ChatSoundSystem interface:
251
+ * - play(event: string): Plays a sound for the given event
252
+ * - isEnabled(): Returns whether sounds are enabled
253
+ * - setEnabled(enabled: boolean): Enables or disables sounds
254
+ * - toggle(): Toggles sound on/off and returns the new state
255
+ *
256
+ * Supported events:
257
+ * - 'message_send': When user sends a message
258
+ * - 'message_receive': When agent sends a message
259
+ * - 'message_typing': When agent is typing/thinking
260
+ * - 'button_click': When any button is clicked
261
+ * - 'effect_confetti': When confetti effect is triggered
262
+ * - 'effect_hearts': When hearts effect is triggered
263
+ *
264
+ * @example
265
+ * ```typescript
266
+ * import { createDefaultSoundSystem } from '@/utils/sound/createDefaultSoundSystem';
267
+ *
268
+ * const soundSystem = createDefaultSoundSystem();
269
+ * <Chat soundSystem={soundSystem} ... />
270
+ * ```
271
+ */
272
+ readonly soundSystem?: ChatSoundSystem;
192
273
  };
193
274
  /**
194
275
  * TODO: [☁️] Export component prop types only to `@promptbook/components` (not `@promptbook/types`)
@@ -0,0 +1,23 @@
1
+ import type { ChatSoundSystem } from './ChatProps';
2
+ /**
3
+ * Props for the ChatSoundToggle component
4
+ */
5
+ export type ChatSoundToggleProps = {
6
+ /**
7
+ * The sound system instance
8
+ */
9
+ soundSystem: ChatSoundSystem;
10
+ /**
11
+ * Optional CSS class name
12
+ */
13
+ className?: string;
14
+ };
15
+ /**
16
+ * ChatSoundToggle component
17
+ *
18
+ * Renders a toggle button/checkbox to enable/disable chat sounds.
19
+ * The state is persisted in localStorage via the SoundSystem.
20
+ *
21
+ * @public exported from `@promptbook/components`
22
+ */
23
+ export declare function ChatSoundToggle(props: ChatSoundToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Renders a nice clock icon with a specific time.
3
+ *
4
+ * @private internal subcomponent of `<Chat>` component
5
+ */
6
+ export declare function ClockIcon({ date, size }: {
7
+ date: Date;
8
+ size?: number;
9
+ }): import("react/jsx-runtime").JSX.Element;